# Wiring LED Eyes to a EFX-TEK Prop-1, why won't it work?



## HalloweenRick (Nov 25, 2005)

Ok I'm a wee bit embarrassed to say that what I thought would be the easiest part of putting this raven together is driving me bonkers. I'm wiring up the LED red eyes in the raven. So its just 2 red 5mm LEDs, with the long lead of one hooked to the short lead of the other with a 510 ohm resistor. Then I've got the two other ends hooked up to the white and black ends of a servo connector, going into PIN 2 of the TTL pins on a EFX TEK Prop-1 board. Now get this- when I hook this up without the servo connector and hook it up to a 9v battery it works fine. Add the servo connector, hook it to PIN 2, and I get no response. The rest of the program works, but the LEDs don't light. What am I missing, as I'm sure its something stupid. Does the Prop1 have a resistor already built in? Do I need to hook it to V+ and OUT 2? The program calls for blinking LED's, could that cause it not to light? Thanks for any help you guys can provide (I'm thinking Otaku again...) Here is the program Jon at EFX TEK wrote for me:
' =========================================================================
'
' File......
' Purpose...
' Author.... Jon Williams, EFX-TEK
' Copyright (c) 2008 EFX-TEK
' Some Rights Reserved
' -- see http://creativecommons.org/licenses/by/3.0/
' E-mail.... [email protected]
' Started...
' Updated...
'
' {$STAMP BS1}
' {$PBASIC 1.0}
'
' =========================================================================

' -----[ Program Description ]---------------------------------------------

' -----[ Revision History ]------------------------------------------------

' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL Eyes = 2
SYMBOL Beak = 1
SYMBOL Base = 0

' -----[ Constants ]-------------------------------------------------------

SYMBOL IsOn = 1 ' for active-high in/out
SYMBOL IsOff = 0

SYMBOL Yes = 1
SYMBOL No = 0

SYMBOL BeakOpen = 170
SYMBOL BeakClosed = 130

' -----[ Variables ]-------------------------------------------------------

SYMBOL posBase = B0 ' servo positions
SYMBOL posBeak = B1

SYMBOL idx1 = B2 ' loop controllers
SYMBOL idx2 = B3

SYMBOL timer1 = W2 ' base timer
SYMBOL timer2 = W3 ' beak timer
SYMBOL timer3 = W4 ' blink timer
SYMBOL lottery = W5 ' random #

' -----[ Initialization ]--------------------------------------------------

Reset:
PINS = %00000100 ' eyes on
DIRS = %00000111 ' set outputs

posBase = 150
posBeak = BeakClosed

timer1 = 1000 ' must preset > 20
timer2 = 2000
timer3 = 2500

' -----[ Program Code ]----------------------------------------------------

Main:
RANDOM lottery ' stir random #
GOSUB Refresh_Servos

Check_Base:
timer1 = timer1 - 20 ' update timer
IF timer1 > 20 THEN Check_Beak ' expired?

Turn_Base:
RANDOM lottery ' re-stir
posBase = lottery // 101 + 100 ' 100 to 200
RANDOM lottery
timer1 = lottery // 10001 + 10000 ' 10 to 20 seconds

Check_Beak:
timer2 = timer2 - 20 ' update timer
IF timer2 > 20 THEN Check_Blink ' expired?

Chirp:
FOR idx1 = 1 TO 4
posBeak = BeakOpen
FOR idx2 = 1 TO 3 ' 3 x 20ms = 60ms
GOSUB Refresh_Servos
NEXT
posBeak = BeakClosed
FOR idx2 = 1 TO 3
GOSUB Refresh_Servos
NEXT
NEXT
RANDOM lottery
timer2 = lottery // 10001 + 10000 ' 10 to 20 seconds

Check_Blink:
timer3 = timer3 - 20 ' update timer
IF timer3 > 20 THEN Main ' expired?

Blink_Eyes:
FOR idx1 = 1 TO 6 ' must be EVEN #
TOGGLE Eyes ' invert eye status
FOR idx2 = 1 TO 5 ' 5 x 20ms = 100ms
GOSUB Refresh_Servos
NEXT
NEXT
RANDOM lottery
timer3 = lottery // 10001 + 20000 ' 20 to 30 seconds
GOTO Main

' -----[ Subroutines ]-----------------------------------------------------

' Refreshes servos
' -- uses ~20 milliseconds

Refresh_Servos:
PULSOUT Base, posBase
PULSOUT Beak, posBeak
PAUSE 16
RETURN

' -------------------------------------------------------------------------


----------



## BTH (Jul 2, 2006)

I'm no expert but I believe the TTL is just 5 vdc. Try it in the V+ and ground.


----------



## randyaz (May 26, 2006)

run your resistor off just one of the LED legs...not across them


----------



## bradbaum (Jul 26, 2008)

The short LED lead (usally also the flat side of the LED package) is ground - you need to make sure it is going to the white wire, the long LED led will then go to the red wire. The resistor can be on either leg of the LED as long as it is in series with the LED. Something like this:

RED ---------/\/\/\/\--------|>|-----|
WHITE -----------------------------/

The Prop-1 works by sinking current, that means it provides a ground. This is opposite from the way most of us think as we are use to appling the positve voltage to something to get it to work (as in your car when you turn the key +12 goes to the starter to start the car).


----------



## hpropman (Jul 27, 2008)

The resistor in the middle is fine a long as it is in the circuit to limilt the current. The reason the led is not blinking is because it is blinking so fast that your eye can not see it. the pulse stream to control a servo is 1 pulse every 15 uS (microseconds). will the raven be talking? do you want the eyes to blink while the raven talks? what circuit are you using for that? or are you using VSA? either way you need to tap your leds positive (anode / longer lead) to that circuit or to the VSA output that is pulsing the voice. Here is a led tutorial that will help you understand leds.

http://www.kpsec.freeuk.com/components/led.htm

Please show us the whole circuit so that we can help you solve this problem.


----------



## HalloweenRick (Nov 25, 2005)

Thanks everyone for the quick responses! However, I'm still at a loss. The program calls for the LEDs to run from the TTL pins, but I hooked it up to V+ and GND anyway to no avail. Bradbaum I tried it your way, but still doesn't work. I checked it again with a 9V battery and it lights up great. This is how I've always wired up eyes in foam wig prop heads, so I may be doing it wrong for a Prop1 connected prop. Hpropman this is a raven that will be more like the eye candy in the haunted mansion, where a servo will trigger the base randomly, the beak will move randomly, and the LED eyes blink intemittenly. No VSA on this one. I' m kinda leaning toward the 510 resistor. Should I take it out completely, as the Prop-1 is dampening the voltage? Good suggestions by all, just still looking for the answer. Thanks to all so far.


----------



## Otaku (Dec 3, 2004)

As I understand, the Prop-1 is controlling 5VDC. The LEDs light with a 510 ohm resistor and a 9VDC battery. I think your resistor value is too high. Two LEDs in series, assuming a voltage drop of 2.4VDC and a current of 20mA (both fairly conservative values) would only need a 10 ohm resistor. Try reducing the resistor value.


----------



## hpropman (Jul 27, 2008)

OK first do not remove the resistor I would use a smaller resistor (5V - 2V) / .02 =150 ohms. TTL is 5 volts not 9. anything from 150 to 300 should be fine. Even with the 510 it should light although it may be dim compared to a 150 - 180 resistor. second if you are using different power supplies for the circuits (e.g - a prop1 power and a battery) then the grounds need to be connected to complete the circuit (ground is ground the world around) always remember that. third - lets eliminate the program for a minute and just write a program to blink the led on output 2 just to make sure that the hardware works. Once we know the hardware is good then we can go back and debug the program.

Here is a link to a led resistor calculator - just plug in the numbers and it tells you what resistor size you need. 
http://led.linear1.org/1led.wiz

edit: I forgot that there were two leds not one so Otaku is correct (5V-2V (one led) -2V (second led) /.02 =50 ohms


----------



## bradbaum (Jul 26, 2008)

Otaku is correct the servo connection does put out +5, the ULN chip outputs are the current sink. I have always hooked my LEDs up to the ULN chip outputs, they get fed +12V from that connector.


----------



## JonnyMac (Apr 5, 2007)

The Prop-1 has a 220-ohm resistor in series with every TTL IO pin but that will not stop your circuit from working -- it will just make the LED dimmer when it's on. 

You should write a simple test program first that makes pin 2 high -- one line:

HIGH 2

to make sure the LEDs light. If your LEDs are typical and have 1.5v drop you're probably getting about 3mA through them -- low, but you should still see it. With two LEDs in series and the 220-ohms built in you could leave out the 510-ohm LED; that will allow 9mA through the LEDs which will be plenty bright. BTW, when using the 9v battery you were getting about 12mA through the LEDs. If you need more current then use the V+/OUT2 connection and set your resistor as needed (with the 510 you have the V+/OUT2 connection should give you about 16mA).

Sorry, I don't get a chance to visit other boards very often; if you have an EFX-TEK question be sure to copy it to our board as well, or give us a call.

Jon
EFX-TEK Hollywood Office


----------



## HalloweenRick (Nov 25, 2005)

Thanks Jonny Mac! That worked like a charm! Took out the resistor completely and added HIGH 2 to the program, and we've got working LEDs! Thanks to all who replied!


----------



## JonnyMac (Apr 5, 2007)

Excellent -- but you don't need the HIGH 2 in your program (that was just for testing); this bit of code cause the program to start with the eyes on.

Reset:
PINS = %00000100 ' eyes on
DIRS = %00000111 ' set outputs

It was the resistor removal that did the trick.


----------

