Cov txheej txheem:

ARDUINO ENERGY METER: 10 Kauj Ruam (nrog Duab)
ARDUINO ENERGY METER: 10 Kauj Ruam (nrog Duab)

Video: ARDUINO ENERGY METER: 10 Kauj Ruam (nrog Duab)

Video: ARDUINO ENERGY METER: 10 Kauj Ruam (nrog Duab)
Video: NOOBS PLAY CLASH ROYALE FROM START LIVE 2024, Hlis ntuj nqeg
Anonim
Image
Image
ARDUINO ENERGY METER
ARDUINO ENERGY METER
ARDUINO ENERGY METER
ARDUINO ENERGY METER

[Ua Si Video]

Kuv koom nrog ib lub zos ntawm Odisha, Is Nrias teb qhov kev txiav hluav taws xob nquag heev. Nws cuam tshuam lub neej ntawm txhua tus. Thaum lub sijhawm kuv tseem yog menyuam yaus kawm txuas ntxiv tom qab tsaus ntuj yog qhov nyuaj. Vim qhov teeb meem no kuv tsim lub hnub ci rau kuv lub tsev nyob ntawm qhov kev sim ua. Kuv siv lub hnub ci vaj huam sib luag ntawm 10 Watt, 6V rau teeb pom kev ob peb LEDs ci. Tom qab ntsib ntau qhov kev nyuaj qhov project tau ua tiav. Tom qab ntawd kuv txiav txim siab los tshuaj xyuas qhov hluav taws xob, tam sim no, lub zog & lub zog koom nrog hauv kab ke. Qhov no coj lub tswv yim ntawm kev tsim ENERGY METER. Kuv siv ARDUINO ua lub hauv paus ntawm txoj haujlwm no vim nws yooj yim heev los sau cov lej hauv nws IDE thiab muaj cov lej loj ntawm qhib lub tsev qiv ntawv muaj nyob hauv internet uas tuaj yeem siv tau raws li yuav tsum tau ua. Kuv tau sim ua qhov haujlwm rau qhov ntsuas me me (10Watt) hnub ci tab sis qhov no tuaj yeem hloov kho tau yooj yim siv rau qhov ntsuas qhov ntsuas siab dua.

Koj tuaj yeem pom tag nrho kuv cov phiaj xwm ntawm:

Nta: Kev saib xyuas lub zog los ntawm 1. LCD zaub 2. ntawm internet (Xively upload) 3. Cov ntaub ntawv nkag rau hauv daim npav SD

Koj tuaj yeem pom kuv cov lus qhia tshiab ARDUINO MPPT SOLAR CHARGE CONTROLLER (Version-3.0)

Koj tseem tuaj yeem pom kuv lwm cov lus qhia ntawm

ARDUINO SOLAR CHARGE CONTROLLER (Version 2.0)

ARDUINO SOLAR CHARGE CONTROLLER (Version-1)

Kauj Ruam 1: Qhov Yuav Tsum Tau:

Qhov Yuav Tsum Tau
Qhov Yuav Tsum Tau

1. ARDUINO UNO (Amazon) 2. ARDUINO ETHERNET SHIELD (Amazon)

3.16x2 CHARACTER LCD (Amazon)

4. ACS 712 CURRENT SENSOR (Amazon) 4. RESISTORS (10k, 330ohm) (Amazon) 5. 10K POTENTIOMETER (Amazon) 6. JUMPER WIRES (Amazon) 7. ETHERNET CABLE (Amazon) 8. BREAD BOARD (Amazon)

Kauj Ruam 2: Lub Hwj Chim thiab Lub Zog

Lub zog: Lub zog yog cov khoom siv hluav taws xob (volt) thiab tam sim no (Amp) P = VxI Chav ntawm lub zog yog Watt lossis KWEnergy: Lub zog yog cov khoom lag luam ntawm lub zog (watt) thiab lub sijhawm (Teev) E = Pxt Chav Nyob ntawm Lub Zog yog Watt Teev lossis Kilowatt Teev (kWh) Los ntawm cov qauv saum toj no nws pom tseeb tias txhawm rau ntsuas Zog peb xav tau peb qhov ntsuas 1. Voltage 2. Tam sim no 3. Sijhawm

Kauj Ruam 3: Kev Ntsuas Hluav Taws Xob

Kev ntsuas hluav taws xob
Kev ntsuas hluav taws xob
Kev ntsuas hluav taws xob
Kev ntsuas hluav taws xob
Kev ntsuas hluav taws xob
Kev ntsuas hluav taws xob

Qhov ntsuas hluav taws xob tau ntsuas los ntawm kev pab ntawm qhov hluav taws xob faib hluav taws xob. Vim li ARDUINO analog pin input voltage raug txwv rau 5V Kuv tsim qhov faib hluav taws xob nyob rau hauv xws li ib txoj hauv kev uas qhov hluav taws xob tso tawm los ntawm nws yuav tsum tsawg dua 5V. Kuv lub roj teeb siv rau khaws cia lub zog los ntawm lub hnub ci vaj huam sib luag tau ntsuas 6v, 5.5Ah, yog li kuv yuav tsum nqis qis 6.5v rau qhov hluav taws xob qis dua 5V. Kuv siv R1 = 10k thiab R2 = 10K. Tus nqi R1 thiab R2 tuaj yeem qis dua ib qho tab sis qhov teeb meem yog tias thaum kev tiv thaiv qis dua tam sim no ntws los ntawm nws vim yog qhov ua rau muaj hwj chim loj (P = I^2R) tso tawm hauv cov cua sov. Yog li tus nqi sib txawv tuaj yeem xaiv tau tab sis kev saib xyuas yuav tsum tau ua kom txo qis lub zog poob hla qhov tsis kam. Vout = R2/(R1+R2)*Vbat Vbat = 6.5 thaum them tas R1 = 10k thiab R2 = 10k Vout = 10/(10+10)*6.5 = 3.25v uas qis dua 5v thiab haum rau ARDUINO analog pinNOTE Kuv tau qhia 9 Volt roj teeb hauv lub rooj sib tham tsis sib xws tsuas yog piv txwv los txuas xov tooj, tab sis lub roj teeb tiag kuv tau siv yog 6 Volt, 5.5Ah ua kua qaub roj teeb. Voltage Calibration: Thaum lub roj teeb tau them tag nrho (6.5v) peb yuav tau txais Vout = 3.25v thiab tus nqi qis dua rau lwm cov roj teeb qis. AEDUINO ADC hloov pauv Analog teeb liab mus rau qhov kwv yees kwv yees digital. Thaum lub roj teeb hluav taws xob yog 6.5v Kuv tau txais 3.25v los ntawm qhov faib hluav taws xob thiab piv txwv 1 = 696 hauv qhov ntsuas, qhov piv txwv 1 yog ADC tus nqi sib xws rau 3.25v Rau kev nkag siab zoo dua Kuv tau txuas lub sijhawm simulation los ntawm 123D.circuit rau ntsuas ntsuas ntsuas: 3.25v sib npaug rau 696 1 yog sib npaug rau 3.25/696 = 4.669mv Vout = (4.669*sample1)/1000 volt Lub roj teeb tiag tiag = (2*Vout) voltARDUINO CODE: // ntsuas 150 qhov ntsuas los ntawm kev faib hluav taws xob nrog rau ntu ntawm 2sec thiab tom qab ntawd nruab nrab qhov piv txwv cov ntaub ntawv khaws tseg rau (int i = 0; i <150; i ++) {sample1 = sample1+analogRead (A2); // nyeem qhov hluav taws xob los ntawm kev faib hluav taws xob ncua qeeb (2); } qauv 1 = qauv1/150; qhov hluav taws xob = 4.669*2*qauv 1/100;

