12 V DC Motor Issues [Newbie]

Hi all! So, I'm having some problems and I don't even know where to begin troubleshooting.

I'm building a DIY dosing pump controller for my aquarium. I used this as the basic design for it: http://fishtankprojects.com/diy-aquarium-projects/arduino-controlled-dosing-pumps.html

The first one I built using exactly that schematic works fine. I decided to build a second one that is programmable using a button and LCD screen.

Everything works great - until a motor kicks on. When a motor turns on, it seems to cause the arduino to corrupt its memory or something. It clearly stops running my program and the LCD screen will print either random characters or blank out. The design isn't really much different than the simpler one. So far I've hooked up two different dc motors to two different FETs and they cause the same behavior. I have a lot more wires in this one so I could be messing something up somewhere, but I don't know where to search. Unfortunately, I don't think a picture would be helpful since it's a pretty big wiring mess :frowning:

I've attached a fritzing diagram... I'm using a shield instead of one big breadboard though.

Also, I'm using a 5 V regulator because for some reason the onboard one doesn't work with 12 V DC. I had the same issue with both projects. Power light on the board comes on, but it is otherwise completely unresponsive.

Hi, and welcome to the forum.

A Fritzing diagram is useless if it does not exactly represent what you have build.
For starters, those diodes don't do anything if you you have connected them like in the Fritzing diagram.
Kickback diodes go across the motor, so between +12volt and collector (cathode/ring to +12).
The button is drawn between 5volt and input, without a pull down resistor. Doesn't work like that.
What 5volt regulator. Linear? Does it have the right caps on input and output.
What sort of 12volt supply.
If you want answers, then give us the right info, and the code.
Leo..

4 things you need to minimize interference from the motors.

  1. Add decent decoupling to the 12V supply, perhaps 100uF to 1000uF across the 12V supply at the MOSFETs.

  2. Put the freewheel diodes in the correct place, cathode to +12V, anode to MOSFET drain. They are in
    the wrong place currently (where did you get that circuit?)

  3. Add some ceramic capacitors across the motor terminals to knock out RF interference from the
    commutator sparking (1 or 10nF directly across the motor terminals - must be directly across the
    terminals with as short leads as possible)

  4. Common the ground between the Arduino circuit and 12V motor circuit in one place only - this
    is star grounding. This prevents ground loop interference.

And also keep the motor stuff physically away from the Arduino will also help.