Go Down

Topic: How do I make a Dc motor controlled by photo resistors?  (Read 784 times) previous topic - next topic

sheepleapin

No.  The plus (red?) motor lead connects to the positive motor supply lead (6V).  Don't power the motor with the Arduino 5V.  The minus lead (black?) connects to the collector of the transistor.  The emmitter of the transistor connects to the ground of the motor supply.  And the Ground of the motor supply also must connect to Arduino's ground.  Pin 9 connects to the base resistor.
btw i did exactly what you tell me to, and it work perfectly but when i unplug the usb cable it keeps just keeps running but doesnt work when i shine on the photo resistor it does not gives more volt to the motor, but as i plugged back the arduino and shine on it, it gives speed and it changes volt

groundFungus

You have to reverse the polarity of the power to the motor to reverse the motor.  I know of no way to do that with a single switch.  

Earlier you mentioned a L298 H bridge.  I did not say that you could not use it, just that there are better alternatives.   Do you have or can you get a L298 (or L293) driver?

There is a way to do what you want with relays.  You can replace the transistor with a relay H bridge. You will need a SPST relay, a DPDT relay, 2 transistors and 2 diodes.  Google "relay H bridge" to see how it is done.


sheepleapin


sheepleapin

Do you have or can you get a L298 (or L293) driver?




what if i can get a L293 driver, can you help me out with the details for the reverse, i will go to the city to get this, i felt like there is , i havent check this out

groundFungus


sheepleapin

awesome , so this can be use even photo resistor and motor can be worked togteher

Go Up