Hi,
I have a raspberry pi (http://www.raspberrypi.org/faqs) and looking to build a little project for it.
I wish to use the input pins to log what is happening with some DC motors.
High for the raspberry input pin is 3.3V and low is 0V.
The DC motors are running off 12V and every so often they get switched on for a few seconds then are off again. Could be off for minutes or hours.
(Think along the lines of a vending machine and I'm trying to log how many times a product is vended)
I'm looking for help on understanding what is the correct way of doing this.
What I would do (which is probably wrong) is put two resistors in the correct ratio across the motor terminals and tap into that to give me my 3.3v. (I don't even know if this would work)
Also when the motor isn't on the pin can't be floating (I know its obvious but i need to state the obvious for myself as I'm new to all this)
Any help is greatly appreciated.
I have a raspberry pi (http://www.raspberrypi.org/faqs) and looking to build a little project for it.
I wish to use the input pins to log what is happening with some DC motors.
High for the raspberry input pin is 3.3V and low is 0V.
The DC motors are running off 12V and every so often they get switched on for a few seconds then are off again. Could be off for minutes or hours.
(Think along the lines of a vending machine and I'm trying to log how many times a product is vended)
I'm looking for help on understanding what is the correct way of doing this.
What I would do (which is probably wrong) is put two resistors in the correct ratio across the motor terminals and tap into that to give me my 3.3v. (I don't even know if this would work)
Also when the motor isn't on the pin can't be floating (I know its obvious but i need to state the obvious for myself as I'm new to all this)
Any help is greatly appreciated.