How to connect DC motor to Raspberry Pi?

Click For Summary

Discussion Overview

The discussion revolves around connecting a standard DC motor to a Raspberry Pi, focusing on the appropriate methods for wiring, controlling speed and direction, and the necessary components for safe operation. The scope includes practical applications, technical explanations, and beginner guidance.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant questions whether the motor found in an old DVD drive is a standard DC motor and seeks guidance on connecting it to the Raspberry Pi.
  • Another participant suggests conducting a Google search for additional resources while waiting for community input.
  • A different participant explains that directly connecting the DC motor to the Raspberry Pi's power and ground pins will only allow for one-directional rotation at a fixed speed, which limits the utility of the Raspberry Pi.
  • This participant emphasizes the need for control over speed and direction, recommending the use of a Python script and mentioning the concept of PWM (Pulse Width Modulation) for motor control.
  • Another post provides a link to a DC motor driver that can control multiple motors using PWM and advises against powering electronics directly from the Raspberry Pi pins, suggesting the use of an external power source instead.
  • This participant also mentions the possibility of using switches like BJTs or MOSFETs to manage power supply to the motor.

Areas of Agreement / Disagreement

Participants express differing views on the best approach to connect and control the DC motor. While some emphasize the importance of using external components for safe operation, others focus on the basic connection methods. No consensus is reached regarding the optimal procedure for beginners.

Contextual Notes

Participants highlight the need for understanding PWM and the implications of directly connecting motors to the Raspberry Pi. There are unresolved questions about the specific characteristics of the motor and the best practices for beginners in electronics.

Who May Find This Useful

This discussion may be useful for individuals interested in robotics, electronics, and Raspberry Pi projects, particularly those who are new to working with motors and seeking practical advice on connections and control methods.

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.
 

Similar threads

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