Advanced Users can post their questions and comments here for the not so Newbie crowd.

Moderator: eriksl

User avatar
By eriksl
#89247 Hi all,

I am planning to make a wlan remote control (not infrared, bluetooth or otherwise ISM technology). Most of the work is actually done (the software part) and it does already work, as long as it's connected to a power line. And that's the issue, for it to be really usefull, it will need to run on batteries.

I am lucky I have the space for one or two penlight batteries, no need to go for coin cells. But even then, 1.2 Volts or 2.4 Volts (1 or 2 rechargable batteries) is too low or very quickly too low for the ESP8266 to run on.

So I tried one of my always "in stock" boost converters (containing an XL6009). That won't work though, because officially it needs 5 V to run on (although I could see it starting to work from 2.6 V). I now have ordered for a few other boost converters, that are supposed to start working from 0.9 V, I'm very curious if they really work well, we'll have to see.

Now the interesting part, the power management. I had the following in mind. There are six inputs for user control (two encoders each with an A, B and toggle outputs). All of them need to be able to wake the ESP. As far as I know both A and B signals are low when idle, will check. Toggle is also low on idle. So what I need to do is make a logical or for all those signals, make it start a timer and while the timer is running, it should pull the chip enable pin.

Now the, I think, most interesting decision is how to keep the ESP active long enough for it to be able to process the input, send it and keep around for long enough to give the user a smooth experience. I could configure the timer to keep active for about one minute, but there is also another approach, where the timer is only active long enough for the ESP to boot, then the ESP would keep itself powered on for a configured amount of time. I would prefer that last option. It would allow for a proper deassociation from the access point instead of simply turning of the power. I think it will need another "or" between an output pin and the timer.

For the "OR" ports I actually was thinking of an 2 times 4-in-package 7400 type OR, CMOS compatible and low power, something like the AC type or newer. I don't like "wired" OR (which would be very simple of course). And for the timer the old 555. I am not sure both can do what I want, I am still investigating.

Any thoughts on this?
User avatar
By btidey
#89254 In the rotary encoders (cheap small 20 step type) I have used the A/B have a common connection and the push switch has two separate terminals.

I normally connect one switch terminal to the A/B common and then to 0V. So then there are three logical 'signals'. In the idle state all connections are open so with pull ups they are logical 1 normally and logical 0 when activated during rotation or when switch is pulsed.

For a minimal 1 control WLAN rotary button I just started up the ESP8266 when the A signal activated. I don't think it is necessary to use both A and B as both will activate during a rotation. In my case I didn't need to activate on a push operation but could be added pretty easily.

After activation I used a GPIO to maintain the device on until it had completed its operation and so the software could determine when to release this and allow the device to sleep. I have a configurable hold time so that once activated it would stay on for a bit as further operations were quite likely.

I use a small LiOn (300mAh) cell and this gives a good length of time (e.g. 6 months depending on usage.

It sounds like you are doing a more extensive operation than I was so it could require more external support but it might be worth checking out the implementation for ideas.
User avatar
By eriksl
#89255 How do you ensure the ESP keeps powered on (CE high) until fully booted? This is where, in my case, the 555 comes in.

BTW in the meantime I (also) realised the encoder outputs are idle high, they're pulled up by a hardware debouncer I usually use. Even without a debouncer you'd probably pull up the outputs.

So I don't need an OR gate but an AND gate. This works out quite well as the trigger input for the 555 is active low. So as long as everything is idle (high), the output remains high (inactive). I've found the CD4068 does exactly what I want, eight inputs, one output, no inversion and still sells. The inputs are nicely high-impedance, the output is not very strong (< 1 mA at 3.3 V), but it's push-pull and strong enough to drive the trigger of the 7555 (NXP CMOS variant of the 555). So so far it looks like it can work. As only CMOS components are used, idle power should be very low.

I am very curious whether I will be able to run from a single AA cell (1500 mAh) using the boost converter I ordered, that would be awesome. If the battery would be needed to be replaced once a year it would be great!
User avatar
By eriksl
#89256 I just realised, why not use AAA cells, the capacity will probably be large enough as well and their size is considerately less, easier to use two of them or even three, in a not-to-large box including the PCB and the encoders. So I order a few battery holders for those too.