Cov txheej txheem:
- Kauj Ruam 1: Cov Khoom Uas Peb Xav Tau
- Kauj Ruam 2: Kev Sib Txuas Kho Vajtse
- Kauj ruam 3: Code
- Tswj txhua yam
- MCP3425 Sensor I2C Mini Module
- Kauj ruam 4: Ua haujlwm
- Kauj Ruam 5: Cov ntawv thov thiab Nta
Video: Siv Analog Sensors Nrog ESP8266: 5 Cov Kauj Ruam
2024 Tus sau: John Day | [email protected]. Kawg hloov kho: 2024-01-30 09:25
Ib qho piv txwv-rau-digital hloov pauv (ADC, A/D, A – D, lossis A-to-D) yog lub kaw lus uas hloov pauv cov teeb liab analog mus rau hauv cov teeb liab. A/D hloov pauv txhais cov cim hluav taws xob analog rau cov ntaub ntawv ua haujlwm. Nrog cov khoom sib piv kev ua tau zoo, lub zog, tus nqi, thiab sizeneed. Cov ntaub ntawv hloov pauv no pab txhawb kev hloov pauv tau meej thiab muaj zog hauv ntau yam kev siv xws li kev sib txuas lus, lub zog, kev noj qab haus huv, kev ntsuas thiab ntsuas, lub cev muaj zog thiab kev tswj hwm lub zog, kev siv tshuab ua haujlwm, thiab kev siv dav hlau/tiv thaiv. Ntau yam khoom siv hloov pauv A/D tau muab los pab tus kws tshaj lij hauv txhua qhov haujlwm theem, los ntawm kev xaiv cov khoom mus rau kev tsim qauv.
Hnub no, peb yuav siv qhov hloov pauv sib piv rau digital nrog ESP8266. Wb pib.. !!
Kauj Ruam 1: Cov Khoom Uas Peb Xav Tau
1. MCP3425 ADC Converter
MCP3425 yog 1-Channel Analog to Digital Converter nrog 16-ntsis kev daws teeb meem, hom phiaj haum rau kev ntsuas qis-siab siab ntsuas kev ntsuas. MCP3425 muaj peev xwm nyeem qhov sib piv ntawm 15 qhov piv txwv thib ob nrog 16-ntsis kev daws teeb meem lossis 240 qhov piv txwv thib ob ntawm 12-ntsis kev daws teeb meem.
2. Adafruit Huzzah ESP8266
ESP8266 yog lub platform zoo kawg rau IoT daim ntawv thov txhim kho. ESP8266 tus txheej txheem los ntawm Espressif yog 80 MHz microcontroller nrog WiFi puv ntoob-kawg thiab TCP/IP pawg nrog DNS txhawb nqa ib yam. ESP8266 muab kev paub tab rau kev tshuaj xyuas thiab tswj kev siv daim ntawv Arduino Wire Language thiab Arduino IDE.
3. ESP8266 USB Programmer
Qhov ESP8266 tus tswv tsev tau tsim tshwj xeeb los ntawm Contol Txhua Yam rau Adafruit Huzzah version ntawm ESP8266, tso cai rau I²C kev sib txuas lus sib txuas.
4. I²C Txuas Cable
Contol Txhua yam kuj tau tsim I²C kev txuas cable uas muaj nyob ntawm qhov txuas saum toj no.
5. Mini USB Cable
Lub mini USB cable Lub hwj chim muab yog qhov kev xaiv zoo tshaj rau kev txhawb nqa Adafruit Huzzah ESP8266.
Kauj Ruam 2: Kev Sib Txuas Kho Vajtse
Feem ntau, kev sib txuas yog ib feem yooj yim ntawm txoj haujlwm no. Ua raws cov lus qhia thiab cov duab, thiab koj yuav tsum tsis muaj teeb meem.
Ua ntej tshaj plaws, coj Adafruit Huzzah ESP8266 thiab muab tso rau ntawm USB Programmer (nrog Sab Hauv Lub ntsej muag I²C Port). Nias ESP8266 maj mam muab tso rau hauv USB Programmer thiab peb tau ua tiav nrog cov kauj ruam no (Saib daim duab #1).
Coj tus I²C Cable thiab txuas nws mus rau qhov chaw nres nkoj nkag ntawm Sensor. Kom ua haujlwm tau zoo ntawm cov kab no, thov nco ntsoov I²C Cov Tawm Ib Leeg txuas rau I²C Cov Tswv Yim. Tam sim no, txuas lwm qhov kawg ntawm tib I²C Cable rau USB Programmer nrog Adafruit Huzzah ESP8266 tau teeb tsa nws (Saib daim duab #2).
Nco tseg: Cov xaim xim av yuav tsum ib txwm ua raws hauv av (GND) kev sib txuas ntawm cov khoom siv ntawm ib lub cuab yeej thiab cov tswv yim ntawm lwm lub cuab yeej.
Txuas lub Mini USB cable rau hauv lub zog txuas ntawm Adafruit Huzzah ESP8266. Qhov kev sib txuas zaum kawg yuav zoo li hauv daim duab #3.
Kauj ruam 3: Code
ESP Code rau Adafruit Huzzah ESP8266 thiab MCP3425 ADC Converter muaj nyob ntawm peb GitHub chaw cia khoom.
Ua ntej mus rau txoj cai, nco ntsoov koj tau nyeem cov lus qhia muab rau hauv Readme cov ntaub ntawv thiab teeb tsa koj li Adafruit Huzzah ESP8266 kom haum. Nws yuav siv sijhawm tsuas yog 5 feeb los teeb tsa ESP.
Txhawm rau kom yooj yim rau koj, koj tuaj yeem luam qhov ESP code ua haujlwm rau lub ntsuas no los ntawm no kuj:
// Tshaj tawm nrog daim ntawv tso cai pub dawb.// Siv nws txhua txoj hauv kev koj xav tau, muaj txiaj ntsig lossis pub dawb, muab nws haum rau hauv daim ntawv tso cai ntawm nws cov haujlwm ua haujlwm. // MCP3425 // Cov cai no tau tsim los ua haujlwm nrog MCP3425_I2CADC I2C Mini Module muaj los ntawm ControlEverything.com. //
#suav nrog
#include #include #include
// MCP3425 I2C chaw nyob yog 0x68 (104)
#define Ntxiv 0x68
const char* ssid = "koj lub network ssid";
const char* password = "koj tus password"; ntab siab, cTemp, fTemp;
ESP8266WebServer server (80);
tsis muaj dab tsi handleroot ()
{unsigned int cov ntaub ntawv [2];
// Pib I2C Kev Kis
Wire.beginTransmission (Addr); // Xa cov lus txib teeb tsa // Kev hloov pauv mus tas li, 12-ntsis daws teeb meem Wire.write (0x10); // Nres I2C Kev Xa Xov Hlau.endTransmission (); ncua (300);
// Pib I2C Kev Kis
Wire.beginTransmission (Addr); // Xaiv cov ntaub ntawv sau npe Wire.write (0x00); // Nres I2C Kis Kab Hlau.endTransmission ();
// Thov 2 bytes ntawm cov ntaub ntawv
Wire.requestFrom (Addr, 2);
// Nyeem 2 bytes ntawm cov ntaub ntawv
// raw_adc msb, raw_adc lsb yog (Wire.available () == 2) {data [0] = Wire.read (); cov ntaub ntawv [1] = Wire.read (); }
// Hloov cov ntaub ntawv mus rau 12-ntsis
int raw_adc = (cov ntaub ntawv [0] & 0x0F) * 256 + cov ntaub ntawv [1]; yog (raw_adc> 2047) {raw_adc -= 4096; }
// Cov ntaub ntawv tso tawm rau tus saib xyuas
Serial.print ("Tus nqi Digital ntawm Analog Input:"); Serial.println (raw_adc); ncua (500);
// Tso cov ntaub ntawv rau lub web server
server.sendContent ("<meta http-equiv = 'refresh' cov ntsiab lus = '3'""
Tswj txhua yam
www.controleverything.com
MCP3425 Sensor I2C Mini Module
"); server.sendContent ("
Tus nqi digital ntawm cov tswv yim Analog: " + Txoj hlua (raw_adc));}
void teeb tsa ()
{// Initialise I2C kev sib txuas lus li MASTER Wire.begin (2, 14); // Initialise serial communication, set baud rate = 115200 Serial.begin (115200);
// Txuas rau WiFi network
WiFi.begin (ssid, password);
// Tos rau kev txuas
thaum (WiFi.status ()! = WL_CONNECTED) {ncua (500); Serial.print ("."); } Serial.println (""); Serial.print ("Txuas nrog"); Serial.println (ssid);
// Tau txais IP chaw nyob ntawm ESP8266
Serial.print ("IP chaw nyob:"); Serial.println (WiFi.localIP ());
// Pib server
server.on ("/", tus tuav tes); server.begin (); Serial.println ("HTTP server tau pib"); }
void lub voj ()
{server.handleClient (); }
Kauj ruam 4: Ua haujlwm
Rub tawm (gitpull) lossis luam cov cai thiab qhib nws hauv Arduino IDE.
Ua ke thiab Tshaj tawm cov cai thiab pom cov txiaj ntsig ntawm koj li Serial Monitor.
Nco tseg: Ua ntej rub tawm, xyuas kom tseeb tias koj nkag mus rau koj li SSID network thiab tus password hauv tus lej.
Luam tus IP chaw nyob ntawm ESP8266 los ntawm Serial Monitor thiab muab tso rau hauv koj lub vev xaib. Koj yuav pom lub vev xaib nrog cov digital tso tawm ntawm analog nyeem ntawv nyeem. Cov txiaj ntsig ntawm lub ntsuas ntawm Serial Monitor thiab Web Server tau qhia hauv daim duab saum toj no.
Kauj Ruam 5: Cov ntawv thov thiab Nta
Cov cuab yeej MCP3425 tuaj yeem siv rau ntau yam kev ntsuas siab sib piv-rau-digital cov ntaub ntawv hloov pauv qhov twg tsim qhov yooj yim, lub zog qis, thiab hneev taw me me yog qhov kev txiav txim siab loj. Cov ntawv thov tseem ceeb suav nrog Kev Ntsuas Hluav Taws Xob, ntsuas qhov ntsuas thiab ntsuas ntsuas roj, ntsuas kub nrog RTD, Thermistor, thiab Thermocouple, Choj Pom Zoo rau Siab, Nyuaj, thiab Quab Yuam.
ADC cov hloov pauv ua kom muaj kev hloov pauv tau raug thiab ntseeg tau hauv ntau qhov kev thov xws li kev sib txuas lus, lub zog, kev noj qab haus huv, kev ntsuas thiab ntsuas, lub cev muaj zog thiab kev tswj hwm lub zog, kev siv tshuab ua haujlwm, thiab kev siv dav hlau/tiv thaiv.
Nrog kev pab los ntawm ESP8266, peb tuaj yeem nce nws lub peev xwm kom ntev dua. Peb tuaj yeem tswj hwm peb cov cuab yeej siv thiab saib xyuas lawv cov kev ua tau zoo los ntawm peb lub desktop thiab cov khoom siv mobile. Peb tuaj yeem khaws thiab tswj cov ntaub ntawv online thiab kawm lawv txhua lub sijhawm rau kev hloov kho. Ntau daim ntawv thov suav nrog Tsev Automation, Mesh Network, Muaj Wireless Tswj, Tus Saib Xyuas Me Nyuam, Sensor Networks, Wearable Electronics, Wi-Fi Qhov Chaw-paub Devices, Wi-Fi Position System Beacons.
Tsis tas li, koj tuaj yeem tshawb xyuas peb qhov blog ntawm Tsev Automation nrog Lub Teeb Sensor thiab ESP8266.
Pom zoo:
Txawb Xov Tooj Siv Yooj Yim Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: 14 Cov Kauj Ruam (nrog Duab)
Kev Siv Xov Tooj Ntawm Lub Xov Tooj Siv STM32F407 Cov Khoom Siv Tshawb Pom thiab GSM A6 Module: Koj puas tau xav tsim qhov kev ua kom txias txias? Yog tias yog, ua li cas txog kev tsim ib qho ntawm cov neeg nyiam tshaj plaws thiab txhua tus nyiam cov khoom siv xws li Lub Xov Tooj Txawb !!!. Hauv Cov Lus Qhia no, Kuv yuav qhia koj yuav tsim lub xov tooj txawb yooj yim siv STM li cas
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Cov Khoom Siv: 3 Cov Kauj Ruam (nrog Duab)
Kev teeb tsa Matrix LED hauv Cov Khoom Siv Hluav Taws Xob qub - Yuav Tsum Tau Siv Cov Khoom Siv: Lub teeb pom kev zoo los ntawm lub Windows PC dhau Bluetooth thiab LED cov txheej txheem nthuav tawm Ib co piv txwv ntawm pixel kos duab thiab cov duab ua haujlwm khiav ntawm LED Cov Ntsiab Lus ntawm PIXEL Guts Kit Hauv Cov Lus Qhia no, peb ' yuav
FoldTronics: Tsim 3D Lub Hom Phiaj Nrog Cov Khoom Siv Hluav Taws Xob Siv Foldable HoneyComb Cov Qauv: 11 Cov Kauj Ruam
FoldTronics: Tsim 3D Lub Hom Phiaj Nrog Cov Khoom Siv Hluav Taws Xob Siv Foldable HoneyComb Cov Qauv: Hauv qhov kev qhia no, peb nthuav tawm FoldTronics, 2D-txiav raws li txheej txheem kev tsim khoom los ua ke cov khoom siv hluav taws xob rau hauv cov khoom 3D. Lub tswv yim tseem ceeb yog txhawm rau txiav thiab nthuav tawm daim ntawv 2D siv lub tshuab txiav txiav los ua kom nws tig tau mus rau hauv 3D honeycomb struc
Cov cuab yeej cuab tam - Ceramic hauv Cov Ntsiab Lus ntawm Cov Txheej Txheem Digital thiab Analog 2015: 3 Cov Kauj Ruam (nrog Duab)
Cov cuab yeej cuab tam - Ceramic hauv Cov Ntsiab Lus ntawm Digital thiab Analog Cov Txheej Txheem 2015: Txog tam sim no, cov khoom siv hlau yog cov khoom siv tes ua uas tsis muaj kev cuam tshuam digital. Vim li no, nws zoo siab heev los ua phooj ywg nrog cov cuab yeej tshiab. Lub hauv paus pib yog daim ntawv qub thiab CNC Styrocutter.DESIGNBOOM
Tswj Cov Khoom Siv Los Ntawm Arduino Nrog Cov Neeg Siv Khoom Hloov: 8 Cov Kauj Ruam (nrog Duab)
Kev Tswj Cov Khoom Siv Los Ntawm Arduino Nrog Kev Siv Hluav Taws Xob: Lub Arduino tuaj yeem siv los tswj cov cuab yeej los ntawm kev siv cov khoom siv yooj yim hloov pauv hloov chaw