Searching \ for '[EE] Debounced power supply?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/power/actodc.htm?key=power
Search entire site for: 'Debounced power supply?'.

Exact match. Not showing close matches.
PICList Thread
'[EE] Debounced power supply?'
2006\10\25@092138 by Rolf

face picon face
part 0 44 bytes
his is a multi-part message in MIME format.
part 1 3461 bytes content-type:text/plain; charset=ISO-8859-1; format=flowed (decoded 7bit)

Hi all.

I am (slowly) learning this electronics thing, but before I build a
circuit, I want to run a "debounced" power supply past people who know more.

The application is a wireless remote control for a camera system. The
control will transmit a start bit, and 8 data bits using manchester
encoding over a 418MHz wireless link. I have the firmware working, and a
working prototype circuit built in a breadboard. The core component is a
PIC10f206. The intention is to run the system from a 3V lithium coin
cell. I intended to put a momentary switch on the +3V line as the
trigger for the remote. When power is applied, the 10F enables the TX,
waits 1ms for it to settle, then transmits the data at 10kbaud. it then
powers down the TX, and goes to sleep. The entire "awake time" is less
than 3ms.

Unfortunately the switch bounces, and I sometimes get garbled
transmissions to the RX.

I figured I could solve the problem by putting together a "bounce-proof"
switch. I have attached a schematic.

Using a P-Channel high-side switch, with the gate connected to the +3V
via a parallel R and C. The momentary switch is connected between the
gate and ground. The idea is that with the switch open, the resistor
will bring the cap to equilibrium at +Vcc, thus putting 0Vgs on the
gate, and switching off the p-channel mosfet. There will be no current
drain from the battery then because of the high impedance of the mosfet.

When the switch closes, it "discharges" the cap (effectively)
instantaneously, bringing the gate to -3V relative to the source, and
causing the mosfet to conduct. It will conduct until the switch
re-opens, as well as the time it takes for the cap to recharge to above
the Vth of the mosfet. The "recharge" time will be proportional to the
resistor, and cap.

I figure I need the mosfet to conduct for 10ms at least. Once the PIC
goes to sleep I have measured that it consumes about 25uA, so I am happy
to let it just sit there since I will have about 7000 hours of battery
life at that level... ;-) All the mosfet needs to do is to conduct
through the bounces.

My math indicates that with a 3V supply, and a -2V Vth on the mosfet,
and that an RC time constant is for about 2/3 charge of the cap, and I
need 1/3 charge to cut-off, that the RC constant should be about 20ms
for the RC. Using a 1MOhm resistor (to reduce current draw when the
switch is closed to 3uA), I need a cap of about 20pF.

The questions I have are:
1) will this system work reliably (it appears to work at 5V in my
breadboard now)?
2) 20pF seems real small, I am thinking I should allow more current to
flow, and use a larger cap, but this will have (small) implications on
battery life. Perhaps I should go with 100K and 0.2uF, allowing 30uA
current to ground if the switch is held closed (remeber, this is going
to be jammed in a camera bag somewhere, and could potentially be held
closed for a long time...).
3) Although I can find a number of SMT p-chan mosfets that have a max
Vth of -2V, I can't seem to find parts that are Thru-home (can put in to
breadboard...). At worst case I will just solder some leads right on to
a DOT-23 package or something, but perhaps someone knows where I can
find a -2Vth p-mosfet that is readily available (digikey hopefully) in a
t-hole package.

Thanks in advance for any insights/criticisms.

Rolf



part 2 4104 bytes content-type:image/gif; (decode)


part 3 35 bytes content-type:text/plain; charset="us-ascii"
(decoded 7bit)

2006\10\25@105554 by Mike Hord

picon face
Is there a reason software debouncing won't work?

You should be able to edge trigger when the button
is pressed and then ignore it for a while thereafter.
Compared to the bounce time, even rapid pressing
of a button will be easily detected.

