Cov txheej txheem:

WiFi Kub Logger (nrog ESP8266): 11 Kauj Ruam (nrog Duab)
WiFi Kub Logger (nrog ESP8266): 11 Kauj Ruam (nrog Duab)

Video: WiFi Kub Logger (nrog ESP8266): 11 Kauj Ruam (nrog Duab)

Video: WiFi Kub Logger (nrog ESP8266): 11 Kauj Ruam (nrog Duab)
Video: ওয়াইফাই(wifi) স্পিড কিভাবে বাড়াবো ও বাড়ানোর উপায় || How to increase wifi speed fast 100% working | 2024, Kaum ib hlis
Anonim
Image
Image
Khoom siv
Khoom siv

Nyob zoo, zoo siab tau ntsib koj ntawm no. Kuv vam tias hauv cov lus qhia no koj yuav pom qee cov ntaub ntawv muaj txiaj ntsig. Zoo siab xa kuv cov lus qhia, lus nug, … Nov yog qee cov ntaub ntawv yooj yim thiab qhia sai ntawm txoj haujlwm. Rau cov neeg siv xov tooj: Video. Kuv qhia rau kuv paub koj xav li cas txog txoj haujlwm hauv nqe lus tawm, ua tsaug. Kuv nyuam qhuav yuav NodeMcu (esp8266 raws) pawg thawj coj tsuas yog muab nws sim yog li qhov no tsis yog qhov haujlwm tiag tiag. Tab sis nws ua haujlwm thiab nws yog qhov kuv xav tau, yog li nws ua tau zoo. Main muaj nuj nqi rau cov ntaub ntawv logger no yog txhawm rau ntsuas kub thiab khaws cia rau hauv server. Qhov no cia cov neeg siv tshuaj xyuas cov ntaub ntawv thiab teeb duab online txawm tias thaum lawv tsis nyob hauv tib qho chaw ntawm tus neeg txiav ntoo (piv txwv li rau lub chaw nres tsheb huab cua). Lwm qhov muaj txiaj ntsig zoo yog OTA hloov tshiab suav nrog hauv cov cai uas cia cov neeg siv hloov kho thiab hloov kho software yooj yim. Kuv yuav tshuaj xyuas ob lub ntsuas hluav taws xob thiab lawv cov txheej txheem nrhiav tau los ua kom sib npaug ntawm txhua qhov zoo thiab qhov tsis zoo.

Spoiler: tom qab kuaj me ntsis kuv pom tias lub ntsuas hluav taws xob zoo li DS18B20 yog qhov kev daws teeb meem zoo tshaj plaws vim tias nws muaj kev ruaj ntseg thiab raug dua. Nws twb tsis muaj dej thiab nrog lub cable.

Kauj ruam 1: Cov ntaub ntawv

Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv
Khoom siv

Nov yog qhov haujlwm me me nrog tsuas yog ob peb yam sab nrauv, rau qhov BOM cov npe yuav luv heev. Txawm li cas los xij, cia saib seb cov ntaub ntawv twg tau thov:

  • NodeMcu V3 (lossis ib qho sib xws ESP8266 -processor);
  • RGB coj (hom anode);
  • Resistors rau coj (1x10Ω, 1x22Ω, 1x100Ω, 1x10kΩ)
  • DS18B20 (Maxim Integrated thermometer);
  • LM35 (Texas Ntsuas Ntsuas Ntsuas Kub);
  • Roj teeb sab nraud (xaiv tau);
  • Cable;
  • Connector (kom nws ntau dua "qib siab");
  • Lub thawv (xaiv tau, rov ua kom nws ntau dua "qib siab");
  • Led tuav (yeem);

Nco tseg: Raws li kuv tau hais koj yuav tsum xaiv ib qho ntawm ob txoj hauv kev. Yog tias koj xaiv tus ntsuas kub LM35, koj yuav xav tau ob peb yam ntxiv:

  • Attiny45/85;
  • AVR programmer (lossis Arduino ua ISP);
  • Resistor (1x1kΩ, 1x2kΩ, 1x10kΩ, 1x18kΩ)
  • 2.54mm sawb txuas (xaiv tau)
  • Diode (2x1N914) Cov.
  • Perfboard lossis PCB;

Kauj ruam 2: Xaiv lub Sensor

Xaiv lub Sensor
Xaiv lub Sensor

Xaiv lub ntsuas tuaj yeem yog cov kauj ruam nyuaj: niaj hnub no muaj ntau qhov hloov pauv (TI muaj 144 yam sib txawv) ob qho tib si analog thiab digital nrog qhov sib txawv ntawm qhov kub thiab txias, qhov tseeb thiab cov ntaub ntawv. Analog Sensors (46 ntu muaj los ntawm TI): Pros:

  • Cov ntaub ntawv logger tuaj yeem hloov pauv tau yooj yim los ntawm qhov kub mus rau lwm qhov (voltage, tam sim no, …);
  • Tej zaum yuav pheej yig dua me ntsis;
  • Yooj yim siv txij li nws tsis xav tau ib lub tsev qiv ntawv tshwj xeeb;

Cons:

  • Yuav tsum tau ADC (uas tuaj yeem cuam tshuam qhov ntsuas qhov tseeb) thiab lwm yam khoom sab nrauv. Txij li esp8266 tsuas muaj ib qho ADC (thiab tsis yog qhov tseeb tiag) Kuv xav qhia kom siv ib qho sab nraud.
  • Xav tau cov kab hluav taws xob tshwj xeeb nrog lub suab tsis lees paub txij li ib qho hluav taws xob inducted tuaj yeem hloov qhov tshwm sim.

Tom qab kev xav me ntsis kuv txiav txim siab siv LM35, cov kab cim ntsuas nrog +10mV/° C ntsuas qhov ntsuas nrog 0.5 ° C qhov tseeb thiab qhov tsawg heev tam sim no (kwv yees li 60uA) nrog kev khiav haujlwm ntawm 4V txog 30V. Yog xav paub ntau ntxiv kuv hais kom pom cov ntawv teev npe: LM35.

Digital Sensors (pom zoo) Pros:

Yuav luag txhua yam khoom siv sab nrauv xav tau;

Kev koom ua ke ADC

Cons:

Thov lub tsev qiv ntawv lossis software txiav txim siab lub teeb liab digital (I2C, SPI, Serial, Ib Tus Hlau, …);

Kim dua;

Kuv tau xaiv DS18B20 vim tias kuv pom muaj 5 lub ntsuas dej tsis sib xws ntawm Amazon thiab vim tias nws tau nthuav dav sau tseg hauv is taws nem. Lub ntsiab tseem ceeb yog 9-12 ntsis ntsuas, 1-Hlau npav, 3.0 txog 5.5 muab hluav taws xob, 0.5 ° C raug. Ib zaug ntxiv, kom paub meej ntxiv ntawm no yog cov ntaub ntawv: DS18B20.

Kauj ruam 3: LM35

LM35
LM35
LM35
LM35
LM35
LM35

Cia peb txheeb xyuas seb kuv tau ua raws li ADC sab nraud thiab lwm yam tshwj xeeb rau LM35 tus pas ntsuas kub. Kuv pom ib txoj hlua nrog peb xaim, ib qho nrog thaiv thiab ob yam tsis muaj. Kuv txiav txim siab ntxiv decoupling capacitor kom ruaj khov muab cov khoom hluav taws xob nyob ze ntawm lub ntsuas hluav taws xob. Ua kom hloov pauv qhov ntsuas kub sib piv rau digital, Kuv tau siv Attiny85 microprocessor hauv pob poob 8 (ntxiv rau cov ntaub ntawv ntau ntxiv saib cov ntawv: attiny85). Qhov tseem ceeb tshaj plaws rau peb yog 10 ntsis ADC (tsis yog qhov zoo tshaj plaws tab sis txaus txaus rau kuv). Txhawm rau sib txuas lus nrog Esp8266 Kuv txiav txim siab siv Serial kev sib tham kom nco ntsoov tias esp8266 ua haujlwm nrog 3.3V thiab attiny85 ntawm 5V (raws li nws xav tau lub zog sensor). Txhawm rau ua tiav qhov ntawd, kuv tau siv qhov faib hluav taws xob yooj yim (saib schematic). Txhawm rau nyeem qhov ntsuas kub tsis zoo peb yuav tsum ntxiv qee cov khoom sab nrauv (2x1N914 thiab 1x18k resistor), txij li kuv tsis xav siv lub zog tsis zoo. attiny rau ide (ntxig qhov no hauv kev xaiv: https://drazzy.com/package_drazzy.com_index.json), yog tias koj tsis paub yuav ua li cas, tsuas yog tshawb hauv Google. Or upload.hex cov ntaub ntawv ncaj qha.

Kauj Ruam 4: DS18B20

DS18B20
DS18B20
DS18B20
DS18B20
DS18B20
DS18B20
DS18B20
DS18B20

Kuv yuav cov ntsuas no los ntawm Amazon (5 tus nqi kwv yees li 10 €). Nws tuaj txog nrog cov hlau tsis huv npog thiab kab 1m ntev. Qhov ntsuas no tuaj yeem rov qab 9 txog 12 ntsis cov ntaub ntawv ntawm qhov kub thiab txias. Ntau tus sensor tuaj yeem ntsaws rau hauv tus pin tib yam vim tias txhua tus ntawm lawv muaj tus lej tshwj xeeb. Txhawm rau ntsaws DS18B20 rau esp8266 koj tuaj yeem ua raws li cov lus qhia (daim duab thib ob). Txij li thaum kuv tau txiav txim siab tias kuv tus logger yuav muaj peb qhov kev soj ntsuam, kuv yuav tsum paub qhov txawv qhov twg yog qhov twg. Yog li kuv xav muab lawv cov xim cuam tshuam los ntawm software rau lawv qhov chaw nyob. Kuv tau siv qee lub raj thermo-shrinkable (daim duab thib peb).

Kauj Ruam 5: ESP8266 Txoj Cai

ESP8266 Txoj Cai
ESP8266 Txoj Cai
ESP8266 Txoj Cai
ESP8266 Txoj Cai

Txij li thaum kuv tshiab rau lub ntiaj teb no, Kuv txiav txim siab siv ntau lub tsev qiv ntawv. Raws li tau hais hauv kev taw qhia cov yam ntxwv tseem ceeb yog:

  • OTA hloov tshiab: koj tsis tas yuav ntsaws esp8266 rau koj lub khoos phis tawj txhua lub sijhawm koj xav tau xa cov cai (koj yuav tsum ua nws tsuas yog thawj zaug);
  • Tus thawj tswj hwm wireless, yog hloov pauv lub network, koj tsis tas yuav rov tsim daim duab dua. Koj tuaj yeem yooj yim teeb tsa dua lub network tsis txuas mus rau esp8266 nkag mus;
  • Thingspeak cov ntaub ntawv xa tawm;
  • Ob leeg LM35 thiab DS18B20 txhawb nqa;
  • Cov Neeg Siv Yooj Yim Yooj Yim (RGB coj qhia qee cov ntaub ntawv muaj txiaj ntsig);

Thov zam txim rau kuv vim kuv cov software tsis zoo tshaj plaws thiab nws tsis tau xaj tiag tiag. Ua ntej xa mus rau lub cuab yeej, koj yuav tsum hloov qee qhov tsis kom haum cov cai rau koj teeb. Ntawm no koj tuaj yeem rub tawm software. Kev LM35 thiab DS18B20 teeb tsa Koj yuav tsum hloov tus lej txhais, token, tus lej xov tooj, tus neeg siv thiab tus lej nkag rau OTA hloov tshiab. Kab ntawm 15 txog 23.

#define liab YourPINHERE #define ntsuab YOURPINHERE

#define blue YOURPINHERE const char* host = "xaiv chaw nyob"; // tsis xav tau tiag tiag koj tuaj yeem tawm esp8266-webupdate const char* update_path = "/firmware"; // txhawm rau hloov chaw nyob rau kev hloov kho ex: 192.168.1.5/firmware const char* update_username = "YOURUSERHERE"; const char * update_password = "YOURPASSWORDHERE; unsigned ntev myChannelNumber = CHANNELNUMBERHERE; const char * myWriteAPIKey =" WRITEAPIHERE ";

Kauj Ruam 6: ESP8266 Code: LM35 Tus Neeg Siv

Koj yuav tsum txuas lub rooj sib tham attiny rau esp8266, txhawm rau ua kom lub zog ADC siv VU tus pin thiab G tus pin. Koj yuav tsum xaiv tus pin twg koj xav siv rau kev sib txuas lus hauv xov tooj (kom khaws cov khoom siv tsis pub dawb rau lub hom phiaj debug). Tx pin yuav tsum raug xaiv tab sis tsis siv tiag. (Kab 27). SoftwareSerial mySerial (RXPIN, TXPIN); Nyob rau sab saum toj koj yuav tsum tau ntxiv: #define LM35USER

Kauj Ruam 7: ESP8266 Code: DS18B20 Tus Neeg Siv

Raws li kev ua haujlwm thawj zaug koj yuav tsum txheeb xyuas lub cuab yeej Chaw Nyob rau txhua lub sensor. Ua ke thiab teeb tsa cov cai no rau esp thiab saib hauv cov lej rau qhov txiaj ntsig. Cov lej tuaj yeem pom ntawm no (tshawb rau lub npe no hauv nplooj ntawv: «Nyeem tus kheej DS18B20 Chaw Nyob Sab Hauv Tsev»). Txuas tsuas yog ib lub ntsuas kom tau txais qhov chaw nyob, cov txiaj ntsig yuav tsum yog qee yam zoo li no (tus lej tsis nyob ntawm no! Tsuas yog ua piv txwv): 0x11, 0x22, 0x33, 0xD9, 0xB1, 0x17, 0x45, 0x12Then koj yuav tsum hloov kuv tus lej hauv ntu " Kev teeb tsa rau DS18B20 "(kab 31 txog 36)":

#define ONE_WIRE_BUS ONEWIREPINHERE #define TEMPERATURE_PRECISION TEMPBITPRECISION // (los ntawm 9 txog 12) #define delayDallas READINTERVAL // (Hauv Milliseconds, yam tsawg kawg yog 15s lossis 15000mS) 0x12; ib. // Hloov nrog Koj Chaw Nyob DeviceAddress redSensor = {0x11, 0x22, 0x33, 0xD9, 0xB1, 0x17, 0x45, 0x12}; // Hloov nrog Koj Chaw Nyob DeviceAddress greenSensor = {0x11, 0x22, 0x33, 0xD9, 0xB1, 0x17, 0x45, 0x12}; // Hloov nrog koj qhov chaw nyob saum koj xav tau ntxiv: #define DSUSER

Kauj Ruam 8: ESP8266 Me ntsis dag

ESP8266 Me ntsis dag
ESP8266 Me ntsis dag

Tom qab kuaj me ntsis kuv pom tias yog tias koj ntsaws esp8266 yam tsis muaj lub program, nws yuav tsis khiav cov cai kom txog thaum koj nias rov pib dua ib zaug. Txhawm rau daws qhov teeb meem no, tom qab tshawb fawb me ntsis, kuv pom tias koj yuav tsum ntxiv qhov rub tawm ntawm 3.3V rau D3. Qhov no yuav qhia tus txheej txheem kom thauj cov lej los ntawm lub cim xeeb flash. Qhov txheej txheem no, D3 tuaj yeem siv ncaj qha rau cov ntaub ntawv nkag mus rau DS18B20 sensors.

Kauj Ruam 9: Thawj Sijhawm Ua Haujlwm

Thawj Sijhawm Ua Haujlwm
Thawj Sijhawm Ua Haujlwm
Thawj Sijhawm Ua Haujlwm
Thawj Sijhawm Ua Haujlwm

Yog tias koj tau xa cov cai kom raug tab sis tsis txhob siv Wifi tus thawj tswj tsev qiv ntawv nws yog lub sijhawm los teeb tsa koj li kev sib txuas wifi. Tos kom txog thaum koj pom RGB coj flashing sai dua ua ntej, tom qab ntawd tshawb nrog koj lub xov tooj lossis PC lub wifi network hu ua "AutoConnectAp" thiab txuas. Tom qab txuas, qhib lub vev xaib thiab nkag mus rau 192.168.4.1, koj yuav pom GUI interface ntawm tus saib xyuas wifi (saib duab) thiab nias "Configure Wifi". Tos rau esp8266 txhawm rau tshawb nrhiav wifi network, thiab xaiv qhov xav tau. Ntxig tus password thiab nias "txuag". Esp8266 yuav rov pib dua (tsis quav ntsej RGB coj lub sijhawm no vim tias nws yuav tso tawm qee cov ntaub ntawv tsis raug) thiab txuas rau lub network.

Kauj ruam 10: Xaus

Xaus
Xaus
Xaus
Xaus
Xaus
Xaus
Xaus
Xaus

Thaum kawg, ntawm no yog daim duab coj los ntawm cov ntaub ntawv logger hauv kev nqis tes thaum txiav kuv lub tub yees txias. Hauv txiv kab ntxwv yog DS18B20 thiab xiav LM35 thiab nws yog Circuit Court. Koj tuaj yeem pom qhov sib txawv loj tshaj plaws ntawm qhov raug los ntawm digital rau analog sensor (nrog kuv cov neeg pluag "ADC Circuit") uas muab qee cov ntaub ntawv tsis yog-lub cev. Qhov sau tseg, yog tias koj xav tsim lub logger no kuv hais qhia siv DS18B20 digital kub sensor txij li nws nyeem tau yooj yim dua thiab yuav luag "ntsaws thiab ua si", nws ruaj khov dua thiab raug, nws ua haujlwm ntawm 3.3V thiab xav tau tsuas yog ib tus pin rau ntau qhov ntsuas. Ua tsaug rau kev saib xyuas, Kuv vam tias qhov haujlwm no zoo rau koj thiab koj pom qee cov ntaub ntawv muaj txiaj ntsig. Thiab rau leej twg xav paub nws, Kuv vam tias kuv tau muab txhua yam ntaub ntawv xav tau. Yog tias tsis poob dawb los nug txhua yam, Kuv yuav zoo siab los teb rau txhua nqe lus nug. Txij li thaum kuv tsis yog tus hais lus Askiv, yog tias muaj qee yam tsis raug lossis tsis nkag siab thov qhia rau kuv paub yog tias koj nyiam qhov haujlwm no, thov pov npav rau qhov kev sib tw thiab/lossis tawm lus tawm ☺. Nws yuav txhawb kuv kom hloov kho tshiab thiab tshaj tawm cov ntsiab lus tshiab. Ua tsaug.

Pom zoo: