How to connect DC motor to Raspberry Pi?

Click For Summary
The discussion focuses on connecting a standard DC motor from an old DVD drive to a Raspberry Pi. Directly connecting the motor to the Raspberry Pi's power and ground pins is not advisable, as it limits control over speed and direction. Instead, using a motor driver and implementing PWM (Pulse Width Modulation) through a Python script is recommended for better control. It's also emphasized that power for the motor should come from an external source rather than the Raspberry Pi pins to avoid damage. Resources and tutorials are suggested for beginners to learn about Raspberry Pi and motor control.
sur4j
Messages
2
Reaction score
0
I have recently taken apart a few old DVD drives to see if there were any stepper motors available for a Raspberry Pi project I am currently working on. When I opened one of the older drives I found a motor which was unlike the others as it only seemed to have two wires going directly to the coils. Is this a standard DC motor?

If this is a standard DC motor, how would I connect this to the RPi ports? Is there a procedure for this for example, checking coil resistance and then determining resistor sizes required to be in series with the motor or can I just directly connect the red wire to the positive output of the RPi and the black wire to ground?

Please see the following links to images for this:
s46.photobucket.com/user/suraj1793/media/IMG_2365_zps136cb5ba.jpg.html?filters[user]=141636453&filters[recent]=1&sort=1&o=1

s46.photobucket.com/user/suraj1793/media/IMG_2366_zpsaf5ed524.jpg.html?filters[user]=141636453&filters[recent]=1&sort=1&o=0

s46.photobucket.com/user/suraj1793/media/IMG_2364_zpse39a413e.jpg.html?filters[user]=141636453&filters[recent]=1&sort=1&o=2

I am new to working with motors and have very little experience with electronics therefore, would greatly appreciate some help with this. Thanks.
 
Engineering news on Phys.org
Hi sur4j.
snJL9SLm.gif


Have you tried a google search? That is sure to turn up plenty of material for you to examine while you are waiting for someone here who's familiar with what you are planning.

Good luck.
 
First you need to Learn about Raspberry Pi. If you simply connect the DC motor to the RPi's power and GND pin, it will only rotate in one direction at particular speed, and you can't control it, and hence no use of RPi, you can simply do this by connecting DC motor to 9v battery.
But if you want to control its speed and direction then Rpi comes into picture, and it can be easily done by using a Python Script. There are plenty of tutorial on it, I am referring one here, which have a demo Video DC motor with Raspberry Pi. It basically uses PWM and duty cycle concept to control its speed.
But if you are new with Raspberry please go through this officcial raspberry pi Quick start guide where you will learn to install and configure OS on Pi board
 
Last edited:
https://www.adafruit.com/products/2327

above is a dc motor driver for the raspberry pi. it can drive up to 16 motors using pwm.

ALSO

do not every drive power electronics directly off the raspberry pi pins. You should provide the power from a 3/5 V rail created by the external source (even if its the same source powering the pi). Then use a switch (bjt, mosftet, etc) to switch the power supply.

There are likely other shields/hats for the pi that might be able to help you as well.
 
Thread 'I thought it was only Amazon that sold unsafe junk'
I grabbed an under cabinet LED light today at a big box store. Nothing special. 18 inches in length and made to plug several lights together. Here is a pic of the power cord: The drawing on the box led me to believe that it would accept a standard IEC cord which surprised me. But it's a variation of it. I didn't try it, but I would assume you could plug a standard IEC cord into this and have a double male cord AKA suicide cord. And to boot, it's likely going to reverse the hot and...

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
17
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 5 ·
Replies
5
Views
5K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 12 ·
Replies
12
Views
9K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 9 ·
Replies
9
Views
3K