Pages: 1 [2] 3 4 ... 6   Go Down
Author Topic: Problem with LCD and Motor  (Read 10129 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

Logged

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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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



* ArduinoStandalone.JPG (83.87 KB, 602x559 - viewed 41 times.)
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No, you've now broken the connection between mosfet source and Arduino ground.
Logged

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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 227
Posts: 6637
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: January 22, 2012, 11:50:09 am by dc42 » Logged

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.

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4383
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: January 23, 2012, 12:40:04 pm by floresta » Logged

Central MN, USA
Offline Offline
Tesla Member
***
Karma: 74
Posts: 7243
Phi_prompt, phi_interfaces, phi-2 shields, phi-panels
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged


Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Western New York, USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 4383
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 68
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.


Logged

Pages: 1 [2] 3 4 ... 6   Go Up
Jump to: