Maker Pro
Maker Pro

8051 On/Off Circuit

M

mpm

Jan 1, 1970
0
You should avoid using switchers since these use quite a lot of power
even when disabled. Powering your device from a 3.6V battery makes
much more sense...

The LCD and rest of the circuit is 5V, so for minimum parts (and
assembly effort), I don't see a compelling reason to use 3.6 volts.
(?) Not to mention, I'd rather use a consumer battery (9V vs.
2-"AA"'s).

RE: switcher, I would also disable the P/S. The switching efficiency
would only come into play when the device was actually "ON".
Otherwise, there are also linear regulators with enables.


-mpm
 
M

mpm

Jan 1, 1970
0
There's no shortage of low-voltage 8051 family members.

The 89C51 goes as low as 2.7V for example.

Graham

Agreed. In fact, the 8051 I intend to use goes to 2.7V.
But the LCD display (and other circuitry does not)... 5V.
So to keep parts and assembly down, I would probably just use 5V.

-mpm
 
M

mpm

Jan 1, 1970
0
Problems may arise when the switch is pressed too short so you will need
some additional circuitry. Starting a micro is always surrounded by unwanted
side effects anyway. I'd make the processor switch off all components but
itself by a circuit like the one above and then go to sleep. This way the
micro keeps control.

The software can take care of startup issues.
There's really nothing connected that could do any harm.
...except of course, the uPC that will eventually TURN OFF the
device.!!

It would take an exceptional series of "correct" glitches to overwrite
the serial EEPROM, initiate communications, or clobber the LCD. In
fact, I'll initialize the LCD before writing to it anyway (each and
every start-up). Every "ON" event will be a cold start, and that's
fine for this application. I don't need to store RAM, or anything
like that.... -mpm
 
N

Nico Coesel

Jan 1, 1970
0
Eeyore said:
There's no shortage of low-voltage 8051 family members.

No, but there is shortage of really low power families. I'm talking
sub milli-Amperes here while operating. The MSP430 series is
specifically optimized to run for several years on one 3V battery for
use in metering applications.
 
N

Nico Coesel

Jan 1, 1970
0
mpm said:
The LCD and rest of the circuit is 5V, so for minimum parts (and
assembly effort), I don't see a compelling reason to use 3.6 volts.
(?) Not to mention, I'd rather use a consumer battery (9V vs.
2-"AA"'s).

3V cells are very standard for use in photo cameras. And there are 3V
LCD displays. In fact, 5V components may become obsolete in the near
future. BTW, some MSP430 devices can drive LCD displays directly.
Olimex (www.olimex.com) has some boards that demonstrate that feature.
This may be an additional cost saver. Bare LCD displays with pins can
be bought from suppliers in China.
RE: switcher, I would also disable the P/S. The switching efficiency
would only come into play when the device was actually "ON".
Otherwise, there are also linear regulators with enables.

Look at the off state current (even better: power consumption) of a
switcher and a linear regulator. It is huge.
 
F

Fred Bloggs

Jan 1, 1970
0
This is general enough to be of use to several folks.

Anybody got a simple momentary keypad-switchable ON-OFF circuit for a
8051 (or similar)?
Figure about 100 mA MAX, and will be battery operated (9-Volt).

Program will run for a minute or so, then the device should shutdown
(under uPC control) until the next time it's needed. Probably do
this about 20 times a day. Battery lifetime is important.

MINIMUM cost, and minimum parts count would be nice too! :)


The only thing I can think of is a FET controlling the input to a
switch mode power supply / regulator. (But admittedly, I don't do
much battery-only stuff, and my solar design are higher current and
not easily adaptable for low cost.)

The circuit shown below is about as foolproof as it gets. The CD4093 is
a quad NAND w/Schmitt trigger inputs and can run off nearly any voltage.
This stays connected to the battery at all times, it draws no current
when the circuit is powered done, other than leakage. The circuit is
such that the switch can turn the power on and off at any time,
regardless of the processor input. It can override an OFF by being held
down, and it can turn the circuit off at any time. G1 and G2 in
combination with the switch form a toggle FF that self-latches off. The
microprocessor OFF input is not enabled while the latch is off. When the
momentary is pressed, the FF transitions to turn the PFET on and
enables the OFF input through the 1M and 0.1u delay to G3 input. This
does not occur until approximately 100ms after the switch is released.
So the user has the option of holding the switch down until the
processor gives some indication that it is on or otherwise. The
processor need only trigger OFF for a few hundred nanoseconds. G4 then
asserts a '1' to G3 input. If the the capacitor has charged to '1' by
that time, which is usually the case, G3 asserts a '0' on G2 input which
forces G2 to '1', turning the PFET off and causing G1 to latch with G2,
disabling the OFF input and locking the circuit into that state until
the next switch press.
View in a fixed-width font such as Courier.

..
..
..
.. CD4093
.. QUAD NAND SCHMITT
.. BATT
.. |
.. |
.. |< PMOS SW
.. .------------[10k]------------------+-----||
.. | | |----> TO LOAD
.. | |
.. | __ G1 |
.. | .--| \ __ G2|
.. +--| | o----+------+-------| \ |
.. | '--|__/ | | | o-'
.. | | | .-|__/
.. | | [100k] | __
.. | [1M] | | / |------.
.. | | | '-o | |
.. | | | | \__|-. |
.. | --- | | G3 | |
.. '---o o------+--------------------' |
.. | | |
.. NO SW === | __ G4 |
.. |0.1U | .--| \ |
.. -+- +-----| | o-----'
.. /// | '--|__/
.. |
.. |/
.. OFF>--[10K]---+----|PN3904
.. | |>
.. [10K] |
.. | |
.. '------+
.. |
.. ---
.. ///
..
..
..
 
E

Eeyore

Jan 1, 1970
0
MooseFET said:
I also think you may need a pull up on the processor pin. The 8051s
don't pull up very well.

I was looking at a figure of 22k earlier today. I do tend to add external pull-ups
if the line goes any distance.

Graham
 
E

Eeyore

Jan 1, 1970
0
mpm said:
The LCD and rest of the circuit is 5V, so for minimum parts (and
assembly effort), I don't see a compelling reason to use 3.6 volts.
(?) Not to mention, I'd rather use a consumer battery (9V vs.
2-"AA"'s).

AAs are usually MUCH easier to find than 9V cells IME. And less expensive
per energy stored. You can get NiMH AAs with ~ 2.2 Ah capacity now too, so
a couple of those feeding a step-up switcher would power 100mA @ 5V for
some 4 hours even assuming slightly less than 80% efficiency for the
switcher.

RE: switcher, I would also disable the P/S. The switching efficiency
would only come into play when the device was actually "ON".

Indeed.

Graham
 
E

Eeyore

Jan 1, 1970
0
mpm said:
Agreed. In fact, the 8051 I intend to use goes to 2.7V.
But the LCD display (and other circuitry does not)... 5V.
So to keep parts and assembly down, I would probably just use 5V.

Have you looked for a lower voltage LCD ? They should be commonplace these
days.

Graham
 
E

Eeyore

Jan 1, 1970
0
Nico said:
No, but there is shortage of really low power families. I'm talking
sub milli-Amperes here while operating. The MSP430 series is
specifically optimized to run for several years on one 3V battery for
use in metering applications.

Nice !

Graham
 
M

MooseFET

Jan 1, 1970
0
The circuit shown below is about as foolproof as it gets.

....not quite actually you forgot one type of fool (at least).
See below the drawing.

View in a fixed-width font such as Courier.

.
.
.
. CD4093
. QUAD NAND SCHMITT
. BATT
. |
. |
. |< PMOS SW
. .------------[10k]------------------+-----||
. | | |----> TO LOAD
. | |
. | __ G1 |
. | .--| \ __ G2|
. +--| | o----+------+-------| \ |
. | '--|__/ | | | o-'
. | | | .-|__/
. | | [100k] | __
. | [1M] | | / |------.
. | | | '-o | |
. | | | | \__|-. |
. | --- | | G3 | |
. '---o o------+--------------------' |
. | | |
. NO SW === | __ G4 |
. |0.1U | .--| \ |
. -+- +-----| | o-----'
. /// | '--|__/
. |
. |/
. OFF>--[10K]---+----|PN3904
. | |>
. [10K] |
. | |
. '------+
. |
. ---
. ///
.
.
.
Yes, it is a very nice circuit. If you add a schottky in the power
line of the CD4093 and exchange the S-D connections of the P-MOSFET,
you also get a dropless reverse voltage protector. One more fool
gone :>

