A way to determine if motor controller is powered

This setup is really simple and should not require a drawing or specific parts.

I have a standard dual H motor controller that will be powered by its own 12V battery. There will be a toggle switch to turn 12 Volt power on and off to the motor controller. This switch is independent of the PWM and control lines from the Arduino controller.
I want my software to be able to determine if the motor controller is powered or not. In other words, I want to be able to tell if that switch is open or closed. Any ideas? The only thing I have come up with is a double pole-double throw switch. Half wired to 12 Volts and the Motor controller, and the other half with a pull-up resistor wired to a digital IO pin... Any other ideas or did I just answer my own question? :slight_smile:
DPDT switch

+12V +5V
| |
| |
switch \
\
| |------------>IO input pin
Motor Ctrlr R1
| |
| |
common ground

Why not just use a SPST switch and sample the 12V on the motor controller side with a voltage divider? Run it to an analog input and you can also get a battery voltage monitor as a bonus.

It has the advantage that it also checks the battery. Yours will indicate power even if the battery is dead.

That is a good idea and why I came here. I do like the added motor battery voltage monitoring ability.
Thanks!
Joe

+1 for monitoring at the motor's high side.

Use a voltage divider, preferably down to about 1V and set your Arduino to use the internal 1.1V reference for added stability.

Do remember: your battery voltage in that case can only be measured when the switch is closed, and it will vary with the load on the motor.