Mike H.

On 10/25/06, Rolf <spam_OUTlearrTakeThisOuTspamrogers.com> wrote:
{Quote hidden}

> -

2006\10\25@115924 by Bob Axtell

face picon face
What I have used is those SOT23-8 one-shots at $0.22 USD a pop from
fairchild. Set the length
of the O/S to 10mS, and program the PIC10F to go to sleep when it is
done, to save power.

The Q output of the O/S powers the PIC10F.  The current needed for these
devices is very, very low.
They operate at 2V just fine.

I must ask you another question... I have rejected the PIC10s because
they have no BROWNOUT
detect, which I think is important for key tasks like this. Do they
startup reliably?

--Bob


Rolf wrote:
{Quote hidden}

2006\10\25@205744 by Rolf

face picon face
I guess, having done the calculations on sleep current draw, I could
just stop worrying about switching the power, and instead use a
wake-from-sleep GPIO change...

Hmmm. should be ridiculously low power consumption if I get it right
(<1uA). Yup, it seems to work just fine, and far fewer parts. Code does
need to cater for bouncing switch-off though (not just switch on),
otherwise the chip will activate when the button is pressed, and when
released (even if you check the button state when reset).

Had to re-read the datasheet *again*, but now got sleep power reading
0.00uA on my DMM (probably not precise enough at this level). You really
do need to tie all pins to GND in sleep otherwise current can fluctuate
all over the place from 50uA to 300uA in sleep.

Thanks for the suggestion, and it appears to be a good solution.

Rolf

Mike Hord wrote:
{Quote hidden}

>> --

2006\10\25@210839 by Rolf

face picon face
Start-up is fine. There is an automatic start-up delay of about 18ms
*always* (basically a Power on timeout - called the Device Reset Timer
in the spec).

This timer starts *after* MCLR goes high. It should be enough for a
clean startup, and my (limited) experience indicates it is fine.

In re-jigging my TX to use a wake-on-change mechanism as a trigger, it
is even better, because the device is never powered off, and the DRT is
set to 10us instead of 18ms on reset.
(Remember, the 10F parts do a reset on pin change during sleep, they do
not continue from the instruction after the sleep).

Thanks for the suggestion for the one-shot though. Given the very low
power drain of the 10F in sleep though, it seems silly to even power it
off. The 10F drain is less than the battery self-discharge.

Rolf

Bob Axtell wrote:
{Quote hidden}

2006\10\25@211001 by Shawn Wilton

picon face
Google ganssle and debounce for a great debounce article.


On 10/25/06, Rolf <learrspamKILLspamrogers.com> wrote:
{Quote hidden}

2006\10\25@214347 by Rolf

face picon face
Hi Shawn.

Thanks, I have already implemented that debouce routine in other projects.

I am (was) trying to debounce Vcc, +3V, The input power switch. Not just
an input pin. It is hard to debounce in software when the PIC is not yet
running... ;-)

Thanks

Rolf

Shawn Wilton wrote:
> Google ganssle and debounce for a great debounce article.
>
>  

2006\10\25@214347 by Rolf

face picon face
Hi Shawn.

Thanks, I have already implemented that debouce routine in other projects.

I am (was) trying to debounce Vcc, +3V, The input power switch. Not just
an input pin. It is hard to debounce in software when the PIC is not yet
running... ;-)

Thanks

Rolf

Shawn Wilton wrote:
> Google ganssle and debounce for a great debounce article.
>
>  

2006\10\26@000936 by Shawn Wilton

picon face
I know.  I only made mention of it since you said you had decided to change
your approach from toggling the power to just debouncing the pin.  :-)



On 10/25/06, Rolf <EraseMElearrspam_OUTspamTakeThisOuTrogers.com> wrote:
{Quote hidden}

> -

More... (looser matching)
- Last day of these posts
- In 2006 , 2007 only
- Today
- New search...