Line follower design with atmega328 and mosfet controlled motors

arduinoatmegamotorvoltage-regulator

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

Best Answer

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.