Kauj Ruam 4: Kev Ntsuas Tam Sim No

Kev Ntsuas Tam Sim No
Kev Ntsuas Tam Sim No
Kev Ntsuas Tam Sim No
Kev Ntsuas Tam Sim No

Txog qhov ntsuas tam sim no kuv tau siv Hall Effect tam sim no ntsuas ACS 712 (20 A). Txhua yam tam sim no sib txawv ACS712 sensor muaj nyob hauv khw, yog li xaiv raws li qhov koj xav tau. Nyob hauv daim duab qhia zaub mov kuv tau qhia LED ua lub nra tab sis qhov thauj khoom tiag tiag txawv. ib qho chaw sib nqus sib npaug rau qhov tam sim no. Txhawm rau paub ntau ntxiv txog Hall Effect sensor nyem qhov no Cov ntaub ntawv ntawm ACS 712 sensor tau pom ntawm no Los Ntawm Cov Ntaub Ntawv 1. ACS 712 ntsuas qhov zoo thiab tsis zoo 20Amps, sib thooj rau cov zis analog 100mV/A 2. Tsis muaj kev sim tam sim no los ntawm qhov hluav taws xob tso tawm yog VCC/2 = 5v/2 = 2.5VCalibration: Analog nyeem ua tus nqi 0-1023, sib npaug rau 0v txog 5v Yog li Analog nyeem 1 = (5/1024) V = 4.89mv Tus nqi = (4.89*Analog Nyeem tus nqi)/ 1000 V Tab sis raws li cov ntaub ntawv teev tseg offset yog 2.5V (Thaum tam sim no xoom koj yuav tau txais 2.5V los ntawm lub ntsuas pa tso tawm) Tus nqi tiag = (tus nqi-2.5) V Tam sim no hauv amp = tus nqi tiag tiag*10ARDUINO CODE: // coj 150 kuaj los ntawm sensors nrog lub sijhawm sib nrug ntawm 2sec thiab tom qab ntawd nruab nrab cov piv txwv cov ntaub ntawv sau rau (int i = 0; i <150; i ++) {sample2+= analogRead (A3); // nyeem tam sim no los ntawm kev ncua sensor (2); } qauv 2 = qauv 2/150; val = (5.0*qauv 2)/1024.0; qhov tseeb = val-2.5; // offset voltage yog 2.5v amps = qhov tseeb*10;

Kauj Ruam 5: Kev Ntsuas Sijhawm

Txog lub sijhawm ntsuas tsis tas yuav muaj cov cuab yeej sab nraud, vim ARDUINO nws tus kheej muaj lub sijhawm ua haujlwm. Lub millis () muaj nuj nqi rov qab tsis muaj milliseconds txij li Arduino pawg thawj coj pib ua haujlwm tam sim no. ARDUINO CODE: ntev milisec = millis (); // suav lub sijhawm hauv milliseconds lub sijhawm ntev = milisec/1000; // hloov milliseconds rau vib nas this

Kauj Ruam 6: Yuav ua li cas ARDUINO Xeem Lub Hwj Chim thiab Lub Zog

totamps = totamps+amps; // xam tag nrho amps avgamps = totamps/sijhawm; // nruab nrab amps amphr = (avgamps*sijhawm)/3600; // amp-teev watt = voltage*amps; // lub zog = qhov hluav taws xob*lub zog tam sim no = (watt*sijhawm)/3600; Watt-sec tau hloov dua tshiab rau Watt-Hr los ntawm kev faib 1hr (3600sec) // lub zog = (watt*sijhawm)/(1000*3600); rau kev nyeem hauv kWh

Kauj Ruam 7: Kev Pom Qhov Muag

Kev Pom Qhov Muag
Kev Pom Qhov Muag

