Is there a way to design a circuit that can basically turn itself off? I was thinking a relay that's triggered by a pin to open the connection to the Vin, but when it's turned on, it's like chicken vs egg to get the relay to activate to begin with.
Any thoughts?
Thanks!
Use the power pushbutton from Pololu.
I wanted it to happen automatically, like a self-timer. Basically, I want this to go into a car, and I don't want to drain the car's battery by leaving the project running all the time, it only needs to stay running for 30 minutes after the car has been turned off.
Then you will need some sort of timer in addition to the power switch.
That's what I mean, how can I build a timer circuit that will cut off it's own power source....
Pushbutton power switch and an ATtiny.
Cars usually have a line that is only live when the ignition is on.
Use that line to trigger a relay/transistor.
I think I've figured this out.
Connect a standard relay to the vin on the arduino.
So.30 battery.
87 arduino.
85 ignition live. With a diode fitted. I'll get to this in a moment.
86 earth.
I think..
You then have another ignition live fed to an analogue pin on the arduino.
Set this up to test for voltage. If it drops below 9v, consider the car off.
Another pin connects to pin 85 after the diode. The diode prevents bleadback to the cars main electricals.
This pin is powered from the moment the arduino gets power.
In the software you check the ignition live voltage.
When the ignition live goes off, start your count down.
When you reach zero, cut the power to pin 85 on the relay from the arduino and the arduino should power off.
5v should be enough to hold the relay closed. If it is not, you will need a second relay ( 5v) to feed 12v to the first relay.
I hope that all makes sense?
Jason.
use relay that fails open,
ignition closes relay
arduino also powers relay
called delayed off.
relay coil is powered by car on/off same as radio and such.
always ON 12v goes into N/O of relay. when closed, feeds arduino.
arduino powers coil
tming starts when car on/off goes off.
when arduino drops out relay coil, the coil opens and power is lost to arduino
I thought about it a bit.
need to prevent the 12 from backfeeding the arduino.
one way is to feed the relay with circuits to prevent backfeeding.
I sketched up a simple way to use one FET to control the relay.
key parts are the zenier to prevent any more than 5v from the voltage divider
and the diode to prevent the GPIO from being pulled to ground from the voltage divider.
I accomplished this by energizing relay coil using opto isolator which is connected to arduino GPIO. I then feed Ignition and battery through diode on each line to prevent backfeeding to either circuit and then both anodes of the diodes go to VIN of arduino. The relay Common is connected to vehicle battery and the NO pin is connected to the cathode of the battery feed diode. I have a Ignition sense line on the cathode side of the Ignition diode. The sense line goes through a buck converter to take down ignition to 3v (Arduino Due) which goes to the arduino GPIO. When I detect low voltage on the ignition sense line I run my deintialization routine and open the relay which is at that time supplying battery power to VIN since ignition is off.
Hi. Use the "Old" workhorse NE555. Just Google 555 timer
and you get ~17 million hits. I did. There's tons of solutins for you.