Also:
You can save two resistors by changing the PN3904 to a small MOSFET.
 
F

Fred Bloggs

Jan 1, 1970
0
MooseFET said:
The circuit shown below is about as foolproof as it gets.


...not quite actually you forgot one type of fool (at least).
See below the drawing.


View in a fixed-width font such as Courier.

.
.
.
. CD4093
. QUAD NAND SCHMITT
. BATT
. |
. |
. |< PMOS SW
. .------------[10k]------------------+-----||
. | | |----> TO LOAD
. | |
. | __ G1 |
. | .--| \ __ G2|
. +--| | o----+------+-------| \ |
. | '--|__/ | | | o-'
. | | | .-|__/
. | | [100k] | __
. | [1M] | | / |------.
. | | | '-o | |
. | | | | \__|-. |
. | --- | | G3 | |
. '---o o------+--------------------' |
. | | |
. NO SW === | __ G4 |
. |0.1U | .--| \ |
. -+- +-----| | o-----'
. /// | '--|__/
. |
. |/
. OFF>--[10K]---+----|PN3904
. | |>
. [10K] |
. | |
. '------+
. |
. ---
. ///
.
.
.

Yes, it is a very nice circuit. If you add a schottky in the power
line of the CD4093 and exchange the S-D connections of the P-MOSFET,
you also get a dropless reverse voltage protector. One more fool
gone :>

Also:
You can save two resistors by changing the PN3904 to a small MOSFET.

Okay, reverse battery protection added, and also a variation on G1 so
that the SW can latch it on but loses control on turning it off, leaving
that to the OFF input. The transistor allows OFF to be controlled by low
voltage logic signals.
View in a fixed-width font such as Courier.

..
..
..
.. BATT
.. CD4093 |
.. --------- |
.. .-|gnd Vdd|-------------|--.
.. | --------- | |
.. --- |- |
.. /// .-----|| |
.. | |< |
.. | | |
.. |PMOS SW +--'
.. QUAD NAND SCHMITT | |
.. | |<
.. .---+-------------------------------+-----||
.. | | | |-
.. | | | |
.. [10k] | __ G1 | '--> TO LOAD
.. | '_| \ __ G2|
.. | | o----+------+-------| \ |
.. +-----|__/ | | | o-'
.. | | | .-|__/
.. | | [100k] | __
.. | [1M] | | / |------.
.. | | | '-o | |
.. | | | | \__|-. |
.. | --- | | G3 | |
.. '---o o------+--------------------' |
.. | | |
.. NO SW === | __ G4 |
.. |0.1U | .--| \ |
.. -+- +-----| | o-----'
.. /// | '--|__/
.. |
.. |/
.. OFF>--[10K]---+----|PN3904
.. | |>
.. [10K] |
.. | |
.. '------+
.. |
.. -+-
.. ///
..
..
..
 
M

MooseFET

Jan 1, 1970
0
MooseFET wrote:
[.... old version removed ....]
Okay, reverse battery protection added, and also a variation on G1 so
that the SW can latch it on but loses control on turning it off, leaving
that to the OFF input. The transistor allows OFF to be controlled by low
voltage logic signals.

I'm going to modify your circuit slightly. Look for ***
View in a fixed-width font such as Courier.

.
.
.
. BATT
. CD4093 |
. --------- |
. .-|gnd Vdd|-------------|--.
. | --------- | |
. --- |- |
. /// GND-----|| |
. *** |< |
. | |
. PMOS SW +--'
. QUAD NAND SCHMITT |
. |<
. .---+-------------------------------+-----||
. | | | |-
. | | | |
. [10k] | __ G1 | '--> TO LOAD
. | '_| \ __ G2|
. | | o----+------+-------| \ |
. +-----|__/ | | | o-'
. | | | .-|__/
. | | [100k] | __
. | [1M] | | / |------.
. | | | '-o | |
. | | | | \__|-. |
. | --- | | G3 | |
. '---o o------+--------------------' |
. | | |
. NO SW === | __ G4 |
. |0.1U | .--| \ |
. -+- +-----| | o-----'
. /// | '--|__/
. |
. |/
. OFF>--[10K]---+----|PN3904
. | |>
. [10K] |
. | |
. '------+
. |
. -+-
. ///
.

*** The PMOS only needs its gate to ground. There is no need to take
away its gate drive when the power is off. This prevents the power of
the CD4093 from being a diode drop lower than the Vin when power is
off. Although this is a lot less than the Vth of the MOSFET, I would
still expect less leakage like this.

This saves the schottky diode in my suggested version.
 
J

Joerg

Jan 1, 1970
0
Spehro said:
I think it's non-trivial. The micro will do undefined things as its
supply voltage drops, and there are protection diode networks that can
come into play. 8051s have those awful pseudo-bidirectional ports
(sometimes).

The easiest solution, assuming a modern CMOS micro with sleep mode and
"wake on port pin change" or "wake on interrupt" function is to power
the micro continuously and shut down the internal clock oscillator.
Usually you can leave port pins and so on in such a state as to draw
microamps or better during sleep. There are potential safety issues
with this approach, and you might need to hide a "hard" reset switch
somewhere.

You can do it with a 8051 CMOS version, I've done it. Still in
production. This one has to stomach intermittent power at the end of a
long line. During analog processing it's also sent to sleep via PCON for
radio silence, then something tugs on a port pin when it is needed for
processing. Works like a champ. Best of all these things are 2nd sourced
and you can always find local guys wielding a Keil Compiler.

In general I would not trust any RC reset scheme, whether they mention
it in the datasheet or not. If in doubt roll your own.
 
R

Rich Grise

Jan 1, 1970
0
What he said. :) Seems to me that most modern parts should have sleep
modes that draw negligible amounts of current, yet can wake up instantly
on an input pin state change. IOW, use a PIC. ;-)

We've got a new rule - no "Use a PIC" posts allowed without a schematic
and full code listing. ;-)

Cheers!
Rich
 
R

Rich Grise

Jan 1, 1970
0
This is general enough to be of use to several folks.

Anybody got a simple momentary keypad-switchable ON-OFF circuit for a
8051 (or similar)?
Figure about 100 mA MAX, and will be battery operated (9-Volt).

Program will run for a minute or so, then the device should shutdown
(under uPC control) until the next time it's needed. Probably do this
about 20 times a day. Battery lifetime is important.

MINIMUM cost, and minimum parts count would be nice too! :)

The only thing I can think of is a FET controlling the input to a switch
mode power supply / regulator. (But admittedly, I don't do much
battery-only stuff, and my solar design are higher current and not
easily adaptable for low cost.)

If your uP has a decent "sleep" mode, you could do it with one
button. You'd need to blank the LCD, or just shut down power to
the peripherals.

Cheers!
Rich
 
M

Martin Griffith

Jan 1, 1970
0
We've got a new rule - no "Use a PIC" posts allowed without a schematic
and full code listing. ;-)

Cheers!
Rich
Nah, Speed up your PIC, by downgrading to an 8048,


martin
 
P

petrus bitbyter

Jan 1, 1970
0
"MooseFET" <[email protected]> schreef in bericht
On Dec 29, 12:08 pm, "petrus bitbyter"
[....]

I think you wanted a PNP as the pass device. As drawn it doesn't
work.
(org. drawing)
I don't like the idea of a processor switching itself off, but the
principle
looks not too difficult. The circuit below can be considered standard.

+9V----+--------- ------------
| \ ^
| ---
| ___ |
+---|___|--+
| ___ |
+---|___|--)----+
| |
| o |
| |=|
| o |
| | to
\| | ___ processor
|--+-|___|-- pin
<|
|
|
GND--------------+-------------


I also think you may need a pull up on the processor pin. The 8051s
don't pull up very well.
Modified:
+9V----+--------- ------------
| V /
| ---
| ___ |
+---|___|--+
| ___ |
+---|___|--)----+
| |
| o |
| |=| Vcc
| o | !
| | [R] to
\| | ___ ! processor
|--+-|___|--+--- pin
<|
|
|
GND--------------+-------------
created by Andy´s ASCII-Circuit v1.24.140803 Betawww.tech-chat.de

Problems may arise when the switch is pressed too short so you will need
some additional circuitry. Starting a micro is always surrounded by
unwanted
side effects anyway. I'd make the processor switch off all components but
itself by a circuit like the one above and then go to sleep. This way the
micro keeps control.

petrus bitbyter

You're right.

petrus bitbyter
 
Top