Cov txheej txheem:

DFPlayer Raws Lub Suab Sampler Nrog Capacitive Sensors: 9 Cov Kauj Ruam
DFPlayer Raws Lub Suab Sampler Nrog Capacitive Sensors: 9 Cov Kauj Ruam

Video: DFPlayer Raws Lub Suab Sampler Nrog Capacitive Sensors: 9 Cov Kauj Ruam

Video: DFPlayer Raws Lub Suab Sampler Nrog Capacitive Sensors: 9 Cov Kauj Ruam
Video: Creating a Predictive Model for Each Player Cluster 2024, Lub Xya hli ntuj
Anonim
DFPlayer Raws Suab Sampler Nrog Capacitive Sensors
DFPlayer Raws Suab Sampler Nrog Capacitive Sensors

Taw qhia

Tom qab sim nrog kev tsim kho cov sib xyaw ua ke sib txawv, kuv tau teeb tsa los tsim lub sampler suab, uas tuaj yeem hloov pauv tau yooj yim thiab pheej yig.

Kom muaj lub suab zoo (44.1 kHz) thiab muaj peev xwm txaus, DFPlayer module tau siv, uas siv micro SD nco daim npav los khaws txog 32 gigabytes ntawm cov ntaub ntawv. Cov qauv no tsuas yog muaj peev xwm ua si ib lub suab ib zaug, yog li peb yuav siv ob qho.

Lwm qhov kev xav tau rau txoj haujlwm yog qhov kev hloov pauv hauv Circuit Court tuaj yeem hloov pauv mus rau qhov sib txawv sib txawv, uas yog vim li cas peb thiaj xaiv cov khoom siv hluav taws xob tsis siv cov nyees khawm.

Capacitive sensors tuaj yeem ua haujlwm nrog tsuas yog txhais tes kov nrog txhua qhov hlau txuas nrog lub sensor.

Rau kev nyeem ntawv ntawm cov ntsuas peb yuav siv Arduino nano, vim nws lub peev xwm thiab qhov loj me.

yam ntxwv

6 lub suab sib txawv

Qhib los ntawm capacitive sensors.

Polyphony ntawm 2 suab ib zaug.

Kauj Ruam 1: Cov Khoom thiab Cov Cuab Yeej

Cov Ntaub Ntawv thiab Cov Cuab Yeej
Cov Ntaub Ntawv thiab Cov Cuab Yeej
Cov Ntaub Ntawv thiab Cov Cuab Yeej
Cov Ntaub Ntawv thiab Cov Cuab Yeej

Khoom siv

Arduino Nano

2x DFPlayer

2x micro SD

3.5 Audio Jack

2.1 DC Jack

10x10 tooj liab pawg thawj coj saib

Ferric Chloride

Cov kab hlau txuas https://www.ebay.com/itm/Fine-Solder-Wire-0-6mm-6 …

PCB hloov pauv papper

Cov cuab yeej

Solder Hlau

Cheebtsam hlau txiav

Khoos phis tawj

Hlau

Software

Arduino Lub Tswv Yim

Kicad

ADTouch Librarie

Ceev DFPlayer Librarie

Kauj Ruam 2: Nws Ua Haujlwm Li Cas

Tus qauv piv txwv ua haujlwm raws li hauv qab no, siv ADTouch lub tsev qiv ntawv peb hloov 6 ntawm cov chaw nres nkoj sib piv ntawm Arduino Nano rau hauv cov khoom siv hluav taws xob.

Raws li lub ntsuas pa peb tuaj yeem siv ib qho ntawm cov hlau txuas nrog rau ib qho ntawm cov pins los ntawm txoj hlua.

Koj tuaj yeem nyeem ntxiv txog lub tsev qiv ntawv thiab lub peev xwm ntsuas ntawm qhov txuas hauv qab no

Thaum ib qho ntawm cov ntsuas no tau kov, arduino pom qhov hloov pauv ntawm lub peev xwm thiab tom qab ntawd xa qhov kev txiav txim kom ua tiav lub suab sib xws rau lub ntsuas ntawd mus rau DFPlayer cov qauv.

Txhua tus qauv DFPlayer tuaj yeem ua suab ib zaug xwb, yog li kom muaj peev xwm ua tiav 2 lub suab nyob rau lub sijhawm ntsuas ntsuas siv 2 tus qauv.

Kauj ruam 3: Schematic

Schematic
Schematic

Hauv daim duab peb tuaj yeem pom yuav ua li cas arduino thiab ob DFPlayer cov qauv txuas nrog

R1 thiab R2 (1 k) yog txhawm rau txuas cov qauv rau DFPlayers.

R 3 4 5 thiab 6 (10k) yog rau sib xyaw cov txiaj ntsig ntawm cov l thiab r ntawm cov qauv.

R 7 (330) yog kev tiv thaiv kev tiv thaiv ntawm LED uas yuav siv los ua qhov taw qhia tias arduino tab tom muaj zog.

Kauj Ruam 4: Tsim PCB

Tsim PCB
Tsim PCB
Tsim PCB
Tsim PCB
Tsim PCB
Tsim PCB

Tom ntej no peb yuav tsim cov phaj siv cov txheej txheem hloov cua sov, uas tau piav qhia hauv cov lus qhia no:

6 cov ntaub qhwv tau muab tso rau ntawm lub rooj tsavxwm uas tso cai rau siv tus qauv piv txwv yam tsis xav tau lub ntsuas cua sab nraud.

