Go Down

Topic: Problem with LCD and Motor (Read 11654 times) previous topic - next topic

wbegg

Quote
however you should connect the ground side of the 12v supply direct to the junction of the mosfet source terminal and 1000uF capacitor, instead of via the mcu ground pins as you appear to be doing.


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

I'll add the decoupling caps as suggested. Thanks a bunch, guys.

dc42


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

Thanks. I think I might have a completed PCB design.


dc42

No, you've now broken the connection between mosfet source and Arduino ground.
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

Quote
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).


dc42

#20
Jan 22, 2012, 03:39 pm Last Edit: Jan 22, 2012, 05:50 pm by dc42 Reason: 1
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

Will do. Thank you so much for your help. I will be isolation routing this today on the CNC.

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).

floresta

#23
Jan 23, 2012, 06:38 pm Last Edit: Jan 23, 2012, 06:40 pm by floresta Reason: 1
Quote
but just curious as to what could be causing this.

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.

Quote
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).

I doubt it.  Are you sure you haven't misinterpreted or miswired the potentiometer pins.

Don

liudr

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

Oh silly me, silly me. I thought contrast was supposed to fade the lcd (characters) and not the backlight. I swapped the pot to pin 3, and all is well in silly land.

So the pins aren't switched, but my brain synapses are!

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.

Pin 1 - Ground
Pin 2 - Vcc (+5V)
Pin 3 - Vo (wiper of potentiometer to pin 3 with one side to 5V and other side to ground).
Pin 15 - +5V through 330 ohm resistor
Pin 16 - Ground

floresta

Quote
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

Quote
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.



Go Up