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

Thread Starter

mmcginty

Joined Feb 4, 2010
57
Correct.

Eh? The original Hall sensor used an external pull-up resistor, according to your post #12 pic, not a built-in one. So the original sensor presumably was open collector/drain. Conversely, the sensor in the first link in post #37 does have a built-in pull-up.
Sorry I meant built into the flow sensor, on the little PCB next to the Hall sensor within it.
 

Alec_t

Joined Sep 17, 2013
15,121
The Hall sensors in all of the links you posted have a single output transistor which turns on (pulling the output low) when the magnet pole is sensed. By 'digital output' were you hoping for a high-going output instead?

Edit:
According to their datasheet, Si7205 and Si7206 are two examples of Hall sensors with high-going outputs and a 3.3V min supply voltage.
 
Last edited:

Thread Starter

mmcginty

Joined Feb 4, 2010
57
The Hall sensors in all of the links you posted have a single output transistor which turns on (pulling the output low) when the magnet pole is sensed. By 'digital output' were you hoping for a high-going output instead?
Yes, pretty much... is that not going to be the case? Am I still going to need the level inverter? None of those options will be low when it's idle?
 

Thread Starter

mmcginty

Joined Feb 4, 2010
57
The Hall sensors in all of the links you posted have a single output transistor which turns on (pulling the output low) when the magnet pole is sensed. By 'digital output' were you hoping for a high-going output instead?

Edit:
According to their datasheet, Si7205 and Si7206 are two examples of Hall sensors with high-going outputs and a 3.3V min supply voltage.
Damn it! Even the digital output ones have internal pull-ups, WTFH? How are they different from the ones that are open drain/collector?
 

Alec_t

Joined Sep 17, 2013
15,121
I think 'digital output' merely means that the output doesn't vary ~linearly with magnetic field strength. The output is just high or low.
 

Thread Starter

mmcginty

Joined Feb 4, 2010
57
I think 'digital output' merely means that the output doesn't vary ~linearly with magnetic field strength. The output is just high or low.
My basic design premise is flawed. The position at which the flow sensor wheel comes to rest can potentially leave the Hall high or low, so even if the level inverter worked adequately (which it did not) there will always be potential for the device to be left in a condition where its wake signal is left active and it's prevented from sleeping. Wake on pins is unusable for this sensor.

So I found an example that runs a polling loop on the ultra-low-power coprocessor, IO levels are in a bitfield, so single instruction to test for inequality... more coding (ULP routines have to be written in assembler, ugh!)

Anyways, I think I've gotten the answers/ideas I needed as far as the circuit goes, many thanks again for all your time and patience!
 

Norfindel

Joined Mar 6, 2008
326
My basic design premise is flawed. The position at which the flow sensor wheel comes to rest can potentially leave the Hall high or low, so even if the level inverter worked adequately (which it did not) there will always be potential for the device to be left in a condition where its wake signal is left active and it's prevented from sleeping. Wake on pins is unusable for this sensor.
Doesn't your MCU have wake on pin change?
 

Thread Starter

mmcginty

Joined Feb 4, 2010
57
Doesn't your MCU have wake on pin change?
It does, it even has wake on multiple pins, which is what I need. But the only two options available are wake on any high, and wake on all low. Wake on any high was the only seemingly practical choice.

But I can't depend on the level of any of the sensors when the water stops flowing, could be high, could be low, random chance. (Most of the time it is high when at rest, but not always as I had assumed.) With the built-in wake on pins, the level of the sensors when deep sleep is entered, is integral, obviously. That integral relationship is unworkable in my case.

So what I need is wake on any pin level change, store the levels of all sensors when it goes to sleep, and wake if any of them changes. Since levels are stored as a bit field, it's a simple test that takes very little compute, initial_value xor current_value == 0, no change; > 0, something changed.

I just looked it up, ULP draws 150µ amps, so by my calcs, 3.6m amp/hours a day, except when water is flowing. Not as good as 5µ amps, but it'll still work.
 

Alec_t

Joined Sep 17, 2013
15,121
Wake on any high was the only seemingly practical choice.
I think you should be able to use that option if you capacitively couple the output of the sensor to the MCU input and bias the input with a pull-down resistor to a low logic state. A magnet pole passing the sensor would produce a bi-polar pulse at the cap output and a diode clamp could kill the negative-going bit.
 
Last edited:

BobaMosfet

Joined Jul 1, 2009
2,211
I didn't see what voltage you're power-supply is at (whether coin-cell or something else). Why not make this simple and reliable? All you need is a wire from your power-supply extending into the path of the water (where it might show up), and another wire opposite it also extended into the potential water-flow, that then connects to a wake-up pin or interrupt-in pin on your MCU.

If water flows, the connection is made between the exposed ends in the water-flow and the input pin is powered, only when water flows. You can manage the voltages and resistances as suits your need. I recommend using a resistor on the input-pin side that limits it to whatever voltage you need at 1mA.

I haven't tried this, so it might not work but it seems like it would.
 

Thread Starter

mmcginty

Joined Feb 4, 2010
57
I think you should be able to use that option if you capacitively couple the output of the sensor to the MCU input and bias the input to a low logic state. A magnet pole passing the sensor would produce a bi-polar pulse at the cap output and a diode clamp could kill the negative-going bit.
Wouldn't that potentially side-effect the pulse counting function? I think part of the difficulty is needing to use a single IO for two purposes. At one point I was experimenting with JFETs to reroute the sensor output to a different pin when power was off. It was nominally successful but accomplished nothing. (I didn't fully understand the problem domain until a few days ago - assuming I do now.)

I really like the software solution, having complete control over the way it interprets activity on wake pins has a ton of appeal, and the power cost is well within the capabilities of the battery and PV.

I didn't see what voltage you're power-supply is at (whether coin-cell or something else). Why not make this simple and reliable? All you need is a wire from your power-supply extending into the path of the water (where it might show up), and another wire opposite it also extended into the potential water-flow, that then connects to a wake-up pin or interrupt-in pin on your MCU.

If water flows, the connection is made between the exposed ends in the water-flow and the input pin is powered, only when water flows. You can manage the voltages and resistances as suits your need. I recommend using a resistor on the input-pin side that limits it to whatever voltage you need at 1mA.

I haven't tried this, so it might not work but it seems like it would.
I tried a while back using the conductivity of water to sense level in a container and it didn't work out. Power is a 16550 battery 3.7V. I may look into it, if the software solution I'm currently trying to implement doesn't pan out.
 

Thread Starter

mmcginty

Joined Feb 4, 2010
57
Here's a sim of a capacitive coupling arrangement :-
View attachment 169987
R1/D1 clamp the negative-going pulses.
That's an inventive solution, and I'm sure it would trigger wake up (sometimes the static from my fingers on the wire triggers it) but what concerns me is the built-in pulse counter function that expects a square wave.

I did find a workable 3.3V Hall sensor, triggers at 12mT, releases at -1mT, it generates the same square wave as the original did at 5V.

Still working on the ULP solution, or trying to find time to, more like.
 

pmd34

Joined Feb 22, 2014
529
Hi mmcginty! there is actually a nice way around this!
I bought a couple of these:
https://www.aliexpress.com/item/1-4...14.html?spm=a2g0s.12269583.0.0.7ef02883vV4KYn

Which I guess are similarin function what you have. The rotor that monitors the flow is actually a small magnet so if you fix something like one of these (high value) inductors (plus rectifying diode) to the side:
https://www.aliexpress.com/item/10p...lgo_pvid=33bea206-6fa7-47e0-8291-bcd8c9f5020e

When there is water flow you can actually generate enough power to power your MC directly, and read the flow rate from the actual voltage generated when loaded. (Though you could retain the hall effect sensor part also.)
 
Top