Kauj Ruam 5: Soldering Cheebtsam

Soldering Cheebtsam
Soldering Cheebtsam
Soldering Cheebtsam
Soldering Cheebtsam
Soldering Cheebtsam
Soldering Cheebtsam

Tom ntej no peb yuav solder lub Cheebtsam.

Ua ntej cov resistors.

Nws raug nquahu kom siv lub taub hau los teeb tsa Arduino thiab cov qauv yam tsis siv lawv ncaj qha.

Txhawm rau txhawm rau lub taub hau pib nrog tus pin, tom qab ntawv xyuas tias nws nyob zoo, thiab tom qab ntawd muab cov laug txuas ntxiv.

Thaum kawg peb yuav solder cov txuas

Kauj Ruam 6: Nruab Lub Tsev Qiv Ntawv

Nruab Lub Tsev Qiv Ntawv
Nruab Lub Tsev Qiv Ntawv
Nruab Lub Tsev Qiv Ntawv
Nruab Lub Tsev Qiv Ntawv

Hauv qhov haujlwm no peb yuav siv peb lub tsev qiv ntawv uas peb xav tau los teeb tsa:

SoftwareSerial.h. Hauv

DFPlayerMini_Fast.h

ADCTouch.h

Hauv qhov txuas hauv qab no koj tuaj yeem pom hauv kev nthuav dav yuav ua li cas rau nruab cov tsev qiv ntawv hauv Arduino

www.arduino.cc/en/guide/libraries

Kauj ruam 7: Code

Tam sim no peb tuaj yeem xa cov cai mus rau Arduino board.

Rau qhov no peb yuav tsum xaiv pawg Arduino Nano.

#include #include #include

int ref0, ref1, ref2, ref3, ref4, ref5; tus th;

SoftwareSerial mySerial (8, 9); // RX, TX DFPlayerMini_Fast myMP3;

SoftwareSerial mySerial2 (10, 11); // RX, TX DFPlayerMini_Fast myMP32;

void teeb () {int th = 550; // Serial.begin (9600); mySerial.begin (9600); mySerial2.begin (9600); myMP3.begin (mySerial); myMP32.begin (mySerial2); myMP3.volume (18); ref0 = ADCTouch.read (A0, 500); ref1 = ADCTouch.read (A1, 500); ref2 = ADCTouch.read (A2, 500); ref3 = ADCTouch.read (A3, 500); ref4 = ADCTouch.read (A4, 500); ref5 = ADCTouch.read (A5, 500);

}

void voj () {

int total1 = ADCTouch.read (A0, 20); int total2 = ADCTouch.read (A1, 20); int tag nrho 3 = ADCTouch.read (A2, 20); int tag nrho 4 = ADCTouch.read (A3, 20); int tag nrho 5 = ADCTouch.read (A4, 20); int tag nrho = ADCTouch.read (A5, 20);

total1 -= ref0; total2 -= ref1; total3 -= ref2; tag nrho 4 -= ref3; tag nrho 5 -= ref4; tag nrho 6 -= ref5; // // Serial.print (total1> th); // Serial.print (total2> th); // Serial.print (total3> th); // Serial.print (total4> th); // Serial.print (total5> th); // Serial.println (total6> th);

// Serial.print (tag nrho 1); // Serial.print ("\ t"); // Serial.print (tag nrho 2); // Serial.print ("\ t"); // Serial.print (tag nrho 3); // Serial.print ("\ t"); // Serial.print (tag nrho 4); // Serial.print ("\ t"); // Serial.print (tag nrho 5); // Serial.print ("\ t"); // Serial.println (total6); yog (total1> 100 && total1> th) {myMP32.play (1); // Serial.println ("o1"); }

yog (total2> 100 && total2> th) {myMP32.play (2); //Serial.println("o2 "); }

yog (total3> 100 && total3> th) {

myMP32.play (3); //Serial.println("o3 ");

}

yog (total4> 100 && total4> th) {

myMP3.play (1); //Serial.println("o4 ");

}

yog (total5> 100 && total5> th) {

myMP3.play (2); //Serial.println("o5 ");

}

yog (total6> 100 && total6> th) {

myMP3.play (3); //Serial.println("o6 ");

} // tsis ua dab tsi ncua (1); }

Kauj Ruam 8: Thauj Lub Suab Rau Hauv Daim Npav Nco

Tam sim no koj tuaj yeem thauj koj lub suab hauv daim npav micro SD

Hom ntawv yuav tsum yog 44.1 kHz thiab 16 ntsis wav

Koj yuav tsum tshaj tawm 3 lub suab ntawm txhua daim npav SD.

Kauj Ruam 9: Kev Sib Tham

Image
Image

Lub sijhawm no koj tuaj yeem khiav koj tus qauv nrog cov ntaub qhwv hauv PCB, tab sis koj tseem muaj peev xwm los kho nws, xaiv rooj plaub thiab cov khoom sib txawv lossis cov hlau hlau los siv ua cov ntsuas.

Hauv qhov no kuv siv 3 lub taub hau taub hau uas kuv muab hlau ntsia hlau ua lub suab hu xov tooj.

Rau qhov no, txuas cov ntsia hlau rau lub pins ntawm pawg thawj coj los ntawm kev siv cov hlua.

Koj tuaj yeem siv txhua yam khoom siv hlau, daim kab xev conductive lossis sim nrog tus cwj mem coj ua.

Pom zoo: