Tuesday, September 15, 2015

ESP8266: DIY $10 IoT Smart Plug Prototype Part 1

I call it the NeMo... :P

Belkin WeMos are cool, but very expensive. One of the incentives of getting the Belkin WeMo, aside from automation, is to both environmentally and financially save on electricity by enabling and disabling your electronics through "smart" controls like IFTTT ("If This Then That") . However, one plug will set you back $59.99 CAD. That's pretty hefty in order to save you money. You can plug a power bar to really make use of it but that means you have no individual control to each devices. If you want a full home automation around the house, you may need 5+ of these to really get things going. Therefore, I set out to make my own.


My bill of materials came out to be:

  • $2.88 - Esp8266 module
  • $1.00 - USB wall charger (AC to 5V DC converter)
  • $0.75 - Box enclosure
  • $2.00 - 5V Relay module
  • $0.10 - LDO Regulator (to drop 5V to 3.3V for the ESP8266 module)
  • $3.00 - 3-pronged extension cable

Total: ~ $10.00 CAD

For about $10, I now have a WiFi connected Belkin WeMo clone. That's pretty cool.

Previously I used the NRF24L01+ radio chip to attempt a basic IoT device. While it worked, the NRF24L01+ was not the best solution. The NRF24L01+ doesn't communicate with standard home wireless networks. Which means in order to correctly make your client a real "internet" connected device, you would need some sort of a gateway like a Raspberry Pi that's connected to the internet with a NRF24L01+ module connected as well. This adds another layer to the connection to the internet.

There is an alternative, however. Recently a new low-cost module has been gaining a lot of traction on the internet. It's still slightly more expensive than an NRF24L01+ module but in terms of your overall project budget, it's cheaper than the NRF24L01+ radio. The reason for that is because the ESP8266 is a WiFi chip that also has microcontroller in itself. And folks have even ported Arduino environments to be loadable onto this chip. So rather than having to buy a Arduino Nano/Mini ($2) and connect that to the NRF24L01+ ($2), you'd just replace them with ESP8266 ($3).

When NeMo gets plugged in, it uses the WiFi SSID/password saved in the EEPROM to connect to the right wifi, if it fails to connect or there isn't a WiFi setting in the EEPROM, it resets itself into the Access Point mode. (Kind of like Chromecast..) After the connection is set up, it sends a text to me broadcasting its own ip address.


When the server is set up, the ESP8266 sets up a RESTful server that allows me to enable and disable gpio pins.

That's it for now, I'll post the details in another later post and the step by step guide so I can follow it myself to "manufacture" a batch of these things.

1 comment :

  1. Great post!I am actually getting ready to across this information,i am very happy to this commands.Also great blog here with all of the valuable information you have.Well done,its a great knowledge.
    Wifi Smart Plug

    ReplyDelete