enter image description hereI am making a simple robot with 2 BO motors driven by L293D on ATmega328P (took out from Arduino Uno). The robot when tested on Uno works fine. But when I put it on the board that I have designed (as I am not allowed to use Uno in college), the motors work for few seconds and then the microcontroller resets.

The problem is definitely not with the code, but some hardware issue that I could not figure it out. I have already tried:

  1. Coupling capacitors - I changed the capacitors on the input and output pins of 7805. I tried using capacitors from the range of 47uF to 1000uF. But no change.

  2. I am using 33pf ceramic capacitor for 16 Mhz crystal as I couldn't find 22 pf. But I tried 18pf and 15pf, but no luck.

  3. Coupling capacitor on L293D power supply (47uF). No change.

  4. Ceramic capacitors on BO motors, just to ensure the noise isn't affecting the power supply. But still no change.

From the web, I understood the concept of Brown-out reset and I assume that I am facing the same issue. Because the board works fine with other components. But as soon as I connect the motors with the driver, I face the problem of reset. Each motor is drawing out ~100mA, but 7805 should be able to supply it as per the datasheet.

Also one of my friends suggested it has also to do with the track width that I am using. My track width for power lines is 24 mils and 12 mils for data lines (GPIO pins). I am not changing it as I am not sure if this is the real reason

If anyone has experienced this before please help me out with some solution. Thanks

  • 2
    \$\begingroup\$ Post a schematic of the board you have designed. \$\endgroup\$ – Unimportant Feb 22 '19 at 14:39
  • \$\begingroup\$ You should run the motors directly from the battery pack, not from the 7805. Motor power and logic power should have separate wire runs from the battery. And you should replace the lossy L293 with a modern FET driver and consider enlarging the battery pack. You may also want to switch the MCU to 3v3 to gain more headroom. \$\endgroup\$ – Chris Stratton Feb 22 '19 at 14:44
  • \$\begingroup\$ But when I do the same setup in Arduino, why does it work? I need to understand that. Even in Uno, I supply L293D from 5V pin which is the regulator output. \$\endgroup\$ – New_user Feb 22 '19 at 14:47
  • \$\begingroup\$ @Unimportant, i tried creating the schematic on the editor, I faced some issues. I will try to put an image as soon as possible. \$\endgroup\$ – New_user Feb 22 '19 at 14:47
  • 1
    \$\begingroup\$ Current paths are likely quite different when comparing your board with the Uno mash-up wiring. Capacitor placement matters - putting them close to the noise source is better (if you know where noise is being generated). And very important : ground paths for current are critical - your processor and L293 share a ground, which can feed motor transients back to cause processor mayhem. Suppressing radiated transients may help - twist those motor leads together all the way back to L293. \$\endgroup\$ – glen_geek Feb 22 '19 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.