Defective hardware?

I have a project which involves a 4x20 LCD display (http://www.sparkfun.com/products/256). My project works perfectly when plugged into a USB cable. When I switch to an external power supply, the LCD fails to function. I returned the Uno, and exchanged it for another at a different Radio Shack. The new board correctly operates the LCD, unless I turn the backlight of LCD on. If I do this, the system resets and my program starts over.

I am powering the LCD backlight with a PWM pin. Around 40% output on this pin causes a reset.

I added a 7805 power regulator (with capacitors) on a breadboard and power it with the vin pin on the Uno. If I touch the backlight line to this regulated power, the backlight lights, and the program resets.

Again, this all (not the regulator) works perfectly if powered by the USB.

Is it possible I have yet another defective board? I would think what works from USB should work seemlessly from an external power supply. My power supply is 10v 1000ma.

Thanks for any help. I'm really at a loss as to how to progress.

What is your external supply and what is its current capacity?

If you regulate the voltage with a 7805, do NOT put the 5V on Vin. It must go on then5V pin / node.

My power supply is:

My power supply is 10v 1000ma<<

Not sure if that is what you are asking.

I have vin to pin 1 (v-in) of regulator and the pin 3 (v-out) of regulator never makes it's way back to the Arduino. I also have ground going to regulator.

hectorharvey:
I have vin to pin 1 (v-in) of regulator and the pin 3 (v-out) of regulator never makes it's way back to the Arduino. I also have ground going to regulator.

Okay, I misunderstood what you were doing. If you are talking just a 4x20 LCD you shouldn't need an additional regulator.

Sounds like a couple of clear pictures of your wiring might help.

Thanks for your interest James. I think I can pin this on defective hardware because I have an older Duemilanove board that works correctly with the external power and the new Uno fails. I will exchange yet again.

I don't think one PWM pin will power the backlight on it's own, you can test the backlight with a multimeter and see how much current it draws because it not just one LED in the backlight, there will be maybe 16 in a 4x20 display, Just a thought anyway.

If you want to PWM the backlight try using a small transistor to drive it

P18F4550:
If you want to PWM the backlight try using a small transistor to drive it

This is a really important point.

The datasheet for hectorharvey's LCD module says the backlight is configured to draw 240mA. This is problematic for two reasons: 1) I/O pins are limited to 40mA before damage, <35mA suggested. 2) The max current of the ATmega328 (self current plus all I/Os) is 200mA.

Without doubt, damage is occurring to both the I/O pin and the ATmega328 itself.

Thanks for your help on this. This is challenging for me as I have no hardware training other than self education. The software part is easy for me.

It confused me (and still does) that the board yields desired output when powered by the USB, and fails when powered by an external power supply. Reading your post makes me realize it doesn't matter whether it works with USB, I shouldn't be driving the backlight with an IO pin.

Can you help me understand the external power better. I have a 10v 1000ma external power supply that from what I can tell should be fine for my project.

If I pull the VIN to a break out board, can I then use that to drive the backlight or is the VIN pin regulated/limited as well? Do I need to setup a voltage regulator (7805) to be driven by the VIN? I think I experimented with this and had a similar failure... powering the backlight from the VIN still caused the arduino to reset.

hectorharvey:
It confused me (and still does) that the board yields desired output when powered by the USB, and fails when powered by an external power supply.

The on-board regulator is a linear regulator. When drawing large amounts of current through it, it gets hot and will start to shut-down. If your LCD was really drawing its 250mA, plus 50mA for the Arduino, that's 300mA. 10V - 5V = 5V drop across the regulator. P = I * E. So Power Dissipated is 300mA * 5V = 1.5Watts. That's a lot of power for the regulator to dissipate without a heat sink.

You should measure the 5V pin (and Vin) when the the external supply is connected. If the 5V pin is well below 5V, you know that the regulator is shutting down.

The good news is that this is a "good thing(tm)". The regulator is designed to keep itself from overheating, keeping it from getting damaged.

hectorharvey:
Reading your post makes me realize it doesn't matter whether it works with USB, I shouldn't be driving the backlight with an IO pin.

No, you should not. You should be driving a transistor with the I/O pin and have it turn on the backlight.

hectorharvey:
If I pull the VIN to a break out board, can I then use that to drive the backlight or is the VIN pin regulated/limited as well?

The only real limitation is how much current the traces on the PCB can handle. If you're drawing more than 1A, then I would rethink just drawing through Vin.

hectorharvey:
Do I need to setup a voltage regulator (7805) to be driven by the VIN? I think I experimented with this and had a similar failure... powering the backlight from the VIN still caused the arduino to reset.

This depends entirely on how it was wired.

At the risk of drifting off topic... let me describe my project a bit and maybe you could advise me on an approach.

I am building LED controller for an aquarium. The lights require a 10volt PWM control signal with something like a 2ma draw. There are two.

My thoughts were that I would like to have one power cable to the wall for this. A 10volt wall wart could power the arduino, the backlight and the LED control signals. Not a hard requirement, just my thoughts tearing into this.

I have a break out board with the VIN.

Problem 1: I have an I/O pin driving an NPN transistor to control the LED voltage from 0 to 10. Via a meter, this works perfectly with the 5 volt board current, but with the 10 volt vin it never drops to 0 volts. It seems to bottom at 2ish. Maybe this would not be a problem if the lights were wired in... or maybe they would always be on dim. I believe 0 volts is desired. I have seen other designs from searches that use this approach, and wonder if they get 0 volts.

Problem 2: The backlight voltage from the datasheet says 4.3 volts. How should I peel off 4.3 volts and still keep the LED control signals at 10 volts.

I found the source of my woes!!! My external power supply was yielding an AC result instead of a DC result. The Arduino seemed to partially handled that on the input and converted it to a DC signal. When I tried to use the VIN for anything, things got ugly and failed. AC VIN.

So a DC power supply and everything is working more as I expected. Regarding my Problems listed from previous post:

Problem 1: The transistor correctly shuts down an 8 volt signal to 0 volts. My power supply can work with a 0-8 volt signal. There is an adjustment screw on the power supply so I will run at 8 volts and adjust the screw to get the desired amperage output from my power supply.

Problem 2: I can tap off of the 5 volt pin for the backlight. Now that it is not AC, tapping this source yields desired results.