Computing stuff tied to the physical world

Adding a voltage monitor

What we need, is a supply voltage monitor: a circuit which has some sense of absolute voltage levels, and can switch on at a certain tripping point.

There are many ways to do this – there’s in fact a whole family of “supervisor” chips which have as their only task to generate a clean reset pulse when a certain voltage is reached. But for this project, it’ll be much more interesting to do this with discrete components.

Here is the harvesting circuit with a voltage monitor added onto it:

Screen Shot 2015 02 24 at 01 36 35

Five extra components. As will become clear later, this is not the end of this story:

  • Q1 is an NPN transistor, it conducts when its “base” (again on the left) is pulled high
  • Q2 is a P-MOSFET, it conducts when its “gate” (on the left) is pulled low

Here is a frozen-in-time view of what happens on power-up in this circuit:

SCR74 3

There is an huge amount of useful information to be gleaned from this scope snapshot:

  • the blue line (CH2) is the power supply voltage, i.e. Vres
  • it is masked by the green line initially, and later by the yellow line
  • the magenta line (CH3) is the voltage on the NPN’s base pin
  • the green line (CH4) is the voltage on the P-MOSFET’s gate pin
  • the yellow line (CH1) is the voltage which gets connected to the µC

As you can see, the power supply voltage starts to rise, as energy gets harvested from the CT. The “wobble” is caused by the rectified 100 (!) Hz: harvesting happens in little bumps.

At about 1.8V, the bottom LED starts to get some voltage, and hence also the base of the NPN transistor. Once the gate reaches about 0.6V, it can’t go any higher and the NPN transistor “turns on”. Due to its high gain, a small increase in base current now has a large effect on the transistor’s output. When on, the transistor connects the top pin (collector) to the bottom pin (emitter), causing the top to be essentially shorted to ground.

Once the P-MOSFET’s gate is pulled to ground, it also turns on, and becomes conducting. The effect is very much like flipping a switch: from then on, the yellow line is essentially directly connected to the blue line. Our µC is powered up, and this circuit just stands by.

Voilá! We have sharp “snap-on” type switching. It still happens a little bit early, i.e. at around 2.2V, but perhaps we can tweak that point later by adjusting some component values, or picking slightly different components. The essential behaviour is now correct.

And indeed, when powered up with the µC connected, this circuit now switches on correctly. There is now a quick turn-on, which pulls the µC through its reset sequence.

So we seem to have solved the problem, but let’s not claim complete victory just yet…

[Back to article index]