Go Down

Topic: Terminator servo (Read 1 time) previous topic - next topic

Johan_Ha

#15
Jul 27, 2017, 11:22 am Last Edit: Jul 27, 2017, 11:23 am by Johan_Ha
I wonder if this circuit would work.


The image shows the circuit in off position. The switch only feeds battery voltage to the transistor, which is closed, since Arduino is down, D0 is down. It also feeds voltage to D1 through a resistor, but D1 shouldn't let anything through - someone needs to confirm that.

When switch is turned to ON, the relay is activated and Arduino starts through voltage to Vin. The Arduino program should now raise D0, which will open the transistor, which will keep the relay active. At this point, the relay gets voltage both from the battery and the transistor. That shouldn't be a problem - someone correct me, if needed.

When the switch is turned to OFF, the D0 is still HIGH and keeps the transistor feeding the relay, which keeps the Arduino running. But now D1 has gone high, which tells your Arduino program to shut itself. The program should finish unfinished business, then it needs to put D0 to LOW, which cuts the transistor feed to the relay, which cuts the power to Arduino.

D1 has no external pulldown, so the pin must be set internally to pulldown. An external pulldown thing would have a constant current (fractions of millivolts), when system is down. I have no idea if the internal thing does the same.

This kind of circuit probably needs some capacitors here and there to reduce noise.


____________________

If you ask for help and write 'u' instead of 'you' because you think it's convenient, I will write 'no' instead of 'yes'. For same reasons.

Jamesmurg

Thank you so much for taking the time to do this for me I can't waight to try it problem is I managed to brake my nano and am waightin for a part to fix it

Any way thanks again

Johan_Ha

My image merely shows a principle. As I wrote, it probably needs improvement like some caps. And a flyback diode for the relay coil.
____________________

If you ask for help and write 'u' instead of 'you' because you think it's convenient, I will write 'no' instead of 'yes'. For same reasons.

Go Up