Low power, tiny, wall switch controlled ESP8266, for a hue project

Thread Starter

Ztimac

Joined May 8, 2021
5
Greetings enthusiasts!

I've joyfully immersed myself in a DIY project controlling Hue lights with a wall switch. Hoping for some tips to get me through as I haven't done any electronics since high school. In my 40s now.

My main inspirations is a project on diyhue and one on this forum using a ESP8266 wi-fi microcontroller. My goal is to combine the two for a low power (battery powered) solution with a double wall switch i.e. four states, small in size for mounting behind the switch.

For the moment, we'll not worry about the actual GPIOs. The ESP8266 apparently provides a deep sleep mode and is awaked by pulling down the RST pin. The diyhue project demonstrates this with a push button, however, like the aac-project, I need pulses on both the on and off sides. The mcu will wake up, read the state, do its thing and go back to sleep.

On the other hand, I'm worried about the power consumption of the aac-project. No point in exploiting the deep sleep function if the support circuit is going to drain the battery if any switch is in the on state, requiring an exchange of battery every few weeks. Perhaps redimensioning the spark protection would do it, but I'm out of my depth as to side effects.

One of the first questions asked in the aac-project was, discrete or IC. I'm not concerned either way, as long as power consumption and dimensions are kept low.

Any tips very much appreciated!
 

wayneh

Joined Sep 9, 2010
17,152
My goal is to combine the two for a low power (battery powered) solution with a double wall switch i.e. four states, small in size for mounting behind the switch.
I'm wondering about the strategy of using a battery when there's line power so readily available. Why not take power off the line and just leave the device on all the time? It's far less power than a nightlight and probably no more than all the other things we leave plugged in 24/7.
 

Thread Starter

Ztimac

Joined May 8, 2021
5
I'm wondering about the strategy of using a battery when there's line power so readily available. Why not take power off the line and just leave the device on all the time? It's far less power than a nightlight and probably no more than all the other things we leave plugged in 24/7.
1. It's more interesting that way. I could easily do it with the MCU looping eternally.
2. Line power is not actually readily available. I'd need need a 230 V DC in the wall and I'd need to burden you with questions about fire safety instead.
 

wayneh

Joined Sep 9, 2010
17,152
I'd need need a 230 V DC in the wall and I'd need to burden you with questions about fire safety instead.
I was imagining this installed in a standard electrical box where there are already line-power switches. Are you saying this is a standalone switch-box, like a big remote control?
 

MisterBill2

Joined Jan 23, 2018
8,736
Certainly one option to reduce the battery consumption would be a 3 position, spring return to center off, toggle switch, instead of a traditional wall switch. Since the proposed control transmitter is battery powered, the rules for 230 volt mains powered wiring do not apply. A standard electrical box and standardswitch cover plate, or a home-made cover, can comply with code requirements easily because of low voltage battery power, not mains.
That would be one way to do it.
 

Thread Starter

Ztimac

Joined May 8, 2021
5
I was imagining this installed in a standard electrical box where there are already line-power switches. Are you saying this is a standalone switch-box, like a big remote control?
Yes!

Certainly one option to reduce the battery consumption would be a 3 position, spring return to center off, toggle switch, instead of a traditional wall switch. Since the proposed control transmitter is battery powered, the rules for 230 volt mains powered wiring do not apply. A standard electrical box and standardswitch cover plate, or a home-made cover, can comply with code requirements easily because of low voltage battery power, not mains.
That would be one way to do it.
I've already purchased the switch at a flee sale. It's vintage and lovely.
 

MisterBill2

Joined Jan 23, 2018
8,736
It may be possible to add to the original vintage switch so that it provides a closure in each direction. Then, use capacitance coupling to obtain a short pulse as each closure is made. And because the switching will be done at logic levels, the requirements for mains switching applications will not apply. This will allow quite a bit more freedom to create switching points.
 

Thread Starter

Ztimac

Joined May 8, 2021
5
It may be possible to add to the original vintage switch so that it provides a closure in each direction. Then, use capacitance coupling to obtain a short pulse as each closure is made. And because the switching will be done at logic levels, the requirements for mains switching applications will not apply. This will allow quite a bit more freedom to create switching points.
Maybe. Or maybe the other way around, so that there's closure between the endpoints.
 

wayneh

Joined Sep 9, 2010
17,152
The ESP8266 apparently provides a deep sleep mode and is awaked by pulling down the RST pin.
Do you have the info on what it takes to trigger that? How long, for instance? I agree that a capacitor-coupling may be all that's needed to accomplish the triggering. Easy enough to experiment and find out. I's start with a 0.1µF ceramic, just because that's cheap, small, and commonly on hand for use as a bypass capacitor on every IC. If it works, you're done.
 

MisterBill2

Joined Jan 23, 2018
8,736
I like even better the concept of a closed contact during the transition and being open at each end. That delivers the functionality with no extra parts. Of course, contact bounce could provide a bit of entertainment.

The fact is that such a setup could allow me to install ceiling lights without needing to pull wires in the wall. That could make me a surer-hero for a few folks.
 
Top