Electronic – ON/OFF safe implementation

designswitches

I would like to know what you think about this. Here's a diagram presenting the main modules of the project. Red is 9V unregulated, green is 5V regulated, black is 5V logic exchanges.

enter image description here

I want to turn on/off the circuit. For the moment I'm considering :

  • Switch between the 9V DC source and the 9V rail.
  • Put the µC on a separated 5V rail and isolate the 9V input of the DC Motor driver, keep the microcontroller on standby and implement a soft switch, when pressed he will turn on a transistor and power on the 9V rail of the motor driver and the 5V rail for the other modules.

I prefer the first one as the circuit is already pretty much finished (yeah, I forgot the basic "on/off" functionality…) and the first solution don't require too much changes. One of my question is do I need to do something special to make it safe or can I just put the switch in series between 9VDC and 9V Rail ?

The second question is, do you have any other ideas, not to hard to implement ?

NOTE : I'm more looking for design patterns (not sure if you have something similar in EE) than specific implementation, that's why I've posted the simplified module diagram of the circuit.

Best Answer

If this is a battery-powered device then you're probably best putting a hard power switch between the 9V source and the rail to prevent leakage. This isn't an absolute fix - the battery will still have self-discharge and it prevents any standby operation for your uC. Ultimately it does depend on your application.

If you need standby operation then you either have to let the 9V source remain connected and active while the uC is in low power mode, or if your power usage is low enough you can put a huge capacitor on the power lines for the uC as a pseudo-battery backup. You'll probably want a diode to prevent the capacitor from discharging into the rest of the 5V rail in that situation. It also depends on what components the uC will need to have access to while in standby - can the IR sensor wake it up? It would need to be powered.

Also, it seems somewhat dangerous to include lightning in your circuit :)

Related Topic