PDA

View Full Version : PIC powered by capacitor for 0,5 second



flotulopex
- 22nd August 2007, 21:27
Hello,
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=1936&stc=1&d=1187813436">

I intend to power a PIC (it's a 16F630 at the moment) throught a switch and detect a "power-OFF / power-ON" sequence.

In other words, when I press the button, the PIC is switched "ON" and a Port (i.e. pin 3) reads a HIGH level. PIC performs Task 1 as long as the power is not cut.

I would like to be able to release the button for half a second to detect the LOW level on the Port and then switch the PIC back ON again to perform Task 2.

If the power-OFF state is longer than 0,5 second, the PIC will normally perform Task 1 when the power comes ON again.

I tried with a 10µ capa and then with a 470µ one but I can't get it working, the PIC switches OFF immediately. The total "load" on the PIC is around 2mA during the time a release the button (= no direct power from the supply). The diode is a 1N4148.

Is what I'm trying to achieve possible that simple way or not? If yes, what should I change or add to my circuit?

Luciano
- 22nd August 2007, 21:51
Post removed. I will post again a new version.

Luciano

flotulopex
- 22nd August 2007, 22:01
Hi Luciano,

Thanks for the very quick reply.

Did you intentionally invert pin1 (Vdd) and pin3?

How is the resistor going to slow-down the discharge into the PIC?

I need to keep the PIC powered ON during 0,5 second even if the switch is open.

Meanwhile, I'll try you suggestion out.

*** Okay. Just saw your last message.

Luciano
- 22nd August 2007, 22:08
What is the used voltage, or what will be the voltage in the final design?

flotulopex
- 22nd August 2007, 22:09
It's a gadget for a car.

I'll use a 7805 to make a clean +5VDC.

Luciano
- 22nd August 2007, 22:48
This is what happens with 1000 μF and a load of 1.62 mA.

http://img515.imageshack.us/img515/5981/picc2bu5.png

Luciano

Ioannis
- 23rd August 2007, 10:13
I suppose that a 4700 is the minimum capacitor to use. There are .5 and 1 Farad capacitors in low voltage now available to power RTC's instead of coin batteries. Why not use one?

Take a look at http://catalog.digikey.com/scripts/partsearch.dll?Detail?name=P6955-ND

Ioannis

P.S. By the way, nice instrument Luciano!

Acetronics2
- 23rd August 2007, 10:59
This is what happens with 1000 μF and a load of 1.62 mA.

http://img515.imageshack.us/img515/5981/picc2bu5.png

Luciano

Hi, Luciano

Nice to see you back here !

mmmmmmh, By the way ....

You gave the PEAK current ... as it decreases with power Voltage.

A JFET could have been a better current drain than the 2.7k.

Were nice holidays, weren't ??? You're not totally back it seems ... LOL !!!

Best Regards
Alain

flotulopex
- 23rd August 2007, 14:45
Hello Alain,

Could you give me some more details about how to connect the transistor and even why this would be a better choice please?

BobEdge
- 23rd August 2007, 15:03
Hi,

If you have not done so already try turning off the brown out detect at the programming stage, this will stop the pic from resetting as the voltage drops. With a 2200uF cap that should work fine

Regards
Bob...

Luciano
- 23rd August 2007, 17:29
Hi Alain,

Thank you for appreciating my midnight engineering!

Best regards,

Luciano

Luciano
- 23rd August 2007, 22:12
Hi Roger,

Try that:

http://img504.imageshack.us/img504/821/picc3lo2.png

Best regards,

Luciano

EDIT: The Brown-out Detect Voltage (BVDD) is 2.025 — 2.175 V.
Try first with the internal Brown-out Detector enabled.

Ioannis
- 24th August 2007, 07:10
Hello,

I intend to power a PIC (it's a 16F630 at the moment) throught a switch and detect a "power-OFF / power-ON" sequence.

In other words, when I press the button, the PIC is switched "ON" and a Port (i.e. pin 3) reads a HIGH level. PIC performs Task 1 as long as the power is not cut.

I would like to be able to release the button for half a second to detect the LOW level on the Port and then switch the PIC back ON again to perform Task 2.

If the power-OFF state is longer than 0,5 second, the PIC will normally perform Task 1 when the power comes ON again.

I tried with a 10µ capa and then with a 470µ one but I can't get it working, the PIC switches OFF immediately. The total "load" on the PIC is around 2mA during the time a release the button (= no direct power from the supply). The diode is a 1N4148.

Is what I'm trying to achieve possible that simple way or not? If yes, what should I change or add to my circuit?

Reading again your post, why is it necessary to power off the PIC???

Just keep powering it normally and just connect the button to any input. Then the program will decide about which task to perform according to Press/No-press state of your button.

Am I missing something?

Ioannis

flotulopex
- 24th August 2007, 07:53
This circuit will control a "stop-light" made of LEDs located in the center of the rear-window of a car.

There are two wires powering the "stop-light". Only 0V is constant and V+ comes when you go on the brakes.

My first idea was to install a third permanent V+ wire but the engineers from RENAULT made things not a simple way and it is almost impossible to do so :(.

Function of the circuit: when I go on the brakes, all LEDs light-up.

If I go on the brakes a second time:
- more than half a second later (> 0,5s), all LEDs will light-up again;
- less than half a second later (< 0,5s - or, if I go a second time on the brakes within half a second), I will activate a function that makes my LEDs scroll.

Ioannis
- 24th August 2007, 08:00
OK. Now is Clear. Well, the 1 Farad is very large capacitor at 5.5Volt. I think is the cheaper and easiest solution.

Only as a precaution, use a small resistor of 100 ohms to charge it, not directly at +5V.

Ioannis

Acetronics2
- 24th August 2007, 08:34
Hi, Roger

Why not, when removing power, enter a BASIC .5 seconds SLEEP command, and then verify if power is still here ???

Think to modify the WDT prescaler ... cause PbP sets it to 128 ( the 2.3 s granularity ! )
See OPTION Reg setting (in PBPIC.xx LIB ... ???)

The capacitor size could be reduced ...

Alain

Luciano
- 24th August 2007, 09:43
This circuit will control a "stop-light" made of LEDs located in the center of the rear-window of a car.

Function of the circuit: when I go on the brakes, all LEDs light-up.

If I go on the brakes a second time:
- more than half a second later (> 0,5s), all LEDs will light-up again;
- less than half a second later (< 0,5s - or, if I go a second time on the brakes within half a second), I will activate a function that makes my LEDs scroll.

Hi Roger,

Not allowed in Switzerland, in case of a car accident you will have a problem.

The police will stop your car immediately and you will have to fix the car and then
go with the car to the "Service des automobile" of the canton where the car is immatriculated.

Best regards,

Luciano

flotulopex
- 24th August 2007, 14:48
I know that...

But what would be the taste of Life if there is no risk?

BTW, with this circuit, I will "harm" myself only.

Thanks anyway for warning.

flotulopex
- 25th August 2007, 09:23
Thank you Luciano!

It works perfectly with a 1000µF according to your schema and BODEN disabled.

Try to show the final result in a few days...