OPEDI: my first experience in creating an IoT device

Good day, Habr. I think a lot of people have thought about what, for example, electricity consumption or the level of carbon dioxide in their home.





The project of the smart calendar "OPEDI" was created precisely in order to instantly and clearly transmit telemetry at home in real time.



In this article I will talk about the functionality of this device and how it was made.



How it works?



"OPEDI" means "Household Energy Display, etc.".



Source of inspiration



Doggy Electronics RESSI



, . , β€” . esp8266 node-mcu.



, . .





, .







475 (=140) + 3 = 143 . 140 3 : , CO2.



, . 1 , .



β€” - node-mcu, PZEM-004T. .







-



node-mcu -, :







:



  • Wi-Fi




. , β€” . , .





-



Wi-Fi



Wi-Fi Β«WiFi SettingsΒ». , . , , Wi-Fi . , .





- Wi-Fi





, . 28 , .







:



-





β€” . Β« Β» . , .



- , . , .



, , . «».





9 . :



  1. QoL changes


, , .





, . , .







. HDC1080, : esp8266 node-mcu. . , , .









, . :



  1. -


.





- , - x y.





, .



:



GetPosition(int x, int y) {
   int n;
   if (x % 2 == 0) {               //  
      n = weekSize - y;            // :
   } else {                        //-  .
      n = y + 1;                   //  -
   }                               //    
                                   // y,   y + 1

                                   //   
   return n + weekSize * x;        //  
}


weekSize 7.

143 .

. .



-, .



-


, esp8266 , , , .



(, ) (x, y).





GPIO. , , " ". . :









HDC-1080

Adafruit.



, CO2 TVOC. getTVOC() geteCO2() .



10 . 6 – .





. :



typedef struct TLogData {
  uint32_t TimeStamp = 0;
  uint32_t Power = 0;
  uint16_t CarbonDioxide = 0;
  uint16_t Temperature = 0;
}


, CO2 ( TVOC), , 6 .



12 , 1 17.1 . , , 2 . . .



" β„–28" .



, – .





3 : , - " ".





esp8266 node-mcu PZEM-004T.





PZEM-004T



. , , . 220, 5.



, , , , .



, ( , ).



esp8266 UART Modbus, ModbusRtu.



220- esp8266. , . , , , . , , -.



-



: -. Wi-Fi , . , ip . Wi-Fi . - Wi-Fi , , , .



.

, " ?". : , «» , Wi-Fi .



Wi-Fi ? ...





Arduino OTA: " "



, , , Arduino OTA, Wi-Fi.



OTA - .





. node-mcu 5, 220, 5 .



, DIN-. , . :





:

1 β€” 5

2 β€” PZEM-004T

3 β€” node-mcu ( PZEM-004T)



node-mcu



, , , . .







. , , . , , 220, .



, , .





, :



  • 1


, :



  • Wi-Fi




,



.







This project has become a unique experience for me. Before, I only touched on the subject of smart home in passing, but while creating OPEDI, I learned a lot.



Such projects help keep the brain in good shape, forcing us to solve completely new problems for us.



The project code is available on my github .



I warn you in advance that there is some spaghetti with crutches.



PS An additional benefit was found, the panel hangs near the exit from the house, and now it is enough to look at the last cube, and if it is green, then all the main household appliances are turned off.




All Articles