Microcontroller, LED, DC motor problems

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
5 replies · 2K views
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
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.