Most character-mode LCDs seem to be happy with a VEE supply of about 0 V, which produces enough contrast to get by. If you have a negative supply handy, then it’s easy to goose it with a little negative bias and improve the contrast.
What if you don’t have a negative supply and you’re using an old craptastic LCD that really wants VEE = -1 V and you didn’t realize that until you had everything wired up and it’s a one-off / low-duty-cycle instrument that you don’t want to spend much more time on?
Just whack up a quick-and-dirty charge pump inverter…
It turns out that the circuitry already had a 33 kHz PWM square-wave signal driving something else, so I air-wired this inverting charge pump to the PWM output. You could, of course, put an otherwise unoccupied PWM output to good use, which is a better idea if you have the option.
You can use a PWM output, but the charge pump depends on being fully charged & discharged in every cycle. Run your own numbers.
The LCD’s VEE input dumps about 1 mA to the supply, which means the charge pump must be able to pull out 1 mC/s, more or less. At 33 kHz, each cycle must haul 30 nC.
Assuming the Arduino (well, any microcontroller will do, but that’s what I’m using) has a 5 V power supply and the output pin isn’t overloaded from the rest of its function and the cap charges & discharges completely during each half-cycle, then the first cap must store that 30 nC of charge. You want a lot more than that so you have a stiff supply to work with.
Q = CV, so you need at least 30 nC/5 V = 6 nF. Nothing exceeds like excess, so I soldered a 220 nF box cap standing up from the header pin on the circuit board and air-wired the diodes in place. That will transfer lots more charge and keep the voltage nicely negative.
I have a lifetime supply of 10 µF solid tantalum caps, so that’s what I used for the filter cap. Regulation isn’t critical, but each pump cycle shouldn’t change the voltage on that cap very much. In fact, pulling 220 nF * 5 V = 1 µC from the filter cap while injecting 30 nC from the LCD leaves you with a whopping 970 nC deficit: it’ll stay around -5 V just fine.
Actually, it won’t. The negative supply will be about two diode drops above -5 V. The diodes aren’t carrying a lot of current, so they’ll be running at maybe half a volt apiece. Call it -4 V, more or less. You could use Schottky diodes if you need more negative volts.
If the LCD dumps 1 mA into the supply and -1 V produces the right contrast, then a 3 k resistor will drop the necessary voltage from the supply.
As it turned out, the LCD dumped 800 µA, -0.8 V gave the right contrast, and a 4.7 k resistor worked just fine. Maybe you want a twiddlepot in there to adjust things.
You need that little cap right at the LCD VEE pin to soak up the spikes from the LCD drive multiplexing, as this “power supply” has nearly 5 k output impedance. Yow!
If you’re worried about temperature compensation, then you’ll need something fancier. In that case, you’ll also want a Spice model to be sure all these rough-and-ready calculations cut somewhere close to the truth.
Memo to Self: maybe next time this should be on the PCB right from the start, even if it’s not really needed? Or, much better, just go with a single-chip inverter and be done with it!
Update: If you’re worried about driving a bare cap from your microcontroller pin, add a small-value series resistor. The time constant should be maybe a third of the square-wave period: 15/3 = 5 µs in this case, so the resistor should be 5 µs/220 nF = 22 Ω. That limits the peak current to no more than 5 V/22 Ω = 230 mA, not a big improvement. Mostly, the microcontroller pin will be OK if you’re using small caps.