2

My apologies I'm still getting to grips with the more advanced aspects of electronics, so apologies if this is a stupid question!

I'm building a sensor device with a Raspberry Pi, and have got multiple devices connected to it using a breadboard.

I'm having an issue where depending on how fast and which direction I run the connected motor, the brightness/contrast of the connected LCD also changes.

They are both connected to the 5V rail, and being powered off a HW-131 breadboard power module, rather than the Pi.

Here is a link to the video of the behaviour: https://i.stack.imgur.com/IJgwf.jpg

The program running on the Pi in the video runs the motor at a couple of different speeds and different directions, that is intended behaviour, that's not because of these issues. It's the LCD's reaction to it that I'm concerned with here

Attached is a circuit diagram of my circuit. Boxed in red is the Motor circuit, and in blue is the LED screen header, it's running over I2C.

The power supply supplying the board can supply 2A, is it the case that my power supply isn't powerful enough, or could it be some sort of backfeeding issue from the motor driver IC onto the 5V rail?

Any ideas would be greatly appreciated, thanks!

Circuit Diagram

Jack Pollock
  • 121
  • 2
  • 2
    I think you are misusing the part. Only one ground pin out of the four is connected. There are also other problems in the circuit, like using the GPIO pins to drive LEDs and transistors without a current-limiting series resistors. And a single 10nF will not work as a bypass capacitor for the whole circuit, it needs a lot more capacitors and higher capacitances at these currents and frequencies. – Justme Jan 30 '21 at 21:31
  • @Justme thank you for your advice. I've built this circuit by following guides on how to use the parts online. E.g. in the case of the motor, a guide on how to control a motor speed and direction using a raspberry pi, and that was the circuit it gave me. And the 10nF cap was on a little premade Stepper Motor controller board, I just copied the schematic for the stepper motor board. Board image here: https://www.makerfabs.com/image/cache/makerfabs/ULN2003%20Stepper%20Motor%20Driver/ULN2003%20Stepper%20Motor%20Driver_1-1000x750.jpg – Jack Pollock Jan 30 '21 at 21:36

1 Answers1

1

Add 100nF ceramic caps in parallel to every IC power pin pair close to the IC. This is standard practice.

Add a 100-470uF cap to the motor's power supply closest to the motor and motor circuitry.

Don't power the motor through a regulator if you don't have to. The L293D can handle up to 36V and your motor is not that picky. You gave no specs for your motor but if it runs off 5V it will be fine up to at least 7V.

DKNguyen
  • 54,733
  • 4
  • 67
  • 153
  • My apologies, I don't have any specific specs on the motor, as it came in an electronics kit, however it appears to just be the same as those standard cheap little 5v motors that are so common. I don't know if that's any use? Probably not :/ – Jack Pollock Jan 30 '21 at 21:29
  • Probably would survive 9V but no further. You can usually tell by momentarily applying voltage and listening if the motor screams. – DKNguyen Jan 30 '21 at 21:31
  • So if I wanted to be able control the motor speed and direction using the RPi, would I still need the IC or not? I was following a guide bundled with the kit that showed using an L239D to control the motor – Jack Pollock Jan 30 '21 at 21:37
  • You still need the IC. The IC is like power steering for the MCU pin which cannt provide enough power. – DKNguyen Jan 30 '21 at 21:37
  • Got it. Thanks. So if I added a 100nf Ceramic Cap between pins 8 & 5 and pins 16 & 13 on the IC, then added a 100-470uF cap to the 5v power rail close to where the motor connects to it then would that work? – Jack Pollock Jan 30 '21 at 21:42
  • I also recommend you connect up the unused half of your L293 to the working half so they are doubled up. All ICs should have those caps. If you have one arm free, you might as well also use it to lift the rock.. – DKNguyen Jan 30 '21 at 21:44
  • I will give that a try and see how it goes. Thanks so much for your help! – Jack Pollock Jan 30 '21 at 21:58