Microcontroller, LED, DC motor problems

Click For Summary

Discussion Overview

The discussion revolves around issues encountered while controlling a 5V DC motor and making an LED blink simultaneously using an H-Bridge Motor Driver (SN754410) and an ATMEGA328 microcontroller. The focus includes troubleshooting unexpected behavior in the LED blinking rate when the motor is activated, potentially linked to voltage fluctuations.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Experimental/applied

Main Points Raised

  • One participant reports that activating the motor causes the LED to blink faster, suggesting a possible issue with voltage supply affecting the microcontroller's performance.
  • Another participant inquires whether an external power supply is used for the H-Bridge or if it is powered by the microcontroller.
  • A question is raised about the method used to make the LED blink, specifically whether an internal timer in the microcontroller is employed, and how noise from the motor might affect the timer's operation.
  • There is a suggestion that a weak pull-up resistor might not adequately maintain an input pin's state, potentially leading to erratic behavior.
  • One participant mentions that they resolved the issue by using a capacitor to smooth out the voltage, although they express uncertainty about the cause of the fluctuation.
  • A later reply emphasizes the importance of using decoupling capacitors on switching device inputs to mitigate inrush current effects when transistors switch on or off.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the initial cause of the issue, but there is agreement on the effectiveness of using a capacitor to stabilize voltage. The discussion includes multiple viewpoints regarding the potential sources of the problem and the importance of decoupling capacitors.

Contextual Notes

There are unresolved assumptions regarding the configuration of the microcontroller's timer and the specifics of the power supply setup for the H-Bridge. The discussion does not clarify the exact nature of the voltage fluctuations experienced.

Superposed_Cat
Messages
388
Reaction score
5
Hey all, me and my friend are attempting to control a 5v dc motor and make a LED blink simultaneously using a H-Bridge Motor Driver 1A - SN754410 and ATMEGA328 micro-controller(16mhz, 8bit). The issue is is that when my H-Bridge activates the motor using input from the micro-controller then the blinking light blinks faster, almost solidly. The actual program cycle seems shorter.Perhaps the cpu is bugging out due to lack of voltage. Any help appreciated, thanks.
 
Engineering news on Phys.org
Do you have an external power supply or the micro-controller supplying the voltage to the H-bridge?
 
How do you make the LED blink? Internal timer in the microcontroller?

Often such timers can be configured for internal/external enable signal etc., and as you start the dc-motor, the switch noise may affect an inputpin for the timer. For example a weak (internal) pull-up resistor may not be strong enough to keep an inputpin high, or you may have configured the timer unintentional.
 
Are you using timer 0?
 
Sorry forgot to mention I we fixed it, we just used a capacitor to smooth out the voltage, I don't know what caused the fluctuation but it worked.
 
Superposed_Cat said:
Sorry forgot to mention I we fixed it, we just used a capacitor to smooth out the voltage, I don't know what caused the fluctuation but it worked.
you aretalking about a decoupling capacitor on the microcontroller input?
Yous should ALLWAYs have decoupling capacitors on switching device inputs. Think about it. there is inrush whenever a transistor switches on or off, which will change the current draw. A microcontroller has a poopton of transistors.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 9 ·
Replies
9
Views
8K
  • · Replies 7 ·
Replies
7
Views
36K
Replies
3
Views
6K
Replies
7
Views
15K
  • · Replies 1 ·
Replies
1
Views
17K
Replies
7
Views
3K