Connect with us

Microcontroller stops comunicating serially after motor connection

Discussion in 'Microcontrollers, Programming and IoT' started by AngelAD, Feb 8, 2016.

Scroll to continue with content
  1. AngelAD


    Feb 8, 2016

    I'm currently working with an arduino UNO which uses an Atmega328P, I'm trying to control the movement of three motors with two accelerometers and communicate with a computer serially to know inclinometers' position. I'm using the L298N driver to move the motors with the microcontroller, I use PWM for the control signal and a digital pin for direction signal for each motor. I use separete power supplies one for the microcontroller, one for the two L298N, since each chip has two full bridge drivers, and one 24V power supply for the three motors.

    The problem is that the microcontroller can move one motor almost without any problems, but when I move a second motor serial comunication disconnects, even sometimes this disconnection occurs with only one motor moving, sometimes disconnects as soon as the motors start running and soometimes it disconnects after a little while.

    As I said before, I use separate power supplies and for test porpuses i've left the accelerometers out, so I'm currently only testing the motors with the serial communication. I've read the drivers datasheet and it says that the drivers only need an input current of 100 uA at most for the control input signal and the direction input, Arduino's pins can source up to 40 mA. Also I've meassured the current through the motors and they sink no more than 400mA each, and the driver L298N can take output current peaks of up to 3 A and repetitive output current of up to 2 A each channel.

    I don't know how to get my circuit to work, any ideas?

    I attached the specifications table from the L298N datasheet TablaDataSheet.png

    Best regards,
  2. Bluejets


    Oct 5, 2014
    A circuit of what you have may be helpful.
  3. Lightning


    Oct 12, 2013
    If you are using three separate supplies make sure you joint all the grounds together otherwise you will have some strange behavior. This has happened to me before. It may not be the problem but hopefully it might help :)
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day