Microcontroller, LED, DC motor problems

AI Thread Summary
Controlling a 5V DC motor and an LED simultaneously with an H-Bridge Motor Driver and ATMEGA328 microcontroller led to issues with the LED blinking faster when the motor activated. The problem was attributed to potential voltage fluctuations affecting the microcontroller's performance. A solution was found by adding a capacitor to smooth out the voltage, resolving the blinking issue. The discussion emphasized the importance of using decoupling capacitors on switching device inputs to manage inrush current and maintain stable operation. Proper voltage management is crucial for reliable microcontroller performance in such applications.
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.
 
While I was rolling out a shielded cable, a though came to my mind - what happens to the current flow in the cable if there came a short between the wire and the shield in both ends of the cable? For simplicity, lets assume a 1-wire copper wire wrapped in an aluminum shield. The wire and the shield has the same cross section area. There are insulating material between them, and in both ends there is a short between them. My first thought, the total resistance of the cable would be reduced...
Hi all I have some confusion about piezoelectrical sensors combination. If i have three acoustic piezoelectrical sensors (with same receive sensitivity in dB ref V/1uPa) placed at specific distance, these sensors receive acoustic signal from a sound source placed at far field distance (Plane Wave) and from broadside. I receive output of these sensors through individual preamplifiers, add them through hardware like summer circuit adder or in software after digitization and in this way got an...
I am not an electrical engineering student, but a lowly apprentice electrician. I learn both on the job and also take classes for my apprenticeship. I recently wired my first transformer and I understand that the neutral and ground are bonded together in the transformer or in the service. What I don't understand is, if the neutral is a current carrying conductor, which is then bonded to the ground conductor, why does current only flow back to its source and not on the ground path...
Back
Top