# Power problem, need 5V just for an instant, on stand by

#### mmcginty

Joined Feb 4, 2010
46
I'm working on a device that meters the flow of water and logs it to a WebAPI server, built around ESP32, using hall-effect sensors to monitor the flow. It's nearly done, but I still need to solve one problem.. The flow sensors need 5V to operate (4.3V bare minimum.) The device has a PV panel that charges its 18650 battery, which is perfect for every aspect of this circuit except the hall-effect flow sensors.

I have a buck converter to power the flow sensors, and a level converter to interface them to ESP32 GPIOs, but the buck converter uses power whenever it is on, regardless of whether there is any load, so I can't leave it powered up in a stand-by state. The CPU waits in a low power state for a single pulse from any sensor to wake it up, then it powers up the buck and from there the circuit works exactly as intended.

The problem is providing the sensors with 5V, without which the wake up pulse will never happen. I artificially sourced the sensors to test the rest of the circuit on the bench, but obviously that won't work in the wild.

Now for my actual question: isn't there a way to charge one or more capacitors, from 3.7V input, that would provide 5V discharge for just one pulse, when a sensor draws power (because it is spinning)? That would not burn power (after charging the cap) in stand-by? Is that feasible, or do I need to redesign my power supply, adding a second PV and battery (which will completely blow out my form factor and costs, but would give me workable voltage)?

#### Alec_t

Joined Sep 17, 2013
11,758
Welcome to AAC!
The CPU waits in a low power state for a single pulse from any sensor to wake it up
Could you just use a simple low-power 3.7V-supplied timer circuit, instead of any sensor, to provide occasional wake-up pulses? Or can't the CPU provide its own wake-up pulses?

#### mmcginty

Joined Feb 4, 2010
46
Welcome to AAC!

Could you just use a simple low-power 3.7V-supplied timer circuit, instead of any sensor, to provide occasional wake-up pulses? Or can't the CPU provide its own wake-up pulses?
It can but that defeats the point, I need it to wake up when water starts flowing, otherwise it will miss data. (I get that it will miss a few pulses while it wakes up.)

Maybe I could charge the cap with the buck before it goes to sleep, and wake up to charge it again before it leaks down?

#### Picbuster

Joined Dec 2, 2013
1,025
Put your processor in sleep mode using micro watts and wake-up on interrupt.
If however your MPU is not able to do so use a small model PIC to handle it.
It might need a simple (passive) flow detector( like a paddle wheel) or hook into the hall sensor or use a coil to detect the moving magnet.

Picbuster

#### Alec_t

Joined Sep 17, 2013
11,758
Can you post a link to the flow sensor datasheet?
What is the maximum interval between expected flow sensor pulses?

#### mmcginty

Joined Feb 4, 2010
46
Put your processor in sleep mode using micro watts and wake-up on interrupt.
If however your MPU is not able to do so use a small model PIC to handle it.
It might need a simple (passive) flow detector( like a paddle wheel) or hook into the hall sensor or use a coil to detect the moving magnet.

Picbuster
The MCU already is waking on interrupt. The problem is the hall sensor will not reliably generate pulses when the voltage supplied to it is too low. I looked exhaustively for a sensor that would work on 3.3 - 3.7, it doesn't seem to exist. The sensor is a self-contained IP67 unit, I can't add any circuitry or wiring to the outside, it would be in the weather and too vulnerable.

I'm thinking about putting a couple of 3V coin batteries in there to supply standby voltage, then isolate them with a JFET when the MCU wakes. If the batteries lasted a year it would probably be ok... seems cheesy as hell though.

#### mmcginty

Joined Feb 4, 2010
46
Can you post a link to the flow sensor datasheet?
What is the maximum interval between expected flow sensor pulses?
The flow is intermittent (driven by user-operated valve) so that max interval could be days or weeks or months -- in theory it might never happen. (The device would still log zero flow periodically, along with a few charge-related diag values.) I will get a link for the sensor later today, must sleep.

#### Alec_t

Joined Sep 17, 2013
11,758
Could you install a passive rotameter and then use an optical sensor to detect any movement of its 'float' and provide a wake-up signal? The sensor would work off the 3.3-3.7V supply.
max interval could be days or weeks or months -- in theory it might never happen
Depending on the liquid and its purity, scale/corrosion could be a problem if your flow sensor is of the rotary vane type.

Last edited:

#### mmcginty

Joined Feb 4, 2010
46
Could you install a passive rotameter and then use an optical sensor to detect any movement of its 'float' and provide a wake-up signal? The sensor would work off the 3.3-3.7V supply.

Depending on the liquid and its purity, scale/corrosion could be a problem if your flow sensor is of the rotary vane type.
Interesting, but the liquid (rain water) is delivered by flow of gravity, placing the flow rate on the low end of the spectrum (apparently an accuracy weakness for this sensor type), plus (not having actually looked) I'd imagine machine readable versions of this are not inexpensive. (Deal breaker.)

