Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help with a monostable timer circuit

Status
Not open for further replies.

joshsstuff

New Member
Hello!
I replaced the lithium polymer battery in my small covert surveillance camera with an AC to DC power supply to increase it's run time. I would like it to turn on/off when powered by an outside light switch.

Please bear with me, as I'm just starting in electronics. I'm trying to make this project an educational one, so far it has been just that.

I really appreciate any advice you can give.

Camera behavior:
1) can be set to turn on and activate when motion is detected when power is applied.
2) requires that the voltage reach it's minimum ~3.4 volts fairly quickly on start-up, otherwise it becomes a "zombie" and will not function until the next power cycle.
3) Camera saves video files to a flash card at the END of recording, so if power is cut abruptly, the recording does not finalize and video file is lost.

Overcoming the 'sudden power loss' problem
I'm using a 'super capacitor' bank (5Farad) to extend the run time of the camera once power is removed. This is sufficient to bring the camera voltage down slow enough for the recording to safely close . . . However . . . .

Capacitor charging issue
Unfortunately the 'ramp up' voltage of charging the capacitor & starting the camera together is too slow for the camera.
The result is the camera goes into "zombie mode" and will not function (see cam behavior #2)

Solution #1:
diode/resistor solution
I used a diode & resistor to 'choke' the charge rate of the cap enough to allow the cam to start ok.
The diode allows the full voltage to be delivered back to the cam when the power is cut, but forces a slower charge to the capacitor.

results:
-I can get this to work with a ~4ohm resistor, however it requires 1-2 minutes for the capacitor to charge before it's strong enough to safely shut down the cam.
- worse though, after the file safely closes the camera continues to partially function on the lower voltages as the cap drains. This can last from 5 to 10 min in which time the camera cannot re-start (or it will enter 'zombie mode') :-(

Solution #2:
Timer delayed start
I am currently attempting to delay the start of the camera, giving the capacitor time to sufficiently charge.

This is the best diagram I could find with a 555 timer to envoke it's Monostable 'one shot' function to delay the start of the camera.
10102-one shot diagram.jpg


555 Problem:
The circuit works but the problem is that the camera will not accept voltage from the timer, when I try to power the camera from the 555 output it simply will not power on.
The voltage reads 4v @ the camera, but no dice.

-Could this be because of the output pulse of the 555?

- Might I utilize transistors to switch the camera instead of directly from the timer?

I have a general idea for this problem, I will draw up a rough diagram and post it next.

Thanks again for any advice you can give me in putting this circuit together!
Please tell me if I left out any important details.
 
I drew a rough diagram:

"T" = timer
"R" = a component to conduct power when activated by the timer only. (Depletion mode transistor?)
"X" = Needs to conduct all the time EXCEPT when "R" or "T" have power.

10103-cam power diagram.jpg


So basically:
1) when the power turns "on" it will remove "X" from the circuit and start the timer.
2) The timer will delay the camera until the Capacitor charges enough to safely shut down.
3) When power is cut, "T" & "R" will drop out leaving "X" to supply power to the Camera from the capacitor until it shuts down safely.

Possible problems:

The Capacitor cannot be allowed to power the Timer when power is "off".
Does this look like it's a problem in this diagram?
If so, can I use a type of transistor to remove power when it's lower than what the "on" condition would provide?

Thank You for your help
 
Moderator:
Can you please change the thread title.
I wanted to simplify it to:
"Help with a monostable timer circuit"

Thanks

Done

Regards Bryan1
 
Last edited by a moderator:
I'm not sure i understand what is going on so let me ask a couple of questions:
Does the camera have an on off switch?
If so i think you might have better luck leaving the power on all the time and turning the camera on and off with your external goodies by interupting the normal on off switch. The camera may have some circuits to allow it to finish up as the voltage is falling but this may be different than what it does just pulling the batteries out or letting them go dead.
 
Does the camera have an on off switch?
Yes, but turning it off has the same effect as disconnecting power, it also has a "mode" switch (motion activated/ or 'normal')
Reversing this switch during a recording is the only way to save a video in progress. (this would also need to be switched back to go back into 'motion detection')

If so i think you might have better luck leaving the power on all the time and turning the camera on and off with your external goodies by interupting the normal on off switch.

Good question:

1) in some places I only have access to a light switch that is prone to cycling.

2)The camera has limited storage, so the advantage of powering it on with 120v AC is that it will only record when an area or room is lit (e.g. tied into a light switch)

Another "Camera Behavior" I should mention:​

3)The motion detection is not perfect, (uses 'shadow mode' not infra-red detection) it is reliable to turn on with motion is sensed, however it's a little too sensitive and thus prone to 'false positives' = it waists valuable storage if it's run continuously

