Hi,
I have a project which includes a DC motor, driven by sn754410 using an arduino. I have used the uno and then took the atmega chip out of the board and placed it on a breadboard - full schematics in the attached pdf (excuse me for the mess, first time design :)). Do note that in the schematics the sn754410 is represented by the l293d (the only part I found in fusion360)
I use analogWrite on a pwm pin connected to the sn754410 enable pin to control the motor speed.
The thing is that when I ran the thing on the arduino board, everything ran smoothly, the DC motor at full speed was perfectly fine.
When I switched to the arduino-on-breadboard configuration, running the motor at full speed, it caused some weird behavior - the chips seems to stop responding (LCD screen showing white blocks, encoder not reacting).
I suspect this has something to do with some protection the board have and the breadboard configuration is missing (something with the DC motor back EMF?) - but I'm a newbie, so I'm probably missing some knowledge here
Any advice?
It’s a bit hard without seeing all the pieces.Some things that are obviously missing are the local 100nf bypass caps for each chip, several on the atmega328. Construction methods could be a factor as well.
Got it, thanks, I didn't even realize such a thing is needed
So 2 follow-up questions
Does the type of the cap matter? Are ceramic OK?
Regarding the placement of such caps
On the SN754410 - only on the vcc input? On the enable pin as well? On the A1 and A2 pins?
On the atmega328 - anything that connects to vcc?
Can I ask why you didn't use a Nano, or a Pro-Mini plugged into headers on your board?
It would have been easier to construct and easier to program and reprogram.
I see you have not provided any ICSP pins in your design.
Can you post a picture of your project so we can see your component layout?
Every logic chip needs decoupling on every supply, a capacitor to ground, close to the
chip, 100nF ceramic is a common value used. Datasheets don't always mention this because
its a given, but its worth checking the datasheet for specific decoupling requirements, usually
the "application example" circuit (if there is one) is a useful guide.
The motor supply however is high current and I'd add 100uF or so extra decoupling (electrolytic
capacitor) on that to reduce noise spikes / dropouts.
The high currents that motors tend to pull are more than a breadboard can reliably handle, note, its
best not to route them this way if possible - intermittent or poor connections to inductive loads
can cause devices to fail. A breakout with screw terminals is a good way to deal with motor drivers.
idobh2:
Got it, thanks, I didn't even realize such a thing is needed
So 2 follow-up questions
Does the type of the cap matter? Are ceramic OK?
Yes, it matters. Ceramic is a good type, possibly the best type for this application.
Regarding the placement of such caps
On the SN754410 - only on the vcc input? On the enable pin as well? On the A1 and A2 pins?
On the atmega328 - anything that connects to vcc?
As a rule of thumb: one cap on each Vcc pin, placed physically close to the pin (preferably no more than a few mm away).
The motor driver may require larger decoupling caps - see datasheet. I'm quite sure the decoupling caps of the ATmega328p are mentioned in the datasheet; look for reference schematics (often called "typical application circuit" or something in those words) for all your chips. Motor drivers sometimes also need additional caps for bootstrapping a high side n-channel MOSFET, this will be clearly shown in those reference schematics. There may be additional pointers for things like PCB layout, track routing, and thermal concerns (heat sinking).
Do read the datasheets of the parts you want to use when designing your own circuits!
First of all - Thanks! it actually solved the issue + I learned something here!
Can I ask why you didn't use a Nano, or a Pro-Mini plugged into headers on your board?
It would have been easier to construct and easier to program and reprogram.
I see you have not provided any ICSP pins in your design.
Well, kind of a lame excuse but... this is what I had lying around, so I started and just went ahead with it. I do plan to have the atmega328 connected eventually through a socket obviously, so at lease taking it apart to re-program would be (relatively) easy.
Do read the datasheets of the parts you want to use when designing your own circuits!
Yeah, I know, I just tend to get lost sometimes, thinking i understood the core of it, just to discover stuff like this after a while... learning the hard way here
Thanks again everyone!