13

The Raspberry Pi requires 5 Volts - if you've fed it 12 Volts you've killed it. Powering the Pi using the GPIO pins bypasses the fuses that might have saved the Pi if you had used the micro USB connector. If smoke came out - you've provided too much power to the Pi somehow. That board appears to be designed for an Arduino which has 5V outputs, the Pi's GPIO ...


6

The problem was that there was no ground between the L298N and the Raspberry Pi. By wiring the Ground (-'ve) terminal on the L298N to a ground pin on the Raspberry (as well as the batteries) it then worked.


4

A GPIO can only supply a little current, perhaps 60mA or so, whereas the 3V3 rail can supply up to 1 amp depending on the Pi model. It is probably not safe to draw more than say 20mA from a GPIO for an extended period (which may be of the order of seconds) as they are not designed for that purpose and you may destroy the GPIO and/or the Pi. It is also ...


3

If you read the documentation, there are two mistakes in your code. First, just use import l293d. Second, use motor1 = l293d.DC(22, 18, 16) There isn't a motor attribute, but there is a DC attribute for DC motors. This runs on my system. jay@gotham:~/python$ python3 test.py [l293d]: Can't import RPi.GPIO; test mode has been enabled: http://l293d.rtfd.io/...


3

The library source code is linked to from the SB Components website, where there is a link: Get the library source code from GitHub This leads you to this GitHub repository, which contains PiMotor.py, which would seem to be the library you want. Simply download that repository, extract the files to the directory of your script, and then running import ...


3

I agree with the answer by CoderMike that you've probably fried your Pi. Based on the wiring diagram though, I differ in thinking that it might have been avoidable with this hardware if you had connected it different. You put 5 V into the shield's logic circuits by connecting the shield's Vin to the 5 V pin on the Pi. That's the orange-ish line near the ...


2

In general things like motor, wav, and lcd shields are designed to fit an Arduino. That does not mean they won't work with other MCU's or SBC's like the Pi. Some of the difference include: usually 5 volt based logic. form factor and pinout to match the arduino (usually an uno or deumilanove - but there are some designed for some of the other Arduino's). ...


2

Both the Pi and an Arduino should be able to handle the decision making. The Pi will be better once the decision making becomes more complicated. The Pi is just as good as an Arduino at controlling motors. Neither the Pi nor an Arduino can control a DC motor directly. They both need the support of external hardware to safely switch the currents involved. ...


2

Your design has some shortcommings There is no direct 5V output the 3v3 probaply isn't strong enaugh to drive a relay so you need a transistor too and a diode to protect the Pi 5v the accumulated cost for the components exceed the price for a ready L298 H-bridge module ($2.5-$3) for which instructions are available


2

the spike caused by motors, drops the controller voltage. in this case (the pi), it will drop to 4.6 v for example, which is enough to cause to to reboot. either use an adapter for rpi, or give it another clean power source. plus, for the same reason DIY quadcopters have separate batteries dedicated for the controller.


2

See https://www.youtube.com/watch?v=rrRg1guojQE This shows (my) pigpio library being used to control a variety of devices. A Raspberry Pi controlling a variety of motors and sensors. The pan-tilt head is moved by a pair of servos. The head holds a sonar ranger and an ADXL345 3-axis accelerometer. The servos control pins are connected directly ...


2

I would suggest to do the testing in 2 steps: (1) Check by hand if jumper wire 5V, Gnd signals can move motor forward and backward. (2) If motor can turn manually, then start writing the python program. I googled and found almost all the L298N modules have the similar input and output terminal connectors. The following is my quick and dirty hardware ...


2

Question Stepper 28byj48 unipolar OK with uln2003 Slit the red wire so there are only two windings Measured ohms across coils. Pin 1 ic - 5v pos ... (OMG, 16 connection pairs!!!) Answer I did the same thing a long while ago. I vaguely remember I performed the following operation converting the stepper from unipolar to bipolar. Open ...


1

"The only thing is that I connected the 3.3V of the L293D on a 5V pin, but I assumed it is not a big deal..." Translation AKA edited as is common on this forum **I am using common power source for all devices ** IT IS A HUGE DEAL ! Electromechanical devices are 1. power hungry 2. when initialized /started they are EXTREMELY power hungry - tech term ...


1