The camera may have some circuits to allow it to finish up as the voltage is falling but this may be different than what it does just pulling the batteries out or letting them go dead.
Yes, although these are ineffective to a rapid power disconnect (i.e. turning the power switch "off" or disconnecting power)
I am taking advantage of the internal circuitry that auto-shuts down the recording & camera when a "low battery" situation is simulated.

I tried charging batteries before, they are problematic when cycling the circuit On and Off in a short time. Capacitors have much more predictive charge/discharge attributes and a much longer duty cycle.
(I expect the supply circuit to cycle often, and I don't need it to record when the supply is off)

Thank you for your reply ronv!

P.S. if anyone knows how to change the thread title, can you do me a favor by PMing me? Thanks!
 
I think I got it. Seems like there may be two ways to go:
Continue to use the batteries and charge them when power is on.
When power is turned on, turn the on off switch on and switch to motion detect mode.
When power is turned off switch back to normal mode and allow some time to close the frame (this will probably happen quicker than the battery low method)
After the frame is closed turn the camera off.
This requires that you break into the switches.

The other way is the direction you are going.
Delay turning on the camera untill tha cap is charged high enough (battery voltage)
Allow the battery low to close the frame when power is removed.
Need to determine at what voltage the frame is saved and then turn the camera off.
I think this can be done fairly easily by detecting the voltage across the big cap.
You didn't say the voltage from the power supply other than > 3.4 volts. This would determine how long it would take to charge the cap.
I'll try to put something together for the second option since it is least invasive.
 
Camera switch

Here is one that might work.
When the 5 volt power supply comes on it takes about 30 seconds to charge the cap up to 3.8 volts. You can make this faster if you make the 4 ohm resistor smaller and the power supply can provide more than 1 amp. At 3.8 volts the power gets supplied to the camera. Maximum voltage about 4.5 volts to the camera. When the switch is turned off it takes about 30 seconds for the cap to discharge to 3.4 volts. This all assumes the camera draws about 200 ma. This leaves about 20 seconds for the camera to save the image before it gets shut off.
 

Attachments

  • camera.PNG
    camera.PNG
    52.1 KB · Views: 457
Daft reply

Thank You for your reply and diagram ronv (Ron?)

This requires that you break into the switches.

I'll try to put something together for the second option since it is least invasive.
yeah, that was my thoughts exactly. The low batt shut down actually occurs fast enough to warrant this approach.

Allow the battery low to close the frame when power is removed.

Need to determine at what voltage the frame is saved and then turn the camera off.
I made a video of the camera testing with my DMM in view (I can post it if you think it would be helpful)
Here are the results:
"low voltage shut off" occurs @ 3.1 volts (much lower than the required start up voltage)

More detail as to camera behavior​
Start - up voltage requirements are a little more complex. When I was using a diode + resistor (choking the Capacitor bank) to start the 1st starting light (for cam standby) started showing @ 2.2 - 2.7 volts.
The camera is 'ok' with the lower voltage to start 'booting up' however in the last of the 5-8 seconds of this boot the voltage MUST be @ 3.4-3.5v to avoid a "zombie" state.

What this means is:
I think I can 'cheat' the required charge time so long as the required 3.5 volts is reached at the critical part of the 'boot up'
(I will experiment to find this tolerance)

You didn't say the voltage from the power supply other than > 3.4 volts. This would determine how long it would take to charge the cap.

The circuit includes a LM337 variable voltage regulator. I've been playing with the output voltages, and I have decided on 4.5v (considering it's the most I want to expose the camera too)

When the 5 volt power supply comes on it takes about 30 seconds to charge the cap up to 3.8 volts. . . . At 3.8 volts the power gets supplied to the camera. Maximum voltage about 4.5 volts to the camera.

Testing results:
With just the power supply & regulator (no camera) I can charge the Capacitors to 3.8 volts in ~20 sec. ("large Capacitor" = 2 super cap 2.7v @10Farad in series)

A note on super capacitors used:​
A = 2.5v 4.7F Dynacap (has a +80% voltage tolerance, tests fine with 4.5v)
B = 2X 2.7v 10F Powerburst (only 20% + volt tolerance)
C = 5.5v 0.33F
D = 5.5v 1.0F

None of the 5.5 volt Caps (C & D) will hold a charge long enough to safely bring the camera down.
I don't know why that is, even when I parallel them to the equivalent Farad values of the 4.7F or pair of 10F (in series or 5F)
? maybe something to do with their impedance values?

I thought I might be able to use smaller capacitors, that would chage/ discharge faster but "A" and "B" are the only ones that will work
**broken link removed**

When the switch is turned off it takes about 30 seconds for the cap to discharge to 3.4 volts. This all assumes the camera draws about 200 ma. This leaves about 20 seconds for the camera to save the image before it gets shut off.

ronv, you really came close with your current guesses!
The camera draws 150mA in "standby" and 180mA when recording.

