I've currently got a project that requires the detection of a motor connection to my system.
Basically I've got this setup 'Arduino -> motor controller -> very small dc motor', but I need to be able to detect when the motor is plugged in and I'm not exactly sure how I could go about this.
I was considering maybe trying to detect a resistance change in the circuit between the controller and motor but not entirely sure on how to do this without things going awery when the motor is actually turned on? Or maybe attempting to pulse the motor and measure current but I don't want the motor to move when attempting to detect its connection or drain too much battery from constant testing (every 1 second or so).
If anyone has any ideas or can point me in the right direction for more research, that would be appreciated!
What I have done in the pass but with larger motors was put a pull down resistor on the pin, then when the motor was connected it would pull the pin up. You will have to properly protect the input pin. You will have to turn the motor off to test it.
Ah ok so similar to this? Where instead of the switch, it's the motor? Am I correct in thinking this will require a very short pulse from the motor driver to bring the input high and sense it? And will also need something to decrease the voltage from the motors 7.4v (or 11.1v) to the 5v range arduino can accept on inputs?
Basically the system goes something like this:
-Motor is allowed to be turned on x times (tracked in software via a pushswitch).
-Motor "disabled" after x presses and can only be turned back on after the following occurs
-Detect: motor is connected-> detect motor is disconnected ->detect motor is connected.
Repeat
For reference, motor connection and setup looks like this (but can easily be changed to suit this use case)
At this point your system keeps changing. I do not think the other want to keep chasing a moving target, I do not. Spend some time with the many tutorials available and learn about pull up and pull down circuits. Without a proper schematic with posts to the technical links for each piece of hardware I cannot offer anymore help.
@gilshultz Where did the system change? I simply added some further details which as far as I can tell doesn't change my initial objective of detecting when a motor is plugged in.
I think you mistook what I was asking, which was general direction or ideas. Which I have roughly gotten, so I'll keep looking into it.