I'm using an old computer supply with both 12 and 5 volts with a common ground.

In that case, if you can't design the pcb with a ground plane, then I suggest you put a separate ground pin on your pcb for the PSU input, connected direct to that mosfet/capacitor junction. You can use the ground pin you already have for connecting the ground sides of input devices and the LCD. What you don't want is high switched currents from the psu to the motor going along a long pcb trace with devices connected to different points on that trace.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

wbegg

you've now broken the connection between mosfet source and Arduino ground

There is one ground on the modified PSU (+5, +12, Gnd), so technically the source of the mosfet is connected to the arduino ground via the power supply wiring. The two grounds on the PCB are connected, just with 3 inches of wire instead of a trace. Should I still do this locally on the board as well? (i.e. add trace from mosfet source to arduino ground).

My recommendation is to connect the ground line locally on the board instead of off-board. Take the ground feed to the Arduino from the -ve side of that 1000uF capacitor, so that capacitor leg is the junction between the wires to mosfet source, power supply ground, and Arduino ground. This will help to minimize switching noise feeding back to the Arduino. Also connect a 0.1uF ceramic capacitor in parallel with the 1000uF.

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

wbegg

This seems to have solved the problem, but now I just found a new one with my LCD display.

When I turn the contrast down - with 10K pot - below a certain level, and back up again, It displays strange characters, and must be reset. This is regardless of whether I have the logic pins connected or not. It's not a big issue, as I leave it turned up anyway, but just curious as to what could be causing this.

This is after an hour of wondering why the contrast didn't adjust at all only to find out the pin2 and pin 3 are swapped on my particular HD44780 compatible LCD (JHD204A - made in China).

Sorry I ran away while everyone else here is kicking the ball. Could you post some hi-res pictures of how you connected the pot? I have the same suspicion as floresta. Unless you supply a picture, nobody can be sure you connected the wires correctly. Is it possible that pins 2 and 3 or pins 1 and 2 are shorted with solder bridge?

wbegg

A little tight and messy for a picture. I'm sure the pot is wired correctly, as a voltage divider. Wiper (center) to Pin 2 of LCD, one side to ground, other side to +5V. I even swapped out the pot, and same thing occurs. I even checked to make sure it was a linear pot and not log taper.

I am positive the pins 2 and 3 are swapped, and there are no solder bridges. I also had read in another forum that someone else had a JHD204A with swapped pins 2 and 3.

wbegg

Oops, yet another brainfart. When I swapped the pins back to Pin2 5V and Pin3 Pot, I forgot I had the anode of the display (pin 15) linked to pin 3 (as I originally thought Pin 3 was Vcc. So in actuality, I was placing a voltage divider in the LED (backlight) circuit.

I am confident now that Pin 2 is Vcc as all HD44780's are. However, now I find that contrast does nothing at all if I wire everything up as correct. This is the main reason I swapped pin 2 and pin 3 originally. I prefer the way it's set up now anyway. I would much rather control the backlight anyway. Here's my hookup with contrast NOT working.

now I find that contrast does nothing at all if I wire everything up as correct.

You probably burned out the potentiometer when it was wired incorrectly. I mentioned this in reply #23: "You may have the potentiometer miswired so that it is shorting the power supply (and overloading the potentiometer) when you turn it to one end."

Don

wbegg

You probably burned out the potentiometer when it was wired incorrectly.

Nope. Potentiometer is OK. I even swapped it out. This problem was present "out of the box" when I recieved the LCD. Plus, the potentiometer was never wired incorrectly, I just accidentally wired it to the backlight circuit (as voltage divider, so safe), but long after I first tested the LCD upon receiving it.