The camera will save video in < 1 second once the voltage drops below 3.1v, but it takes a good 40 seconds to get there.
This is not a problem, because if the power is resumed during this time, the camera will function as normal.
The problem is from 3.1v to ~ < 0.8V there are still parts of the camera functioning.

This period is long, >6 minutes in which time the camera cannot be restarted.
For this reason, there has to be a way to cut power to the camera at some point after the video saves.

@ Diagram

I mentioned in my original post that I'm a beginner, this is actually just my 3rd circuit!
If I had all of the components you used, I could build the circuit. However I am missing some of the identification of the components you used.
If you can help me identify them I can acquire them and it will let me do the needed research to be on the same page with you in this project.

I installed LTspice and started playing with it a little, but I haven't found all of the components you used.

Sorry for the novice questions:

-U1 LM393A = Low power dual voltage comparator
This component appears to be the heart of this circuit, thus doing the switching based on voltage.
I'll have to do some research to fully understand how this works.

-D1 1N5817 (SCHOTTKY BARRIER RECTIFIER )
Can you briefly explain how this is being used in the circuit?

-M1 NTD4858 (Power Mosfet - Single N-Channel, DPAK)
I ordered some transistors to start building with.
Is this being used to do the switching to the camera when signaled from U1?

-U2 TL431 (it looks like a zener diode?) I'm guessing it's more likely to be a "Programmable Shunt Regulator"


If you know of a good reference article that will help me get up to speed on this project I will gladly research it.

Thanks again for your help!
 
Last edited:
Flow Chart

Ok, I've got some of my answers to how your circuit works ronv.
I'm still working on the full understanding, so I can't say for certain if the circuit will have the desired behavior.
Picky camera behavior​
There is one other problem with the camera that occurs AFTER it has safely shut down.
The capacitor must drop somewhere < 0.8V in order to restart normally on the next power up cycle. (This takes > 10 min with a fully charged Cap!)

To avoid this the Camera must cycle "OFF" at some point. ( to reset)
I believe you have this functionality built in with "M1" MOSFET.

The following flow chart may let you know of any other adjustments that might be needed before I figure out all of the details of your drawing:
10152-camera circuit flow chart.jpg


I would like to throw out an Idea I had on the timer end as well.
I know that it's not hooked up properly, and will not function as drawn, but can you tell me if the concept is viable?
10153-timer circuit candidate.jpg