You are correct about scale/corrosion, debris is also a potential problem, however, not a feature of the circuit, per se. (We have an algorithm to identify usage patterns and detect deviations, will will trigger a maintenance visit, or maybe send them a new sensor (they're connected modularly.)

#### Alec_t

Joined Sep 17, 2013
11,758
I'd imagine machine readable versions of this are not inexpensive.
Couldn't you cobble together a sensor like this :-

Or you could use a Hall sensor plus a magnet on the vane. Hall sensors are available (cheaply) (e.g. S-5712BCDH2-I4T1U) which draw only ~2uA standby current from a 3.6V supply.

Last edited:

#### Norfindel

Joined Mar 6, 2008
326
If the boost converter has an enable pin, and you're sure that the sensor consumes 0 power when idle, what about this: you could charge a capacitor with the boost converter. The capacitor powers the sensor, and you need a circuit to re-enable the converter if the capacitor goes below some voltage. For example: enable if below 4.5v, disable if over 5v, or whatever higher voltage the sensor supports/is convenient for your circuit.

#### mmcginty

Joined Feb 4, 2010
46
Couldn't you cobble together a sensor like this :-
View attachment 167520
Or you could use a Hall sensor plus a magnet on the vane. Hall sensors are available (cheaply) (e.g. S-5712BCDH2-I4T1U) which draw only ~2uA standby current from a 3.6V supply.
I did see there are inexpensive Hall sensors that work on 3.3V even (which makes me wonder why there aren't liquid flow sensors that use them?) Unfortunately I left my CNC shop in my other pants, and all my 3D printers will be working on a sex robot design I lucked across for the next 6 weeks. The plan is to make a few dozen prototypes, and they have to be end-consumer eye-friendly, not to mention reasonably accurate...

But that suggestion spawned a similar thought: what about replacing the Hall sensor (and adapting support circuitry) for a commercial sensor? (Parenthetically I wish I did have CDC resources available, I'd make flow sensors with US pipe thread, rather than NPT.)

So playing teardown Tuesday with the sensor, a very uncomplicated circuit -- whoa did you hear that sound? What the...? Oh, just my labor cost shooting up like a SpaceEx rocket!

So one Hall component and one resistor, wow... that is the ultimate solution, thank you very much for your assistance, that goes for everyone that responded, spit-balling with other circuit designers was immensely useful! I appreciate all of your respective time and effort!

Now I have to update my board to remove the buck and level converter and get new ones printed. Net BOM cost will be +-$1, power savings substantial. I should have some pretty pictures in a few weeks. Thanks again, everyone, well done! #### Picbuster Joined Dec 2, 2013 1,025 The flow is intermittent (driven by user-operated valve) so that max interval could be days or weeks or months -- in theory it might never happen. (The device would still log zero flow periodically, along with a few charge-related diag values.) I will get a link for the sensor later today, must sleep. I did understand that you are collecting rain water is this correct? If so use a simple method a flap switch. imaging two pipes big one and a smaller one the smaller one is closed at the and by a flap with spring plus a contact. The water is accumulated in the small pipe until the water weights will open the flap and water start to flow. The switch will detect and set the electronics into motion. The pipe length between the flap and your device is defined by the speed of water in relation to your start-up. Lock the flap when open and close it when the water stops flowing. Picbuster #### Alec_t Joined Sep 17, 2013 11,758 Nice to see the teardown pics. I did see there are inexpensive Hall sensors that work on 3.3V even (which makes me wonder why there aren't liquid flow sensors that use them?) If you order a boatload of sensors from China I'm sure you could specify that they use a low power low voltage Hall IC. Thread Starter #### mmcginty Joined Feb 4, 2010 46 Nice to see the teardown pics. If you order a boatload of sensors from China I'm sure you could specify that they use a low power low voltage Hall IC. I thought about that, maybe Elektrodragon.com can hook me up. (Love their board printing service.) The best fit I can find at digikey is this one,$8.50 (nearly twice the price of the flow sensor) but I just need to see it work first, then cut costs.

https://www.digikey.com/product-detail/en/ATS344LSPTN-T/620-2004-ND/9561521/?itemSeq=281578511

I'm sure it's overkill, it does I2C along with PWM. Maybe some advantages but I'm not going to redesign the firmware.

I couldn't find specs for the current one, only markings are:
W130
5528

#### Alec_t

Joined Sep 17, 2013
11,758
The best fit I can find at digikey is this one, \$8.50
Jeepers, that's expensive! What's wrong with the one I mentioned in post #10? The version with a CMOS output stage doesn't even need the pull-up resistor.

Last edited:

#### mmcginty

Joined Feb 4, 2010
46
Jeepers, that's expensive! What's wrong with the one I mentioned in post #10? The version with a CMOS output stage doesn't even need the pull-up resistor.
The first problem was I gapped it. It's SMD, doesn't fit my form factor at all. There's got to be a cheaper through-hole option, but without the spec for the original, the search for a good fit is harder.

Aside, as I was updating my board in Eagle I remembered what a bitch it was to solder the level converter, so glad to lose that thing!

#### Alec_t

Joined Sep 17, 2013
11,758
You would need to find out whether the IC has to be S-pole or N-pole sensitive.

Last edited:

#### mmcginty

Joined Feb 4, 2010
46
You would need to find out whether the IC has to be S-pole or N-pole sensitive.
It reads a circular composite magnet that spins with the force of the water. I'll get or make some iron filings, to see what characteristics of the magnet I can ascertain... but I was thinking either polarity should work, as the segments surely alternate, so my thinking was either polarity would work. Of course it might not be a magnet at all, it could just be slices of dissimilar metals, but I seriously doubt that's the case, I think it would take more circuitry to discern the transitions.

Isn't polarity only important when using a single fixed magnet, to sense proximity?