I’m looking at using two LEDs on a BRAT and want to control them via the Bot Board II. The LEDs I’m looking at are the DELight Ultra Bright LEDs at dimensionengineering.com/pro … bright-led
Can someone advise how two of these could be connected and controlled? Will there be an issue with supplying a max 300mA current to the lights (150mA for each LED)?
hello i viewed the link and it said a servo type connecter i dont understand does the led need a pulse like a servo, because a normal led just needs a high or low the 150ma from say a bs2 is a problem as each i/o pin can only sorce/sink 40 ma.
Good Question: They have some information on their controller but almost nothing on the lights. For example I can not tell from their specs on how the 3 wires are used. It could be simply it uses the power and the ground pins, in which case you can simply plug them in. Or it could be like many of their other devices that take an RC signal to maybe turn the light on or off… Or maybe it uses the signal pin and you control the brightness by selecting a duty cycle…
This is the answer that I got from the Robot Shop forum:
Treat them like servos and you’ll be fine. The BotBoard will need to be powered from a battery pack, so no issues with the current.
Coleman Benson
RobotShop Inc.
Putting Robotics at your service! ®
Visit us : robotshop.com
So I guess they can just be plugged into the Bot Board like a servo…I guess there is no need for concern then re pulling 150mA for each led as, for example, the HS-645MG servo uses 350mA when running, am I right in thinking this (sorry I don’t have an electrical background)?
You treat them as a servo in the idea that you have to supply it with a lot of current ie. wired directly to the battery. But unlike a servo that takes a PWM signal as an input, these LED’s can simply be turned off via TTL digital logic. You could also feed these LED’s the same PWM signal because the 500mS extreme is the same as a digital low, and the 2500mS extreme is the same as a digital high.
Thanks. I finally got my brat and all is working fine…kicking bottles left right and centre! Now back to the lights. I have the leds connected to pins 14 and 15 and they stay powered on. Now how would I turn them on and off, specifically what scripting would I use? In the water bottle kicking code, I have added the leds as constants under the list of servos as follows:
righthip con p10
rightknee con p8
rightankle con p7
lefthip con p6
leftknee con p5
leftankle con p4
head con p11
leftlight con p14
rightlight con p15
So say I want to turn the lights on when an object is detected? Where would I put that and how?
Many thanks for your help and this terrific forum!
What have you tried? It is always fun to experiment to see what happens…
You could try something like change:
if (ir > close) then
sound 9,[100\3750, 50\3950, 100\3800]
gosub somethinghere
endif
to something like:
if (ir > close) then
high leftlight
sound 9,[100\3750, 50\3950, 100\3800]
gosub somethinghere
else
low leftlight
endif
And see if it works some.
If that works at all, you can instead play around in the somethinghere code and see if you get what you want. Again I have not looked to see if you can control the brightness of the LEDS, but if you can you can experiment with that maybe light up the one in the direction you are turning and get brighter as you narrow in…
Thanks Kurt. The high and low commands don’t seem to do anything…should they control the voltage on the pins? Is there a command which stops voltage altogether on a selected pin?
High puts +5v on the IO pin, Low puts 0v on the IO pin. But this is assuming what Devon mentioned about High and Low working for these LED setup. If instead it works like some of there switches, I would try using something like the HSERVO command on them…
Maybe something like:
if (ir > close) then
HSERVO [leftlight\7000\0]
sound 9,[100\3750, 50\3950, 100\3800]
gosub somethinghere
else
HSERVO [leftlight\-7000\0]
endif
Again I am just guessing here… But I used commands like this on my MechBrat to turn on/off the guns.
Kurt
P.S - If I were doing this I would also probably keep a flag to know if I had already set the state as to not have to repeatably call HSERVO.
No signal wire, then you can not turn on/off directly with BB2. High and low commands change io line. So if wish to do it , you would need some form of relay, like lynxmotion.com/p-746-bit-switch.aspx. Not sure how much of a load, but there are others up there as well.