EL Backlight PS Using two ATtiny85s

I got an LCD from a friend that requires a HV AC ps (200 to 300VAC). I tried to find one at a surplus store
and there was no schematic to speak of and the connector was a very small oddball connector . Anyway
I couldn’t get it working so I searched online and found a project at Nerdkits.com at this link:
NerdKits - LCD Backlight - Electroluminescent Inverter

I used a 12V dc power supply for Vdd.
I tried breadboarding the circuit using the same parts except for the diode , for which I used a
BYT 11-1000 and a Mosfet from Fry’s with faster turn on time (16ns) which gave
me a higher voltage. I also used a 1kv 0.1uF cap. I was only able to get 165vac using the IRF730 for the high frequency but got 210vac using a Fry’s NTE 2398. I started out using a Pro-Mini , obtaining both frequencies , the 150khz on Pin-9
and the 200hz on pin-11. Then I decided to try to make it more compact by using one or two ATtiny85s. I was
able to do it with two tiny85s, using a 16Mz (Internal PLL) for the ic generating the 150khz with TIMER 0.
because TIMER 0 only has an 8-bit prescaler I could not get 200 hz using a 16Mhz clock so I used a
board file for an 8Mhz (Internal PLL) for the tiny generating the low frequency (200hz).
You can get the schematic from the Nerdkits link above and as they point out, you can get the 100uH
choke from RadioShack. That particular part has been on the RadioShack inventory for more than 50 years
I believe. It costs $1.95 today so you can image what it cost 50 years ago. I strongly recommed using
the NTE 2398 High Speed Switch Mosfet from Fry’s instead of the IRF730 for the Q1 , driven by the
125khz 50% duty cycle waveform and the IRF730 is fine for the low frequency (200hz). In case you are
wondering, I discovered the voltage was a little higher with 200hz instead of the 150 used in the
Nerdkits circuit. I discovered this using PB3 (analog input pin 2 of the ic, called PB3 on the datasheet)
using the following mapping method:

   int  freqAdj = analogRead(analogPin);   // read the input pin
  freqAdj = map(freqAdj, 0, 1023, 66, 86); //  138hz to 161hz
int freq  = map(freqAdj, 66, 86, 161,138);


   int  freqAdj = analogRead(analogPin);   // read the input pin
  freqAdj = map(freqAdj, [MIN], [MAX], [smaller count], [larger count]); //  [higher freq] to [lower freq]
int freq  = map(freqAdj,[MIN], [MAX], [smaller count], [larger count]); //  [higher freq] to [lower freq]);

(With the Pro-Mini, you can insert:

Serial.print("freq= ");
here to see the realtime freq value on your serial monitor as you adjust it. )

The MAP format above yields a longer period (slower freq) as you turn the pot clockwise if the pot is connected
for increasing voltage CW. If you prefer clockwise to increase the freq instead of the period you could swap
smaller count and larger count to get lower to higher frequency instead.
The attached files are a photo of the illuminated backlight with the breadboarded circuit in front of it,
The high freq 16Mhz tiny program (122khz) from PB0 (Pin-5 of the ic), the Low freq 8Mhz tiny program for 200hz from
the TIMER 0 (PB0, pin-5 of the ic) , and a Pro-Mini/UNO program that generates both frequencies (150khz & 200hz)
from pin-9 and pin-11 respectively. Don’t forget to use 470 ohm pullups on the reset pin of the tinys (pin-1) or the
pulse might just drop out unexpectedly shutting down the display. Also, Q1, the high freq mosfet will need a good
heatsink, something with some decent alluminum fins, like the RadioShack 276-1368 . I’m getting about 213VAC
using the setup I just described with two tinys. I used an oscilloscope to measure the frequencies because I discovered
the frequeincy calculated using the datasheet didn’t match for what I should get with a specific count. If someone
can tell me why I would love to know. Last but not least, this circuit generates HIGH VOLTAGE ! I shouldn’t have
to tell you what THAT MEANS. DON’T TOUCH IT WHILE IT’S POWERED ON ! And if you want to touch it use a
toggle switch or disconnect the wire from the power supply because most 12V power supply still have voltage on
their filter caps. If you just unplug the power supply without disconnecting the output from the circuit and then
touch one of the components thinking the power is off, well, trust me , you will think twice next time…

ATtiny85_freq_generator_w_Adjust_121951_hz_ino.ino (1005 Bytes)

ATtiny85_freq_generator_w_Adjust_200hz_ino.ino (1019 Bytes)

EL_Backlight_PS_H_150_kHz_L_200_Hz_Pro_Mini.ino (888 Bytes)


int  freqAdj = analogRead(analogPin);   // read the input pin
  freqAdj = map(freqAdj, [MIN], [MAX], [smaller count], [larger count]); //  [higher freq] to [lower freq]
int freq  = map(freqAdj,[smaller count], [larger count], [higher freq],[lower freq]);

Here’s a better photo that gives a better view of the heatsink. I also removed the 0.047uF, 1600V cap
that was blocking it. I was experimenting with different values of capacitance to see how it affected
the voltage. Also , I am using a 300nf (0.3uF), 1kV cap that was not mentioned in the post. This cap
is not critical but increases the voltage by about 10 to 15V. Any cap rated for 300 to 350V should be
ok. Total capacitance in the circuit shown in photo is 0.4uF. Voltage shown is 220VAC. Note, this
backlight has an optimum visibility at 300VAC and above so the display shown is running at 73% of
optimum. To give a perspective on the difference this PS running at 73% of optimum makes, I have
included a photo of the same setup taken at the same time with all the same lighting but with PS
OFF. If you zoom in close enough you can just barely make out the yellowish characters on the very
dark blue (almost black) display. So it you ask yourself, “Do you really need a Backlight for this LCD ?”,
I think the answer is obvious. If you absolutely HAD to use it WITHOUT a backlight (because you either
don’t have one or haven’t built this project yet, you can get a small Halogen desk lamp and point it
at the display the light reflecting off the yellow characters will almost look white against the dark