I made a design for my line follower. I am using an atmega328 from a duemilanove board. The motors of the line follower are connected to two mosfet transistors which are pulse width modulated from the pins 5 and 6. I also have 5 infrared sensors. the sensors and the atmega are being powered by a lm7805 and the motors directly from the battery.

The problem is that when I put the atmega on the board it doesn't run the motors, but if the atmega is on the arduino duemilanove and just the pins 5 and 6 are connected it works. I did not connect all the pins from the atmega just those which I am using that means pins 0-4 for the sensors the vcc and gnd pin, pins 5 and 6 for the motors and the two pins which are connected to the crystal and the 22pF capacitors.

Do I need to connect some more pins, or is it consuming to much current so that the lm cannot give so much (I also did not put the two capacitors to the lm7805) or is it some other problem?

Edit: Added Schematic and Board: Schematic Board

  • 3
    \$\begingroup\$ Please provide a circuit diagram of the arrangement on the LF (Line Follower) - and ideally also when connected to the Arduino. Also, how do you know that the ATmega is working OK without the motors? - Is there some other indication of life - or have you looked at the FET gate drives with an oscilloscope?, etc. What power supply are you using on the LF? 5V or 12V or ...? Do the motors go via the 7805? What is the Vin to the 7805 on the LF ... What value is Vcc on the ATMega (MEASURED!) when the motors are not running and when they are trying to run? \$\endgroup\$
    – Russell McMahon
    Feb 4 '13 at 0:08
  • \$\begingroup\$ @RussellMcMahon When connected to the arduino I just share the gnd pin and connect the pin 5 to the place where it would be when the atmega is on the Line Follower. In that case the motors work with the same atmega just on a duemilanove board. The lm7805 is connected to a 7.4 fully charged li-po battery and the motors run directly from that battery so not over the lm. I measured the voltage on the vcc pin on the atmega it shows 5V, but the motors are not running because the pin doesn't react it should go to 5V but stays 0V all the time. I checked these with a multimeter. \$\endgroup\$
    – Ammar114
    Feb 4 '13 at 11:00
  • \$\begingroup\$ Well that link set off all sorts of alarms. Why don't you just upload an image of your schematic? \$\endgroup\$
    – W5VO
    Feb 4 '13 at 13:47
  • \$\begingroup\$ It is too big if I zoom out that much nothing can be read from it. I tried something and i think it is because of the lm. I made a seperate power supply for the atmega and the ir sensors, but the gnd is shared it still doesn't work when i connect the motors, but without the motors connected the atmega works just great. The output voltage on the pins which are controlling the motor are changing like programmed. \$\endgroup\$
    – Ammar114
    Feb 4 '13 at 14:10
  • \$\begingroup\$ Only one ground is connected, and you have 2-6 shorted to 27-23 respectfully. Other than that, someone else might be able to lend a hand \$\endgroup\$
    – Passerby
    Feb 4 '13 at 14:33

Problem solved. I just needed to connect a 10k resistor between the reset and vcc pin and one 1uF capacitor between vcc and ground. The other gnd and the avcc pin are not really neccessary to be connected.


Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.