Author Options:

How can I attach El wire to a PIC using an accelerometer as a switch? Answered

I would like to use a PIC that would turn on the EL wire only when it is dark out via a small photocell. I would also like to incorporate an accelerometer that would detect when the person is walking or running (it is to go on shoes) as well as fade in and out. To turn it off to conserve battery power, I would like to incorporate a small switch so that when the person is home he can turn it off. Most of all, I would like to use 3 volts with a lithium ion cell or two AG13 batteries. I have wanted to use a CMOS 555 but it would make the circuit very complex very quickly which would make the circuit heavy and very uncomfortable to wear.



6 years ago

The pic can do it all, generate the El signal that generates the HV AC
and when the accelerometer lie bit goes quiet turn itself off.

The restart can be SW a magnet.


How would the PIC generate the high voltage?

This is an old EL driver development platform for a  pic that had UV erase, 
and dip switch you don't need,  also the xfmr was more then needed.  ,
You can use the small 1/3 size xfmr.

If you are a beginner programmer you can skip the PWM and just
SQ wave the xfmr.  Though a look up table is what it takes to PWM.

The EL wire lasts longer if is driven by a 400 cycle sine waveform.
Also if you are short on pins then use an inverter in place of the 2nd pin.  A


Could you upload a picture that is a pdf or even just a bigger image? It is hard for me to see...thanks for the info though.

Thank you so much for all your help.

Do you have an example code of how I could incorporate an accelerometer to the PIC (12f675)? Thanks.

Do you program PICs?

Yea Iv programmed PICs for 20 years.  You get example code on
the microchip website for using the ADC or monitoring High / Low
transitions on a single pin.  Have you eve bothered to get the PIC PDF ?

Any way, any accelerometer outputs a milli-volt signal proportional
to g load ( some, like Parallax actually send a serial number )  so you
have to use a single pin as an ADC and continually or parse text to
collect the digital conversion and compare it to a ref digital level and 
determine the pulse interval for the PIC to detect stepping, running
or not moving and after a minute stillness go to sleep all the while at
peak points pulsing a pin at EL frequency to cause rope lighting to
occur per each step.

If its going on/ in the shoe a tilt switch is easier to monitor faster code, cheaper, one pin using an interrupt easier to use then the ADC to EL
for your stepper.


Thank you. However Microchip did not have a source code I could find.

Mine dont' have analogue outs, they are SPI.....