PJF = a depletion mode transistor (should disrupt power from CAP to the CAM when power is "ON"
[the base/gate probably needs a resistor . . . ?]

D1 = prevents the timer from being back-fed by any residual capacitor current

U2 = represents a timer, (ignore the model #)
[I may need to use a transistor in conjunction with it to switch the camera instead of the way it's drawn here]

D2 = Is this diode needed?

I'm back to analyzing your circuit again and doing more research.
Any input would be appreciated.

Thanks
 
Last edited:
Hi Josh,
I'm away from home on vacation but let me describe the circuit. It sounds like it will work.
Your right the TL431 is a voltage reference. It sets the voltage at the - terminal of the 339 at 2.5 volts. This is the voltage the 339 will compare the + pin to.
The - side of the 339 "looks at" the capacitor voltage. When it is above3.8 volts it turns the camera on thru the FET in the ground path. The fet has very little voltage drop so the camera shouldn't know it's there. When you shut the power off the voltage across the cap begins to fall and when it gets 3.1 volts the camera saves the frame. A little while later when the voltage gets to about 2.8 volts the fet will turn off taking all the voltage off the camera for a clean turn off. If power is restored the circuit will wait for the caps to be charged back up to 3.8 volts before it turns on again. This should solve your "zombie" problem. The diode is there just to keep the cap from discharging backwards trhu the power supply and to drop .5 volts from the 5 volt supply so the camera doesn't see to much voltage. The 4 ohm is just to limit the current to charge the cap. R3 is a "pull up" resistor because the 339 has no way to provide the positive voltage needed to turn on the fet. R5, R6, and R8 form a voltage divider to get the capacitor voltage down to the reference voltage and to set the high and low turn on and off voltage. I will look at your circuit some more to see if I can understand it.
 
The hole that we may have with the comparator is between the battery low voltage and the 2.8 volts where the circuit shuts the camera off. If I understand you correctly if the power comes back on in that hole it may hang.
Seems like the timer will work - Just need to trigger it with the power supply turning on and make the time long enough for the caps to charge. The thing that may be difficult here is that the power supply voltage will also take quite a while to fall so there may still be a hole after it saves. The voltage after where it saves the frame and where it hangs if re-powered is the key to success in both cases. The problem we have is we don't know exactly when the camera has saved.
 
Power cycle Panacea

Hello Ron,
A video = 1Kwords²
This might help explain the picky camera behavior.
A little while later when the voltage gets to about 2.8 volts the fet will turn off taking all the voltage off the camera for a clean turn off. If power is restored the circuit will wait for the caps to be charged back up to 3.8 volts before it turns on again. This should solve your "zombie" problem.
Power cycle Panacea
It appears that a power cycle will solve this problem.
True, if the voltage is stagnate @ ~3-3.4 volts this can cause a problem, but as long as the voltage increases normally, it will make it safe to 3.5-3.6 volts to the satisfaction of the camera
Both the timer circuit and the comparator versions should overcome this issue by their nature.

When the capacitors allow the cam to shut down, the voltage is taken below 3volts almost immediately after the file is saved.
(not that it matters though, because I let the cam sit overnight and the ~10 milivolts remaining did not allow the camera to power up normally without first being power cycled)

It seems that if the 1st step in the cycle disconnects the cam (power cycling it) it will be able to function once the voltage/time has been satisfied.

The diode is there just to keep the cap from discharging backwards trhu the power supply and to drop .5 volts from the 5 volt supply so the camera doesn't see to much voltage.

Good Idea. I noticed this issue in my circuit.

Are you speaking of the -D1 1N5817 (SCHOTTKY BARRIER RECTIFIER )? ? ?

I decided to take your advice on this in my resistor circuit but the camera did not like it!
It seems to be squelching the power some how and will not allow the camera to function normally.
I used a px1n4001 (can't seem to find a datasheet on it)
That's probably why I should use the same component you did huh?

My circuit has been running on 4.5 volts from the regulator.
I can up it to 5v to fit your design if need be.

The hole that we may have with the comparator is between the battery low voltage and the 2.8 volts where the circuit shuts the camera off. If I understand you correctly if the power comes back on in that hole it may hang.
I believe a power cycle at the beginning will clear this.

Seems like the timer will work - Just need to trigger it with the power supply turning on and make the time long enough for the caps to charge.
I put together a 555 monostable "one shot" circuit (designed for a relay) the timer worked but I think I need a transistor to switch the cam like you did because the cam didn't work (even with the proper voltage)

The thing that may be difficult here is that the power supply voltage will also take quite a while to fall so there may still be a hole after it saves. The voltage after where it saves the frame and where it hangs if re-powered is the key to success in both cases.

I think the power cycle will solve this in both cases.

The problem we have is we don't know exactly when the camera has saved.

~3.16volts
It saves Very fast once the voltage criteria are met (prob < .25 sec)

I'm away from home on vacation
Hope you are enjoying your vacation if your still there!
Thanks for the help Ron.
 
Last edited by a moderator:
Hi Josh,

The 1N4001 should work there is just a little more voltage drop across it that the 1N5817 so if you are still using 4.5 volts as the power supply you would only see about 3.8 at the camera. Maybe not enough?
Good to know that the reset fixes it.
The problem with the timer firing on power up is that the power supply voltage has to get very low for it to trigger again.
 
The 1N4001 should work there is just a little more voltage drop across it that the 1N5817 so if you are still using 4.5 volts as the power supply you would only see about 3.8 at the camera. Maybe not enough?

The "good news"​

Ok, I gave the circuit another test with the diode on the negative and this time it worked ??
I'm not sure what I was doing wrong before but with the diode in place the cam voltage did take a .7v hit but on the Cap discharge cycle, however this payed dividends by protecting leakage to the Power Supply resulting in 2X longer sustainable voltage ! (>3.1v)

So I started playing around a bit with simulated early voltage removal to the circuit and found that I can get away with powering on the cam as soon as 3.5V and still have sufficient safe shutdown power!

The problem with the timer firing on power up is that the power supply voltage has to get very low for it to trigger again.

I'm not sure what you mean by that Ron?
Do you mean residual voltage from the power supply?
I though I took care of any residual voltage when I placed the diode in the circuit?

Residual voltage testing on the power supply
I did some testing on the residual voltage:
-With the capacitor leakage contained with the diode, the voltage reached "0" in <10 seconds.
(the majority of the time it was < 1volt, so I would expect the timer to loose power <10 sec)
- Is this the "Hole" your speaking of?

OR . . .

You did get me to re-examine my circiut, it seems that I placed the depletion mode transistor in the wrong place!

-The way it was before it would not charge the capacitor.
- I also added a transistor to handle the camera switching:

10177-timer circuit candidate 2.jpg


The "Bad News"​

residual voltage: an issue with capacitor input?
Now that you have me thinking about residual voltage from the supply I do see one problem with the circuit:

Will J1 be able to switch back fast enough to allow the camera to use the capacitor after power is "off" but before the supply quits leaking?

- will R1 help this 'problem'?
- might this be an issue with the comparator circuit as well?

It sounds like you have used your comparator circuit for other applications.
If so, was this ever a problem?
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top