Smart Power Strip Blynk + Arduino Pro Mini + ESP-01

Hello,

Here is my “Prototype Smart Power Plug”

Used Hardware:

  1. ESP8266 - ESP-01 module @ $ 2.4<img
  2. Prototype Board @ $ 0.6
  3. AC-DC Power converter 5V & 3.3V output @ $ 4.46
  4. Arduino Pro Mini 5V logic @ $ 1.72
  5. 1 Channel 5V/12V low trigger relay Module @ $0.75
  6. FT232RL USB To Serial @ $ 2.7 (will not include in the Plug )
  7. And old Power strip with some room inside
  8. DHT-11 Temperature and Humidity sensor.
  9. Some wires and Jumpers Pins
  10. Soldering Iron

Software Used:

  1. Arduino IDE V 1.6.5 .
  2. Blynk App for Android.
  3. ESP8266 Flasher.
  4. ESP8266 SDk V 1.0 AT command V0.22
  5. DHT library
  6. Blynk V3.0 library

Update 1

Here is the Code Link http://pastebin.com/iwTq7LSa

schematic

Sorry for the very bad wiring and Soldering i have only hard wires used from an old Ethernet cable :confounded:


1 Like

Great!
Wiring looks crazy - like it! :slight_smile: Thanks for sharing and excited to see the rest of the project. :electric_plug:

Do you use a relay?

i know even me now to know which pin is connected to which Arduino pin i have to use continuity test with multi meter. :scream:

yes i,am using One Channel 5Vlow trigger relay

Code and Wiring added

1 Like

I love the project ,Is there anyway you can add links to the required libraries and sdks used here, or links to ones that will work the same? I tried for hours searching for the versions you quoted and get links all over the place to other versions etc

I plan on using it to control relays for my solar projects control box

It should be easy if you just intall the Blynk library and flash your ESP with the AT firmware (I believe that comes default if you order one, btw, so should be super simple).

The current version of Blynk will do very nicely for this. I’m planning on making a strip myself, but I still need to get separate relays instead of 8 on one board.

i just used DHT library for DHT-11 sensor , and of course Blynk library.
if you Are doing similar project i suggest using ESP-12 standalone as it’s more stable and has more Pins
to play with.
also you should use latest blynk library (V3.1) and ESP8266/Arduino (V 2.0) for more stable results.

I’m trying to implement this project as it described here.
Unfortunately with no success. The biggest problem is compiling the code. I got
a million errors whatever library version I tried.
Can you expand in detail versions of libraries you used to.
Libraries changes and probably your code are not actual. I do not understand
how Blynk library can be v3.0 if I see only v0.3.7 in Github? Did you mean
0.3.0?

here i’am using Arduino Pro mini + ESP-01 (hardware serial), not Esp standalone.
the initial project - which is shared here - was using Blynk V 0.3.0

and mainly no change in that part , whatever once i reach home i will share the latest code with you which is running on my hardware now .

but make sure that your ESP-01 has ESP8266 SDk V 1.0 AT command V0.22 , i will share the Bin file to flash for it also.

i will test compiling it first before sharing it with you with library Version IDE version also.

i think the ESP_hardware serials is not avilable any more in Blynk library , i will check how can it compiles again with the latest library and post it

This is easy, just change few lines of code according to new examples…

Any hints on what those changes were? I downloaded all the libraries from github and now I get:

Arduino: 1.8.1 (Linux), Board: "Arduino Pro or Pro Mini, ATmega168 (5V, 16 MHz)"

In file included from /home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:32:0,
                 from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:2:
/home/chris/Arduino/libraries/BlynkESP8266-master/ESP8266_Lib.h:39:7: error: redefinition of 'class ESP8266'
 class ESP8266 {
       ^
In file included from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:1:0:
/home/chris/Arduino/libraries/arduino-ESP8266-master/ESP8266.h:69:7: error: previous definition of 'class ESP8266'
 class ESP8266 : public Stream
       ^
In file included from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:2:0:
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'void BlynkTransportShieldEsp8266::onData(uint8_t, uint32_t)':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:50:25: error: 'class ESP8266' has no member named 'getUart'
             if (client->getUart()->available()) {
                         ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:51:37: error: 'class ESP8266' has no member named 'getUart'
                 uint8_t b = client->getUart()->read();
                                     ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'void BlynkTransportShieldEsp8266::setEsp8266(ESP8266*)':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:68:17: error: 'class ESP8266' has no member named 'setOnData'
         client->setOnData(onData, this);
                 ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'bool BlynkTransportShieldEsp8266::connect()':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:81:26: error: 'class ESP8266' has no member named 'createTCP'
         status = client->createTCP(BLYNK_ESP8266_MUX, domain, port);
                          ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'void BlynkTransportShieldEsp8266::disconnect()':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:88:17: error: 'class ESP8266' has no member named 'releaseTCP'
         client->releaseTCP(BLYNK_ESP8266_MUX);
                 ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'size_t BlynkTransportShieldEsp8266::read(void*, size_t)':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:95:21: error: 'class ESP8266' has no member named 'run'
             client->run();
                     ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'int BlynkTransportShieldEsp8266::available()':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:109:17: error: 'class ESP8266' has no member named 'run'
         client->run();
                 ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h: In member function 'bool BlynkWifi::connectWiFi(const char*, const char*)':
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:140:20: error: 'class ESP8266' has no member named 'kick'
         if (!wifi->kick()) {
                    ^
In file included from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:1:0:
/home/chris/Arduino/libraries/arduino-ESP8266-master/ESP8266.h:306:26: error: 'ESP8266CommandStatus ESP8266::setEcho(bool)' is protected
     ESP8266CommandStatus setEcho(bool enable);
                          ^
In file included from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:2:0:
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:145:29: error: within this context
         if (!wifi->setEcho(0)) {
                             ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:149:48: error: no matching function for call to 'ESP8266::getVersion()'
         String ver = wifi->ESP8266::getVersion();
                                                ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:149:48: note: candidate is:
In file included from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:1:0:
/home/chris/Arduino/libraries/arduino-ESP8266-master/ESP8266.h:87:26: note: ESP8266CommandStatus ESP8266::getVersion(char*, int)
     ESP8266CommandStatus getVersion(char* buffer, int length);
                          ^
/home/chris/Arduino/libraries/arduino-ESP8266-master/ESP8266.h:87:26: note:   candidate expects 2 arguments, 0 provided
In file included from /home/chris/Arduino/sketch_may25a/sketch_may25a.ino:2:0:
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:151:20: error: 'class ESP8266' has no member named 'enableMUX'
         if (!wifi->enableMUX()) {
                    ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:154:20: error: 'class ESP8266' has no member named 'setOprToStation'
         if (!wifi->setOprToStation()) {
                    ^
/home/chris/Arduino/libraries/Blynk/src/BlynkSimpleShieldEsp8266.h:159:34: error: 'class ESP8266' has no member named 'getLocalIP'
             String my_ip = wifi->getLocalIP();
                                  ^
exit status 1
Error compiling for board Arduino Pro or Pro Mini.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

After the 2 & 1/2 years since this topic was posted :wink: many little things change… as is normal with many libraries.

You best way to troubleshoot old code is to compare with current basic Blynk examples and see what changes there are, and switch them one at a time until it works.

For example, I can at least compile the original code with these two changes…

Use #include <ESP8266_Lib.h> instead of #include <ESP8266.h>

and ESP8266 wifi(&EspSerial); instead of ESP8266 wifi(EspSerial);

There may be other subtle changes needed as well… Try and see.

Got the _Lib one by looking at what libraries I had. Will continue to poke around… once I get the simple examples working first.

Taa