0
\$\begingroup\$

I am using a pair of El Escudo boards on my arduino. I've stacked them and fed the digital I/O pins to the first one and manually wired the analog pins to the second one. All works fine - sort of.

I wanted more than eight wire segments, so I thought I could just set the analog pins to 255 or zero and turn those wire segments on and off. I've discovered that I can sometimes turn it on, but can't really turn it back off. Sometimes it doesn't turn back on, but only if it has already been on.

I suspect that because EL wire is mostly a capacitive load that I may need a bleeder resistor to ensure the port fully changes state.

Should I put a 10K resistor to ground from the analog port? One to vcc+? Both?

\$\endgroup\$
6
  • \$\begingroup\$ You need to give us some more details about your setup. What EL inverter are you using, and how do you have that wired to the shields and the EL "wires"? And can you post the code you're using to drive it? \$\endgroup\$
    – Dave Tweed
    Oct 26, 2012 at 0:44
  • \$\begingroup\$ You're running 24 meters of El Wire, so you'll need a beefy inverter. Neither SparkFun nor Adafruit sell an inverter that can power that length of El wire. By the way, if you are indeed using the exact shield you linked to, know that is outdated and has been replaced. It's possible that the problems you are encountering have been solved by the new revision which is significantly more robust in switching the El Wire. \$\endgroup\$ Oct 26, 2012 at 1:32
  • \$\begingroup\$ There will only be two segments active at a time and each is less than 20cm long. I am using this inverter: sparkfun.com/products/10201 \$\endgroup\$ Oct 26, 2012 at 1:57
  • \$\begingroup\$ I have a simple for-loop with digitalWrite(pin, HIGH);, but if it is the analong pin I use analogWrite(pin,255) with delay(1000) in the loop. \$\endgroup\$ Oct 26, 2012 at 1:58
  • \$\begingroup\$ (of course I set them to LOW, 0 after the delay) \$\endgroup\$ Oct 26, 2012 at 2:21

1 Answer 1

1
\$\begingroup\$

There are no Digital to Analog converters available on an Arduino that I'm aware of. The analogWrite() method you're calling is for PWM on a digital pin, so you might as well just configure it as a plain digital output and use it accordingly.

You don't mention what kind of Arduino you're using, so I'll assume it's a Uno. The schematic for the board will show you which pins on the ATmega328 are connected to which header pins.

enter image description here

The datasheet for the ATmega328 has summary descriptions for each bank of IO pins on page 3. You'll note that both PC and PD can be programmed as digital outputs.

The schematic for the El Escudo that you linked to shows that a standard board does not use pins A0 - A5, or PC0 - PC5 on the ATmega. These are the pins that you'll want to use on your 2nd Escudo, but you'll need to configure them as digital outputs and make sure that you've snipped the header leads for the digital pins that normally drive the El Escudo (Shown as pins D2 - D9) to ensure that your outputs for the 'stock' Escudo don't fight with your new hand-wired outputs.

\$\endgroup\$
4
  • \$\begingroup\$ I am using Uno. I have manually wired A0 to what would usually be the D2 input on the second Escudo. The D-pins do not extend into the second Escudo I am using. I guess I need to make A0 behave like a digital port. The segment lights up, but It doesn't always turn off. How do I define A0 as digital? \$\endgroup\$ Oct 26, 2012 at 12:15
  • \$\begingroup\$ @Diodeus, how do you define any other pins to be digital outputs? It should be identical. \$\endgroup\$
    – HikeOnPast
    Oct 26, 2012 at 16:20
  • \$\begingroup\$ I guess you're right. First time doing this. \$\endgroup\$ Oct 26, 2012 at 17:55
  • \$\begingroup\$ Have fun with your EL, and be sure to upvote/accept answers or comments that you've found helpful. \$\endgroup\$
    – HikeOnPast
    Oct 26, 2012 at 18:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.