From the pictures, it looks like the chip is upside down. There's a little notch on one end that shows you where the "top" is, while you have it facing away from the top of the breadboard instead of towards it. Fortunately, based on the data sheet for the chip, this actually doesn't matter and it will function exactly the same. That's a surprise. As pointed ...


1

According to documentation page for the l293d Python library, you've used syntax that's incorrect. The docs suggest this may work: import l293d motor1 = l293d.DC(22, 18, 16) then the rest of your code.


1

On another (related) note - I see from the spec sheet that the module's power supply (not the motor supply) should be 6.5-12v... and you're powering it with 4xAA batteries, which is fine when they are fresh, since new, quality batteries output closer to 1.7v (around 6.8v total); but in THEORY, you're running a 6.5v device with a 6v battery pack... Your ...


1

Steppers are typically driven by stepper driver boards such as the TMC2208. Microcontrollers such as Arduino or Raspberry Pi send pulses to the stepper driver boards to turn the stepper motor. I assume you have already acquired a motor hat or such. For smoothness, it is ideal to have well behaved acceleration curves for the pulse train sent to a robotic arm ...


1

Controlling a DC motor takes more power than the GPIO pins of a Raspberry Pi can directly source. In other words, if you try to connect a GPIO pin of a Raspberry Pi directly to a motor you will burn out the Pi. You can control a DC motor in one direction with a transistor. Here is an example. This example uses an Arduino rather than a Raspberry Pi, but the ...


1

I realized that I could use a transistor. To all the people like me, just use a transistor and connect the + to a 5v or 3v3 pin.


1

The except runs when the try fails in an error, In the case the 'try' runs, and doesn't fail during the while loop, thus not giving a chance for the 'try' to error and then run thru the 'except' code and send thru the stop() function. Perhaps use 'if' statements to check conditions and save the 'try' 'except' for cases you need to catch an error.


1

Try/Except is used to catch errors (exceptions) Since I cannot see where you are calling go() from, I dont know if go() should be an infinite loop, but if it is def go(): while True: if not button_40=input(40): forward() continue #back to start of while True loop stop()


1

A digital POT is similar to a digital DAC. You can change the output voltage by setting the input value. As long as your motor controller just needs to sense voltage it should be fine. The digital POT will not supply much current at that voltage though, perhaps just a few milliamps.


1

increasing the frequency is not going to damage the motor. The frequency is how often the motor is being turned on and off, and the PWM value is the amount of one time period the motor is either on or off. Because the motor is being turned on and off, if it is not mounted properly there will be more vibration then when it is fully on (connected directly to ...


1

Since this is a device that needs precision, I would use a stepper motor, if a direct drive were absolutely required. In addition, I would have something that the Raspberry Pi could sense to know that the disk was in position. If the number of positions is constant, I think a very simple mechanical device known as The Geneva Drive would be better. It was ...


1

If you migrate your web server from php to flask, you can give the motor command natively. Make routes as @app.route('/motor-on') and ('/motor-off'), with their respective python commands, then trigger the motor control with ajax request on button click (java script). TIP: Use gpiozero library, it is super easy and effective.


1

exec("python /home/pi/motor/on.py /dev/null/ 2>/dev/null/ &") There's a > missing. To redirect the standard output, it must read exec("python /home/pi/motor/on.py >/dev/null/ 2>/dev/null/ &") If you don't redirect both the standard output and standard error channels, php's exec() waits for completion, regardless of an &.


1

GPIO pins are only supposed to produce 16mA. In fact you CAN draw more (at some risk) BUT NOT at 3.3V. Quite simply the voltage is too low. It is also a bad idea to connect ANY inductive load to GPIO.


1

Thanks to Aurora001 for pointing me to https://github.com/MomsFriendlyRobotCompany/pysabertooth. Using this library I'm able to get the motor control I wanted. A couple of side notes to add. As mentioned in the comments above, when I used the library as is I got an Attribute Error: Serial module does not include "is_open". I modified the installed ...


1

You have misunderstood how PWM is used to control DC motor speed. To control the speed you vary the duty cycle, not the frequency. The frequency should be fixed at a reasonable value for your motor driver board. Say anything over 100 Hz. A duty cycle of 0% stops the motor. A duty cycle of 100% sets the motor full on. The voltage applied to the motor ...


Only top voted, non community-wiki answers of a minimum length are eligible