Txhua qhov txiaj ntsig tuaj yeem pom hauv qhov saib ua ntej lossis los ntawm kev siv LCD. Kuv siv 16x2 tus cim LCD los tso saib txhua qhov txiaj ntsig tau txais hauv cov kauj ruam dhau los. Kev kawm paub saib cov qhob cij hauv daim phiaj qhia saum toj no. Txuas LCD nrog ARDUINO raws li tau hais hauv qab no: LCD -> Arduino 1. VSS -> Arduino GND 2. VDD - > Arduino + 5v 3. VO -> Arduino GND pin + Resistor lossis Potentiometer 4. RS -> Arduino pin 8 5. RW -> Arduino pin 7 6. E -> Arduino pin 6 7. D0 -> Arduino -Tsis Txuas 8 D1 -> Arduino -Tsis Txuas 9. D2 -> Arduino -Tsis Txuas 10. D3 -> Arduino -Tsis Txuas 11. D4 -> Arduino pin 5 12. D5 -> Arduino pin 4 13. D6 -> Arduino pin 3 14. D7 -> Arduino pin 2 15. A -> Arduino Pin 13 + Resistor (Backlight power) 16. K -> Arduino GND (Backlight ground) ARDUINO CODE: Rau Serial Monitor:

Serial.print ("VOLTAGE:"); Serial.print (qhov hluav taws xob); Serial.println ("Volt"); Serial.print ("tam sim no:"); Serial.print (amps); Serial.println ("Amps"); Serial.print ("POWER:"); Serial.print (watt); Serial.println ("Watt"); Serial.print ("ENERGY CONSUMED:"); Serial.print (lub zog); Serial.println ("Watt-Teev"); Serial.println (""); // luam tawm cov txheej txheem tom ntej tom qab kab tsis pub ncua (2000); Rau LCD: Rau LCD zaub koj yuav tsum xub ntsaws lub tsev qiv ntawv "LiquidCrystal" hauv qhov chaws. Kom paub ntau ntxiv txog LequidCrystal lub tsev qiv ntawv nyem qhov no Rau LCD qhia nyem qhov no Cov lej hauv qab no yog hom ntawv los tso tawm hauv LCD txhua qhov kev suav rau lub zog thiab lub zog #suav nrog lcd (8, 7, 6, 5, 4, 3, 2); int backLight = 9; teeb tsa tsis muaj dab tsi () {pinMode (backLight, OUTPUT); // teeb tus pin 9 raws li tso tawm analogWrite (backLight, 150); // tswj lub teeb pom kev zoo 0-254 lcd.begin (16, 2); // kab, kab. loj ntawm cov zaub lcd.clear (); // tshem qhov screen} void loop () {lcd.setCursor (16, 1); // teeb tus cursor sab nraum cov zaub suav lcd.print (""); // luam tus cim tas ncua (600); ////////////////////////////////////////// luam tawm lub zog thiab lub zog rau lub LCD/ /////////////////////////////////////////////// lcd.setCursor (1, 0); // teeb tus cursor ntawm 1st col thiab 1st row lcd.print (watt); lcd.print ("W"); lcd.print (qhov hluav taws xob); lcd.print ("V"); lcd.setCursor (1, 1); // teeb tus cursor ntawm 1st col thiab 2nd kab lcd.print (lub zog); lcd.print ("WH"); lcd.print (amps); lcd.print ("A"); }

Kauj Ruam 8: Cov ntaub ntawv xa mus rau Xively.com

Cov ntaub ntawv xa mus rau Xively.com
Cov ntaub ntawv xa mus rau Xively.com
Cov ntaub ntawv xa mus rau Xively.com
Cov ntaub ntawv xa mus rau Xively.com
Cov ntaub ntawv xa mus rau Xively.com
Cov ntaub ntawv xa mus rau Xively.com

