Microcontroller, LED, DC motor problems

In summary, the conversation discusses the issue of a faster blinking LED when a motor is activated using an H-Bridge Motor Driver and a micro-controller. The potential cause of this issue is a fluctuation in voltage due to the switch noise affecting the timer input. The solution is to use a decoupling capacitor to smooth out the voltage.
  • #1
Superposed_Cat
388
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
  • #2
Do you have an external power supply or the micro-controller supplying the voltage to the H-bridge?
 
  • #3
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.
 
  • #4
Are you using timer 0?
 
  • #5
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.
 
  • #6
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.
 

What is a microcontroller?

A microcontroller is a small computer on a single integrated circuit. It contains a processor, memory, and input/output peripherals, and is designed to control electronic devices.

What is an LED?

An LED (light emitting diode) is a semiconductor device that emits light when an electric current passes through it. It is commonly used in electronic circuits for indicators, displays, and lighting.

How do I troubleshoot common problems with microcontrollers?

Some common problems with microcontrollers include incorrect code, faulty connections, or damaged components. To troubleshoot, make sure your code is correct and try testing each component individually to identify the issue.

Why is my DC motor not working?

There could be several reasons why your DC motor is not working, such as faulty wiring, damaged components, or incorrect voltage. Check all connections, make sure your components are in working condition, and ensure the voltage is appropriate for your motor.

Can I control an LED and a DC motor with a microcontroller?

Yes, a microcontroller can be programmed to control both an LED and a DC motor. However, make sure to properly connect and power the components and use appropriate code to control them effectively.

Similar threads

  • Electrical Engineering
Replies
1
Views
1K
Replies
11
Views
2K
  • Electrical Engineering
Replies
4
Views
3K
  • Electrical Engineering
Replies
9
Views
7K
  • Electrical Engineering
Replies
7
Views
34K
  • Electrical Engineering
Replies
3
Views
5K
  • Electrical Engineering
Replies
2
Views
16K
  • Engineering and Comp Sci Homework Help
Replies
7
Views
3K
Replies
10
Views
8K
  • Electrical Engineering
Replies
13
Views
6K
Back
Top