Stuthan consumable:
1。 Obviously with power supply
2 bàr solais LED. Esp8266 / nód MCU
3。 IR emitter leader
4。 resistance
5。 Programming cable
6。 arduino ide
7。 Soldering iron (some basic welding)
8。 7805 IC (for using LED power supply as ESP power supply)
9。 Step 1: prepare ESP
An toiseach, ceangail nodemcu ri coimpiutair no laptop.
A-nis stàlaich an draibhear airson nodemcu (a ’cleachdadh rannsachadh Google).
Às deidh dhut an Arduino IDE fhosgladh (gu dearbh, feumaidh tu a luchdachadh sìos agus a stàladh), cliog Innealan air bàr inneal Arduino, an uairsin cliog air bòrd, tagh manaidsear bùird agus lorg stàladh esp8266 (bheir e beagan ùine airson a chrìochnachadh)
A-nis tagh "sgeidse" bho bhàr-inneal Arduino, tagh "cuir a-steach leabharlann", an uairsin tagh "stiùirich leabharlann", lorg "iremoteesp8266" agus stàlaich e
A-nis, gus an rèiteachadh a chrìochnachadh a-mhàin tro "innealan", feumaidh tu a dhol gu "motherboard" agus tagh "nodemcu 1.0 (ESP 12-e)" no dreachan eile de esp8266.
Ceum 2: ullaich agus deuchainn an IR LED
An toiseach, feumaidh sinn a stàladh
Rach an seo
Comharraich an stiall solais LED agad, ge bith an e smachd iomallach 24 iuchrach no iuchair 44 (nas motha) a th’ ann
Gus an còd smachd iomallach fhaighinn an seo
Às deidh dhuinn an leabharlann a chuir a-steach, dheasaich sinn na IR LEDs againn le bhith a’ ceangal na IR LEDs mar a chithear san fhigear. Ceangail an IR air a stiùireadh thuige, an uairsin luchdaich suas an sgeidse a leanas agus comharraich an IR air a stiùireadh chun rianadair. Bu chòir don bhàr LED frasadh (air is dheth) // Smachd iomallach le iuchraichean 24 agus 44 aig an aon àm.
Seo an còd airson seo a dhèanamh.
#define IR_ OFF 0xF740BF // Còdan ir ath-sheòrsach ann an 32 pìosan
#define IR_ AIR 0xF7C0
#includeIRsend irsend(4); // IR pin
void setup() {
irsend.begin();
}
void loop() {
irsend.sendNEC(IR_ON, 32);
delay(5000);
irsend.sendNEC(IR_OFF, 32);
delay(5000);
}
Ceum 3: wiring agus ag ullachadh a 'mhicreofon
Cha chleachd sinn ach am prìne analog de espe8266 A0 mar an cuir a-steach mar an comharra analog agus cleachdaidh sinn e gus an comharra infridhearg stèidhichte air fuaim a bhrosnachadh
Ceangail am prìne ri A0
Ceangail 5V ri VIN (leis nach eil toradh 5V aig nód MCU)
San dòigh seo, bidh sinn a ’ceangal prìne IR LED D2 den cheangal co-thaobhadh ri glacadair a’ bhàr solais LED.
a
Ceum 4: luchdaich suas an còd agus dèan deiseil
# gabhail a-steach
# gabhail a-steach
# mìneachadh microfònPin A0
int fuaim;
int fuaim 1;
const int irPin = 4; // d2IRsend irsend(irPin); void setup() {
Serial.begin(9600);
pinMode(microphonePin, INPUT);
pinMode(irPin, OUTPUT);}
// ir Codes led
#define IR_ BPlus 0xFF3AC5 //
#define IR_ BMinus 0xFFBA45 //
#define IR_ ON 0xFF827D //
#define IR_ OFF 0xFF02FD //
#define IR_ R 0xFF1AE5 //
#define IR_ G 0xFF9A65 //
#define IR_ B 0xFFA25D //
#define IR_ W 0xFF22DD //
#define IR_ B1 0xFF2AD5 //
#define IR_ B2 0xFFAA55 //
#define IR_ B3 0xFF926D //
#define IR_ B4 0xFF12ED //
#define IR_ B5 0xFF0AF5 //
#define IR_ B6 0xFF8A75 //
#define IR_ B7 0xFFB24D //
#define IR_ B8 0xFF32CD //
#define IR_ B9 0xFF38C7 //
#define IR_ B10 0xFFB847 //
#define IR_ B11 0xFF7887 //
#define IR_ B12 0xFFF807 //
#define IR_ B13 0xFF18E7 //
#define IR_ B14 0xFF9867 //
#define IR_ B15 0xFF58A7 //
#define IR_ B16 0xFFD827 //
#define IR_ UPR 0xFF28D7 //
#define IR_ UPG 0xFFA857 //
#define IR_ UPB 0xFF6897 //
#define IR_ QUICK 0xFFE817 //
#define IR_ DOWNR 0xFF08F7 //
#define IR_ DOWNG 0xFF8877 //
#define IR_ DOWNB 0xFF48B7 //
#define IR_ SLOW 0xFFC837 //
#define IR_ DIY1 0xFF30CF //
#define IR_ DIY2 0xFFB04F //
#define IR_ DIY3 0xFF708F //
#define IR_ AUTO 0xFFF00F //
#define IR_ DIY4 0xFF10EF //
#define IR_ DIY5 0xFF906F //
#define IR_ DIY6 0xFF50AF //
#define IR_ FLASH 0xFFD02F //
#define IR_ JUMP3 0xFF20DF //
#define IR_ JUMP7 0xFFA05F //
#define IR_ FADE3 0xFF609F //
#define IR_ FADE7 0xFFE01F //
void loop() {
sound = analogRead(microphonePin); // getting input audio signal reading
Serial.print(sound); // input audio signal readings to Serial display
Serial.print( “” );
if (sound 》 415)
{
sound1 = map(sound, 415, 750, 140, 255); // mapping higher frequency values which are above offset to the scale of 150 - 255
}
else if (sound 》 340 && sound 《 415) // keeping offset reading to zero scale..here offset value in the range of 340 - 415(offset value at 1.45v) 。.its depends on componets used in circuit.。
{
sound1 = map(sound, 340, 415, 0, 9);
}
else if (sound 《 340)
{
sound1 = map(sound, 0, 340, 10, 139); // keeping below offset readings to scale of 1-139.。
}
if (sound1 》 240)
{
irsend.sendNEC(IR_FLASH, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
}
else if ((sound1) 》 200)
{
irsend.sendNEC(IR_G, 32);
irsend.sendNEC(IR_B, 32);
delay(120);}
else if (sound1 》 160)
{
irsend.sendNEC(IR_R, 32);
irsend.sendNEC(IR_B, 32);
delay(120);
}
else if (sound1 》 120)
{
irsend.sendNEC(IR_B, 32);
delay(120);
}
else if (sound1 》 80)
{
irsend.sendNEC(IR_B, 32);
delay(120);
}
else if (sound1 》 40)
{
irsend.sendNEC(IR_G, 32);
delay(120);
}
else if (sound1 》 10)
{
irsend.sendNEC(IR_R, 32);
delay(120);}
Stuthan eile a ghabhas ithe:
1. Gu follaiseach le solar cumhachd
2 bàr solais LED. Esp8266 / nód MCU
3. Ceannard emitter IR
4. Resistance
5. Càball prògramadh
6。 arduino ide
7. Iarann sèididh (tàthadh bunaiteach)
8. 7805 IC (airson solar cumhachd LED a chleachdadh mar sholar cumhachd ESP)
9. Ceum 1: ullaich ESP
An toiseach, ceangail nodemcu ri coimpiutair no laptop.
A-nis stàlaich an draibhear airson nodemcu (a ’cleachdadh rannsachadh Google).
Às deidh dhut an Arduino IDE fhosgladh (gu dearbh, feumaidh tu a luchdachadh sìos agus a stàladh), cliog Innealan air bàr inneal Arduino, an uairsin cliog air bòrd, tagh manaidsear bùird agus lorg stàladh esp8266 (bheir e beagan ùine airson a chrìochnachadh)
A-nis tagh "sgeidse" bho bhàr-inneal Arduino, tagh "cuir a-steach leabharlann", an uairsin tagh "stiùirich leabharlann", lorg "iremoteesp8266" agus stàlaich e
A-nis, gus an rèiteachadh a chrìochnachadh a-mhàin tro "innealan", feumaidh tu a dhol gu "motherboard" agus tagh "nodemcu 1.0 (ESP 12-e)" no dreachan eile de esp8266.
Ceum 2: ullaich agus deuchainn an IR LED
An toiseach, feumaidh sinn a stàladh
Rach an seo
Comharraich an stiall solais LED agad, ge bith an e smachd iomallach 24 iuchrach no iuchair 44 (nas motha) a th’ ann
Gus an còd smachd iomallach fhaighinn an seo
Às deidh dhuinn an leabharlann a chuir a-steach, dheasaich sinn an IR againn air a stiùireadh le bhith a’ ceangal an IR LED mar a chithear san fhigear. Ceangail an IR air a stiùireadh thuige, an uairsin luchdaich suas an sgeidse a leanas agus comharraich an IR air a stiùireadh chun rianadair. Bu chòir don bhàr solais LED frasadh (air is dheth). // faodar an smachd iomallach le iuchraichean 24 agus 44 a chleachdadh aig an aon àm.
Seo an còd airson seo a dhèanamh.
#define IR_OFF 0xF740BF // Còdan ir ath-sheòrsach ann an 32 bit
#define IR_ON 0xF7C0
# gabhail a-steach
IRsend irsend(4); // IR pin
void setup() {
irsend.begin();
}
void loop() {
irsend.sendNEC(IR_ON, 32);
delay(5000);
irsend.sendNEC(IR_OFF, 32);
delay(5000);
}
Ceum 3: wiring agus ag ullachadh a 'mhicreofon
Cha chleachd sinn ach am prìne analog de espe8266 A0 mar an cuir a-steach mar an comharra analog agus cleachdaidh sinn e gus an comharra infridhearg stèidhichte air fuaim a bhrosnachadh
Ceangail am prìne ri A0
Ceangail 5V ri VIN (leis nach eil toradh 5V aig nód MCU)
San dòigh seo, bidh sinn a ’ceangal prìne IR LED D2 den cheangal co-thaobhadh ri glacadair a’ bhàr solais LED.
a
Ceum 4: luchdaich suas an còd agus dèan deiseil
# gabhail a-steach
# gabhail a-steach
# mìneachadh microfònPin A0
int fuaim;
int fuaim 1;
const int irPin = 4; //d2IRsend irsend(irPin);void setup() {
Serial.begin(9600);
pinMode(microphonePin, INPUT);
pinMode(irPin, OUTPUT);}
// ir Codes led
#define IR_BPlus 0xFF3AC5 //
#define IR_BMinus 0xFFBA45 //
#define IR_ON 0xFF827D //
#define IR_OFF 0xFF02FD //
#define IR_R 0xFF1AE5 //
#define IR_G 0xFF9A65 //
#define IR_B 0xFFA25D //
#define IR_W 0xFF22DD //
#define IR_B1 0xFF2AD5 //
#define IR_B2 0xFFAA55 //
#define IR_B3 0xFF926D //
#define IR_B4 0xFF12ED //
#define IR_B5 0xFF0AF5 //
#define IR_B6 0xFF8A75 //
#define IR_B7 0xFFB24D //
#define IR_B8 0xFF32CD //
#define IR_B9 0xFF38C7 //
#define IR_B10 0xFFB847 //
#define IR_B11 0xFF7887 //
#define IR_B12 0xFFF807 //
#define IR_B13 0xFF18E7 //
#define IR_B14 0xFF9867 //
#define IR_B15 0xFF58A7 //
#define IR_B16 0xFFD827 //
#define IR_UPR 0xFF28D7 //
#define IR_UPG 0xFFA857 //
#define IR_UPB 0xFF6897 //
#define IR_QUICK 0xFFE817 //
#define IR_DOWNR 0xFF08F7 //
#define IR_DOWNG 0xFF8877 //
#define IR_DOWNB 0xFF48B7 //
#define IR_SLOW 0xFFC837 //
#define IR_DIY1 0xFF30CF //
#define IR_DIY2 0xFFB04F //
#define IR_DIY3 0xFF708F //
#define IR_AUTO 0xFFF00F //
#define IR_DIY4 0xFF10EF //
#define IR_DIY5 0xFF906F //
#define IR_DIY6 0xFF50AF //
#define IR_FLASH 0xFFD02F //
#define IR_JUMP3 0xFF20DF //
#define IR_JUMP7 0xFFA05F //
#define IR_FADE3 0xFF609F //
#define IR_FADE7 0xFFE01F //
void loop() {
sound = analogRead(microphonePin); // getting input audio signal reading
Serial.print(sound); // input audio signal readings to Serial display
Serial.print( “” );
if (sound 》 415)
{
sound1 = map(sound, 415, 750, 140, 255); // mapping higher frequency values which are above offset to the scale of 150 - 255
}
else if (sound 》 340 && sound 《 415) // keeping offset reading to zero scale..here offset value in the range of 340 - 415(offset value at 1.45v) 。.its depends on componets used in circuit.。
{
sound1 = map(sound, 340, 415, 0, 9);
}
else if (sound 《 340)
{
sound1 = map(sound, 0, 340, 10, 139); // keeping below offset readings to scale of 1-139.。
}
if (sound1 》 240)
{
irsend.sendNEC(IR_FLASH, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
irsend.sendNEC(IR_QUICK, 32);
}
else if ((sound1) 》 200)
{
irsend.sendNEC(IR_G, 32);
irsend.sendNEC(IR_B, 32);
delay(120);}
else if (sound1 》 160)
{
irsend.sendNEC(IR_R, 32);
irsend.sendNEC(IR_B, 32);
delay(120);
}
else if (sound1 》 120)
{
irsend.sendNEC(IR_B, 32);
delay(120);
}
else if (sound1 》 80)
{
irsend.sendNEC(IR_B, 32);
delay(120);
}
else if (sound1 》 40)
{
irsend.sendNEC(IR_G, 32);
delay(120);
}
else if (sound1 》 10)
{
irsend.sendNEC(IR_R, 32);
delay(120);}
eile
{
irsend.sendNEC(IR_FADE7, 32);
delay(120);
} Serial.println(sound1);
delay(50);
}
{
irsend.sendNEC(IR_FADE7, 32);
delay(120);
} Serial.println(sound1);
dela