Xa mus rau cov duab saum toj no kom zoo dua nyob rau tom qab. Rau cov ntaub ntawv xa mus rau xively.com lub tsev qiv ntawv hauv qab no kom rub tawm thawj zaug HttpClient: nyem ntawm no Xively: nyem ntawm no SPI: Ntshuam los ntawm arduino IDE (kos duab -> Ntshuam tsev qiv ntawv…..) Ethernet: Ntshuam los ntawm arduino IDE ((kos duab -> Ntshuam tsev qiv ntawv…..) Qhib tus as khauj nrog https://xively.com (yav tas los pachube.com thiab cosm.com) Sau npe rau tus account tsim dawb ntawm

Xaiv lub npe siv, tus password, teeb tsa koj qhov chaw nyob thiab thaj chaw sijhawm thiab lwm yam Koj yuav tau txais email lees paub;

tom qab ntawd nyem qhov txuas ua kom qhib koj tus account. Tom qab ua tiav qhib tus as khauj koj yuav hloov mus rau Kev Tsim Kho Nplooj Ntawv

  • Nyem rau ntawm +Ntxiv Device box
  • Muab lub npe rau koj lub cuab yeej thiab cov lus piav qhia (piv txwv li saib xyuas)
  • Xaiv cov ntaub ntawv ntiag tug lossis pej xeem (Kuv xaiv ntiag tug) ·
  • Nyem rau Ntxiv Device

Tom qab ntxiv cov cuab yeej koj tau hloov mus rau nplooj ntawv tshiab uas muaj ntau cov ntaub ntawv tseem ceeb nyob ntawd

  • Khoom ID, Khoom Muag Tsis Pub Leej Twg Paub, Tus lej Naj Npawb, Tus lej Ua Haujlwm ·
  • Pub ID, FeedURL, API Kawg Nkaus (Pub ID siv hauv ARDUINO code)
  • Ntxiv Channels (IChoose ENERGY thiab POWER, tab sis koj tuaj yeem xaiv raws li koj xaiv) Muab chav thiab cim rau qhov ntsuas ·
  • Ntxiv koj qhov chaw nyob ·
  • Cov yuam sij API (siv hauv ARDUINO code, zam kev sib qhia tus lej no) ·
  • Ua rau (ping aweb nplooj ntawv thaum muaj xwm txheej tshwm sim, zoo li thaum lub zog siv ntau tshaj qhov txwv)

Kauj Ruam 9: Xively thiab ARDUINO Code

Ntawm no kuv txuas tus lej ua tiav (beta version) rau lub ntsuas hluav taws xob tsis suav nrog SD daim npav cov ntaub ntawv txiav uas tau muab cais cais hauv cov kauj ruam tom ntej. / ** Lub zog saib xyuas cov ntaub ntawv upload rau xively **/ #include #include #include #include #define API_KEY "xxxxxxxx" // Nkag mus rau koj Xively API yuam sij #define FEED_ID xxxxxxxxx // Sau koj Xively pub ID // MAC chaw nyob rau koj Ethernet shield byte mac = {0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; // Analog tus pin uas peb tab tom saib xyuas (0 thiab 1 tau siv los ntawm Ethernet shield) int sensorPin = 2; unsigned ntev lastConnectionTime = 0; // zaum kawg peb txuas nrog Cosm const unsigned ntev connectionInterval = 15000; // ncua ntawm kev txuas mus rau Cosm hauv milliseconds // Pib pib Cosm tsev qiv ntawv // Txhais txoj hlua rau peb datastream ID char char sensorId = "POWER"; char sensorId2 = "ENERGY"; XivelyDatastream datastreams = {XivelyDatastream (sensorId, strlen (sensorId), DATASTREAM_FLOAT), XivelyDatastream (sensorId2, strlen (sensorId2), DATASTREAM_FLOAT), DATASTREAM_FLOAT),}; // Qhwv lub datastream rau hauv kev pub XivelyFeed pub (FEED_ID, datastreams, 2/ * tus naj npawb ntawm datastreams */); EthernetClient tus thov kev pab; XivelyClient xivelyclient (tus neeg siv khoom); teeb tsa tsis muaj dab tsi () {Serial.begin (9600); Serial.println ("Initializing network"); thaum (Ethernet.begin (mac)! = 1) {Serial.println ("Yuam kev tau txais IP chaw nyob ntawm DHCP, sim dua …"); ncua (15000); } Serial.println ("Network pib ua ntej"); Serial.println (); } void loop () {yog (millis () - lastConnectionTime> connectionInterval) {sendData (); // xa cov ntaub ntawv rau xively getData (); // nyeem datastream rov qab los ntawm xively lastConnectionTime = millis (); // hloov kho lub sijhawm sib txuas yog li peb tos ua ntej txuas ntxiv}} tsis muaj dab tsi sendData () {int sensor1 = watt; int sensor2 = zog; datastreams [0].setFloat (sensor1); // hwj chim tus nqi datastreams [1].setFloat (sensor2); // lub zog muaj nuj nqis Serial.print ("Nyeem lub zog"); Serial.println (datastreams [0].getFloat ()); Serial.print ("Nyeem zog"); Serial.println (datastreams [1].getFloat ()); Serial.println ("Uploading to Xively"); int ret = xivelyclient.put (pub, API_KEY); Serial.print ("PUT rov qab chaws:"); Serial.println (rov qab); Serial.println (); } // tau txais tus nqi ntawm datastream los ntawm xively, luam tawm tus nqi peb tau txais tsis muaj dab tsi getData () {Serial.println ("Nyeem cov ntaub ntawv los ntawm Xively"); int ret = xivelyclient.get (pub, API_KEY); Serial.print ("Tau txais cov lej rov qab:"); Serial.println (rov qab); yog (ret> 0) {Serial.print ("Datastream yog:"); Serial.println (pub [0]); Serial.print ("Tus nqi zog yog:"); Serial.println (pub [0].getFloat ()); Serial.print ("Datastream yog:"); Serial.println (pub [1]); Serial.print ("Tus nqi zog yog:"); Serial.println (pub [1].getFloat ()); } Serial.println ();

Kauj Ruam 10: Txheeb Cov Ntaub Ntawv hauv SD Card

Rau cov ntaub ntawv khaws cia hauv SD daim npav koj yuav tsum tau ntshuam SD tsev qiv ntawv Rau kev qhia nyem rau ntawm no Kom paub ntau ntxiv txog SD lub tsev qiv ntawv nyem ntawm no Cov cai rau khaws cov ntaub ntawv hauv SD daim npav tau sau cais vim kuv tsis muaj lub cim xeeb txaus hauv kuv ARDUINO UNO tom qab sau cov lej rau LCD zaub thiab xa cov ntaub ntawv xively.com. Tab sis kuv tab tom sim txhim kho beta version code kom ib tus lej tuaj yeem muaj tag nrho cov yam ntxwv (LCD zaub, Xively xa cov ntaub ntawv thiab khaws cov ntaub ntawv hauv SD daim npav). Qhov chaws rau cov ntaub ntawv logging yog txuas hauv qab yog tias ib tus sau zoo dua tus lej los ntawm kev hloov kho kuv tus lej thov qhia rau kuv qhov no yog kuv thawj qhov kev qhia paub, Yog tias leej twg pom muaj qhov ua yuam kev hauv nws, xav tias yuav tawm tswv yim.. yog li kuv tuaj yeem txhim kho kuv tus kheej. Yog tias koj pom thaj chaw ntawm kev txhim kho hauv txoj haujlwm no thov tawm tswv yim lossis xa xov rau kuv, Yog li txoj haujlwm yuav muaj zog dua Kuv xav tias nws yuav muaj txiaj ntsig zoo rau lwm tus thiab rau kuv.

123D Kev Sib Tw Hluav Taws Xob
123D Kev Sib Tw Hluav Taws Xob
123D Kev Sib Tw Hluav Taws Xob
123D Kev Sib Tw Hluav Taws Xob

Qhov khoom plig thib peb hauv kev sib tw sib tw 123D

Pom zoo: