Close
0%
0%

Solved: Esp8266 powered by coin cell

This project describes the use of a coin cell for powering the Esp8266 by building a remote control for Phillips Hue Lights

Similar projects worth following
The big problem using the ESPs is the power consumption when Wifi "goes up", about 100-200mA, peak up to 300mA. Normal coincells deliver a few mA, peak up to 20-40mA. But for the ESPs the voltage will collapse. We need "a little help of my friend": the supercap. These capacitors deliver enough current for power up the Wifi and sending a message, in this case the switch command. Another option is a datalogger that have to wake up every few hours for a couple of seconds.

First of all we have to know that it is no good idea to connect the battery and cap simply parallel.

The charging current from cell to cap has to be reduced with a resistor. The specs for my coin cell tell us a peak current of 25mA.

Ohm's law: R=U/I -> 3V/25mA= 120 Ohm.

The supercap has enough capacity to power the ESP for 10-20 seconds. If you use a static ip address like i do, the ESP only wake up for 1-2 seconds sends/receive its message and fall into "deepsleep" until the reset button is pressed.

Two options for the schematic:

1. Connect the supply directly and use the reset switch for action, see picture. In this case we have to make sure that the wemos needs as little power as possible, so we may have to remove the 3.3V regulator and the supply for the uart-ic.

2. We use a button switch that seperates the supply from the wemos. The downside is that you have to press the button for 1-2 seconds until the action is done. (lights on or off)



HueSwitch.stl

Main case for the Wemos

Standard Tesselated Geometry - 30.45 kB - 12/14/2017 at 19:05

Download

plate.stl

cover

Standard Tesselated Geometry - 100.09 kB - 12/14/2017 at 19:05

Download

Knob.stl

knob

Standard Tesselated Geometry - 11.55 kB - 12/14/2017 at 19:05

Download

ESPswitchHUE.ino

Arduino sketch for Esp8266

ino - 2.56 kB - 12/12/2017 at 19:51

Download

View project log

  • 1
    Upload the Arduino sketch

    First you need to install the Arduino IDE. Then you have to install the library for Esp8266

    Here is a good tutorial how to setup the Arduinio IDE for programming the Esp8266.

    After opening the sketch with the Arduino IDE you have to do some settings depending to you local WIFI before uploading:

    //For a faster connecting/switching we use a static ip adress:
    
    
    
    IPAddress gateway(192,168,178,1); //ip of you local wifi router where the hue bridge is connected
    
    IPAddress ip(192, 168, 178, 216); //ip of your switch, be aware of using a high adress in the range of 200-250 that is not used for other devices
    
    IPAddress subnet(255,255,255,0);
    
    int light = 2; // the number of your light that is switched
    
    const char hueHubIP[] = "192.168.178.57"; // the ip adress of the hue bridge
    
    const char hueUsername[] = "hue bridge username" //username the hue bridge
    
    const int hueHubPort = 80;  always "80"
    
    const char ssid[] = "SSID"; // network SSID (name)
    
    const char pass[] = "password"; // network password
    
    
    
    

     you have to create an authorized username in the hue bridge, look at this tutorial

  • 2
    Step 2

    STLs for the remote control are uploaded, I use normal print settings with an infill of 30% and 0.2mm layer height

    The knob is also printed so you can use the reset button for action and don't has to use an extra button.

    Use skirt and brim for the knob because the object is very small

  • 3
    Some additional Infos and assembly video

    Be sure to pre-charge the cap before connecting to wemos because the Esp8266 immediately start to make a wifi connection

    after reset/connect power.

    to save energy disconnect pin 4 and 16 of uart-ic and remove the voltage regulator, please note that it's no longer possible to program the wemos via USB !!

    Feel free to ask your questions

View all 3 instructions

Enjoy this project?

Share

Discussions

Jc wrote 07/23/2018 at 13:31 point

Hi! Nice project!! I want to know how many time you have on this coin cell? 

I want to make some light switch like your project but I dont want to change the battery every week in it. 

Thanks

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates