Log in

View Full Version : How to wire a flashlight?


TimTheGreat
18-02-2016, 13:57
Our team wants to wire a normal 5v led flashlight to the robot and be able to turn it on and off. What is the best way to wire it?

Matt C
18-02-2016, 14:22
It would be part of a CUSTOM CIRCUIT and need to be controlled in accordance with R53, and not violate R41, R55, R59, or any other rules I may have missed regulating CUSTOM CIRCUITs.

TimTheGreat
18-02-2016, 14:44
It would be part of a CUSTOM CIRCUIT and need to be controlled in accordance with R53, and not violate R41, R55, R59, or any other rules I may have missed regulating CUSTOM CIRCUITs.

mhmm....and what exactly would this custom circuit be?

MrForbes
18-02-2016, 15:01
We put a spotlight on our robot...a cheap $14 unit from Walmart. We only used the LED and reflector from the spotlight. The custom circuit consists of a LM7805 voltage regulator and 3.6 Ohm 5 Watt series resistor, and it also uses a Spike relay. The relay is controlled by a relay output on the roborio.

http://www.simple-electronics.com/2011/09/cheap-led-driver-using-7805-regulator.html

in case you don't know how to figure the resistance and wire up this type of custom circuit.

JR0405
18-02-2016, 15:43
You would need to use a relay wired to the Roborio and power the flashlight through the relay from the voltage regulator module

SuperBK
18-02-2016, 15:43
Also, you could use a resistor sized with 12 volts in mind and avoid the 7805. And like Mr. Forges says, control the 12V with a spike. Depending on how much the led draws, some teams have run them off a port of the pneumatics control module, though personally, I would prefer to use a spike.

rich2202
18-02-2016, 16:13
Depending upon the amps, you might be able to power it off the 5v supply of the VRM. You would still have to have that power go through a relay.

Ari423
18-02-2016, 16:52
Depending upon the amps, you might be able to power it off the 5v supply of the VRM. You would still have to have that power go through a relay.

I thought that custom circuits powered through a Spike would need to be powered off the 12V PDP output. I guess you could consider the Spike as part of the custom circuit and power it all off the VRM, but I don't know how much the inspectors or Spike will appreciate that.

rich2202
18-02-2016, 17:47
I thought that custom circuits powered through a Spike would need to be powered off the 12V PDP output.

There is no requirement that a Custom Circuit be powered off a 12V PDP output. The rules say a Custom Circuit can have up to a 40A breaker. I could not find a rule that says a Custom Circuit cannot be connected to the VRM.

However, looking at the Spike, it needs at least 9.5 volts, so it will not work switching 5 volts.

So, the custom circuit would need its own custom switch.

TimTheGreat
18-02-2016, 17:56
Also, you could use a resistor sized with 12 volts in mind and avoid the 7805. And like Mr. Forges says, control the 12V with a spike. Depending on how much the led draws, some teams have run them off a port of the pneumatics control module, though personally, I would prefer to use a spike.

Do you know how many volts/amps the PCM supplies?

Peyton Yeung
18-02-2016, 18:03
Both when I was a senior in high school and this year (junior in college) we used a spike relay and voltage converter to turn on the flashlight through the PDP.

We used this (http://www.homedepot.com/p/t/202548494?catalogId=10053&langId=-1&keyword=led+mag+light&storeId=10051&superSkuId=202896934&N=5yc1v&R=202548494#.UWTh1rWxV2u)flashlight. It's a 3V flashlight so we used this (https://www.amazon.com/gp/product/B00CEUN0VU/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1)voltage converter. The flashlight was cut in half through the body and wires were added to the + terminal and the body (- side). This was connected to the voltage converter which was connected to the spike relay.

Alan Anderson
18-02-2016, 19:41
Do you know how many volts/amps the PCM supplies?

The Pneumatic Control Module User's Guide (http://content.vexrobotics.com/vexpro/pdf/217-4243-PCM-Users-Guide-20150219.pdf) gives the information you want. The outputs are selectable to be either all 12 volts (battery) or all 24 volts (boosted), and the maximum current delivered to all channels combined is 500 milliamps.

TimTheGreat
18-02-2016, 20:42
Both when I was a senior in high school and this year (junior in college) we used a spike relay and voltage converter to turn on the flashlight through the PDP.

We used this (http://www.homedepot.com/p/t/202548494?catalogId=10053&langId=-1&keyword=led+mag+light&storeId=10051&superSkuId=202896934&N=5yc1v&R=202548494#.UWTh1rWxV2u)flashlight. It's a 3V flashlight so we used this (https://www.amazon.com/gp/product/B00CEUN0VU/ref=oh_aui_detailpage_o03_s00?ie=UTF8&psc=1)voltage converter. The flashlight was cut in half through the body and wires were added to the + terminal and the body (- side). This was connected to the voltage converter which was connected to the spike relay.

...Are the voltage converters from the years of the cRIO allowed? We still have ours.

rich2202
18-02-2016, 21:01
...Are the voltage converters from the years of the cRIO allowed? We still have ours.

Yes. You could wire a Spark to the PDP, and the output of the Spark goes to the Voltage Converter. That would allow you to turn on/off the voltage converter.

TimTheGreat
18-02-2016, 21:02
Yes. You could wire a Spark to the PDP, and the output of the Spark goes to the Voltage Converter.

So we tried connecting the light straight to a talon and limiting the output to 4.5 volts, but it burned out the light. Will that happen with this?

Peyton Yeung
18-02-2016, 21:36
So we tried connecting the light straight to a talon and limiting the output to 4.5 volts, but it burned out the light. Will that happen with this?

You should look into how much current is going through the talon at 4.5 volts.

MrForbes
18-02-2016, 22:28
LEDs need to have the current to them limited somehow. Adding a resistor in series, will do this.

did you happen to look at the link I provided in my previous post? it kind of explains the resistor thing....

Alan Anderson
19-02-2016, 10:41
So we tried connecting the light straight to a talon and limiting the output to 4.5 volts, but it burned out the light.

The output of a Talon is actually either 0 volts or battery voltage. It's pulsed fast enough to yield a variable average voltage, but apparently it's not fast enough to keep the LED from being fried due to too much current.

If the flashlight is happy at 5 volts, then using one of the old 12-to-5-volt converters on the output of a Talon could work. But I'd suggest using a relay (e.g. a Spike) instead of a speed controller, so you never have the chance of making the converter itself unhappy with a PWM'd or reverse polarity input.

techhelpbb
19-02-2016, 14:14
The output of a Talon is actually either 0 volts or battery voltage. It's pulsed fast enough to yield a variable average voltage, but apparently it's not fast enough to keep the LED from being fried due to too much current.

If the flashlight is happy at 5 volts, then using one of the old 12-to-5-volt converters on the output of a Talon could work. But I'd suggest using a relay (e.g. a Spike) instead of a speed controller, so you never have the chance of making the converter itself unhappy with a PWM'd or reverse polarity input.

Seconding Alan's suggestion here: I had to read this topic over and over before I realized what people were suggesting. I would seriously think twice about using a FRC style electronic speed control as a power switch in an application like this. As a CSA I'd be looking at that wondering 'why?'. The Spike makes quite a bit more sense, is cheaper and probably smaller.

While it is possible to use PWM to control output voltage, like a switching power supply actually does, it requires a feedback loop and at some point a Spike and a resistor/regulator/converter would have done the job much easier (select the resistance and power rating as necessary to put the LEDs at the right voltage and current, use a series regulator to dissipate the extra voltage as heat or use a DC/DC converter module). Obviously if you use a resistor alone to reduce the voltage to your load the battery voltage will change as the battery discharges. So a series regulator or DC/DC converter may be more elegant but possibly physically heavier and larger.

MrForbes's suggestion was the 7805 series regulator but it wasn't clear if the amount of current required by the light was specified. There are multiple packages for the 7805 depending on the current that will be drawn through it. It may also require a heatsink. A DC/DC converter is an even more complex circuit but the older 12V-5V DC/DC converters for the D-Link are frequently available and provide a healthy amount of current. Just remember those old DC/DC converters drop out if the battery goes below a specific voltage which was around 8VDC.

MrForbes
19-02-2016, 14:57
Thanks for expanding on the info I provided. Note that I included a picture, which shows the LM7805 mounted to a piece of aluminum, which is a heat sink. Note also that the heat sink is mounted to a wood part, so it is insulated from the metal robot chassis, as required by the rules...since the metal tab on the LM7805 is connected to the negative battery terminal, through the PDP and Spike

Coach Seb
01-03-2016, 08:13
We put a spotlight on our robot...a cheap $14 unit from Walmart. We only used the LED and reflector from the spotlight. The custom circuit consists of a LM7805 voltage regulator and 3.6 Ohm 5 Watt series resistor, and it also uses a Spike relay. The relay is controlled by a relay output on the roborio.

http://www.simple-electronics.com/2011/09/cheap-led-driver-using-7805-regulator.html

in case you don't know how to figure the resistance and wire up this type of custom circuit.

Any info on the "spike" relay ? we are just starting on this and not finding much yet... Thanks

nHoude
01-03-2016, 09:10
Any info on the "spike" relay ? we are just starting on this and not finding much yet... Thanks

The spike is just an H-Bridge relay that was used in the years of the C-RIO to power the compressor (along with the DC-DC converter mentioned in previous posts), but was replaced in 2015 with the PCM.

The spike itself was discontinued at VEXPRO (http://www.vexrobotics.com/217-0220.html) but you may be able to find it somewhere else, or you can ask a veteran team who should have some stockpiled somewhere.

techhelpbb
01-03-2016, 09:32
The spike is just an H-Bridge relay that was used in the years of the C-RIO to power the compressor (along with the DC-DC converter mentioned in previous posts), but was replaced in 2015 with the PCM.

The spike itself was discontinued at VEXPRO (http://www.vexrobotics.com/217-0220.html) but you may be able to find it somewhere else, or you can ask a veteran team who should have some stockpiled somewhere.

http://www.ebay.com/itm/Vex-Pro-Spike-H-Bridge-Relay-/380582768189?hash=item589c802e3d:g:EhMAAMXQKQhRIE1 p

billbo911
01-03-2016, 11:49
LEDs are basically current devices that have a voltage drop across them. They will have a maximum current they can handle before they burn up. Limiting the current in one way or another to less than their maximum current rating will allow them to survive a LONG time. This is what MrForbes is doing with the resistor in series with their LED and voltage regulator (LM7805).

This year we decided to add a "Photon Cannon" to our robot to aid the driver in shot alignment.

To do this, we chose to use a constant current source (https://www.sparkfun.com/products/13716) LED driver and a 3W LED (https://www.sparkfun.com/products/13105).
Using the constant current source sets the current through the LED to either 330mA or 660mA, depending on how we configure the board, regardless of the battery voltage. This way it does not dim or flicker as we drive or manipulate things. We mounted a single lens 10cm (focal length of the lens) in front of the LED to give us a nicely collimated beam. The intensity of this beam is such that we decided not to leave the photon cannon on all the time, but switch it on only when needed. This is achieved by using a Spike relay.

Let's just say, it works REALLY well.

BTW, the LEDs we are using are are also available in Red (https://www.sparkfun.com/products/13106), Green (https://www.sparkfun.com/products/13185), and Blue (https://www.sparkfun.com/products/13107). All of these work well and look really great!

MrForbes
01-03-2016, 12:09
A little update...we never got around to making our little LM7805 cirucit properly, that is, we never secured the wires to anything, and one of the leads on the part broke off. Yesterday we got out an old 12v- 5v converter from a previous year KOP and wired it in place of the regulator chip, but kept the series resistor. seems to work fine.

Beam width on a light like this might be important, I expect there are several ways to get a spotlight effect. The spotlight we used with the reflector seems to be pretty good.

pmangels17
01-03-2016, 12:09
To echo what other people have said, LEDs are diodes (it's in the name), so they have a couple things to remember.

Firstly, they are non-ohmic, meaning they don't behave according to regular ole' V=IR math. Secondly they have a polarity, calld bias (http://www.allaboutcircuits.com/textbook/semiconductors/chpt-3/introduction-to-diodes-and-rectifiers/). If you wire a diode in reverse bias, little current will flow, and it won't light up. If you wire it in forward bias, current will take off if you supply a voltage above something like .6-.7V, maybe a bit more or less depending on what your diode is made of.

However, your diode will require much more than this voltage to light up (it depends on what LED you have, but somewhere in the neighborhood of a few volts most likely). When this voltage is supplied, current flows very quickly through the diode, in what you could think of as a short circuit, which, if enough current is flowing, will blow up your diode. That is why it is important to have a resistor in series with your LED, so that you can supply it with a high enough voltage to light up while limiting the current that flows through the LED so that it doesn't blow up. Make sure your resistor is rated for the amount of power you estimate will be dissipated through it, otherwise this can cause problems as well.

Breadbocks
01-03-2016, 12:34
To do this, we chose to use a constant current source (https://www.sparkfun.com/products/13716) LED driver and a 3W LED (https://www.sparkfun.com/products/13105).
Using the constant current source sets the current through the LED to either 330mA or 660mA, depending on how we configure the board, regardless of the battery voltage. This way it does not dim or flicker as we drive or manipulate things. We mounted a single lens 10cm (focal length of the lens) in front of the LED to give us a nicely collimated beam. The intensity of this beam is such that we decided not to leave the photon cannon on all the time, but switch it on only when needed. This is achieved by using a Spike relay.

Let's just say, it works REALLY well.

I just got a batch of those LEDs and I have been wondering how best to power them. Can you use one of the drivers for multiple of those LEDs in series? Like someone above said, LEDs don't follow standard V=IR rules so I've been somewhat lost on how to handle them.

billbo911
01-03-2016, 13:21
I just got a batch of those LEDs and I have been wondering how best to power them. Can you use one of the drivers for multiple of those LEDs in series? ....

Yes, absolutely!
Just remember, the voltage drop across each LED must be added as the LEDs are in series. The number of LEDs it can drive will be limited by the source voltage and the maximum voltage the driver can handle.

Here is a quick hookup guide (https://learn.sparkfun.com/tutorials/femtobuck-constant-current-led-driver-hookup-guide-v12?_ga=1.121378560.905362336.1436902362). It includes an example of putting the LEDs in series.

Coach Seb
01-03-2016, 13:22
LEDs are basically current devices that have a voltage drop across them. They will have a maximum current they can handle before they burn up. Limiting the current in one way or another to less than their maximum current rating will allow them to survive a LONG time. This is what MrForbes is doing with the resistor in series with their LED and voltage regulator (LM7805).

This year we decided to add a "Photon Cannon" to our robot to aid the driver in shot alignment.

To do this, we chose to use a constant current source (https://www.sparkfun.com/products/13716) LED driver and a 3W LED (https://www.sparkfun.com/products/13105).
Using the constant current source sets the current through the LED to either 330mA or 660mA, depending on how we configure the board, regardless of the battery voltage. This way it does not dim or flicker as we drive or manipulate things. We mounted a single lens 10cm (focal length of the lens) in front of the LED to give us a nicely collimated beam. The intensity of this beam is such that we decided not to leave the photon cannon on all the time, but switch it on only when needed. This is achieved by using a Spike relay.

Let's just say, it works REALLY well.

BTW, the LEDs we are using are are also available in Red (https://www.sparkfun.com/products/13106), Green (https://www.sparkfun.com/products/13185), and Blue (https://www.sparkfun.com/products/13107). All of these work well and look really great!

So if i understand this correctly, i could use the CCS and LED above connected to the PCM module instead of a Spike Relay... ???? Basically my LED is now controlled just like if it was a solenoid on a pneumatic valve right ?

jwallace15
01-03-2016, 14:03
The Pneumatic Control Module User's Guide (http://content.vexrobotics.com/vexpro/pdf/217-4243-PCM-Users-Guide-20150219.pdf) gives the information you want.

My team and I used the PCM's outputs to control 12v LED strips last year. Very easy to program that way, and saves weight from having a Spike (yeah, the whole quarter of a pound or so). I'm not sure what the students this year are planning to do, whether they want them to flash or not will determine using a PDP or a PCM output.

As for you guys on 1418, I think that your best bet is to go with the LM7805 or the old voltage regulators for the radio. I would say that if you guys are stressing about weight to go with the 7805 and get a small, solderable breadboard at RadioShack or off of Amazon. The 7805 would be more work, though. The old radio regulator would probably be the simplest option. You guys could just wire that to the PDP on with a 20A breaker.

Yes, absolutely!
Just remember, the voltage drop across each LED must be added as the LEDs are in series. The number of LEDs it can drive will be limited by the source voltage and the maximum voltage the driver can handle.

I've never heard of these before, but they seem really cool!

cglrcng
01-03-2016, 15:56
Walmart sells a nifty little (Tri~Headlight type) Multi LED $15.00~$20.00 Adjustable Headlamp on an adjustable elastic strap in the Camping section (White hi intensity center beam bulb, 3 different settings, high~medium~low), and 2 outer red or blue lower intensity LED bulbs and all the settings work great w/ the vision tape.

Best of all is that the light just happens to operate (as originally manufactured), on 4.5~5 volts (3 AA batteries originally as purchased inserted in a stacked triangle shape).

So we just removed the batteries, drilled a hole for the wires in the battery hold down door/cap (said operable battery door still opens for inspection so they can see there are no batteries installed). We soldered properly sized 16 gauge wires to each end of the empty battery holder contacts and run it off the 5 volt 500ma side of the VRM.

Said LED flashlight fits on the front of the Axis camera perfectly using that strap and a bit of velcro. And it is very aimable.

Sort of neat to use Red when you are red alliance and reverse to Blue when you are blue....The white LED'S are very bright even on the low setting. Blinding on the high setting. The blue/red...Not so much.

I will grab the make and model tonight for those interested and maybe post a pic.

billbo911
01-03-2016, 16:09
So if i understand this correctly, i could use the CCS and LED above connected to the PCM module instead of a Spike Relay... ???? Basically my LED is now controlled just like if it was a solenoid on a pneumatic valve right ?

Essentially, yes. The caution is, the PCM has a Maximum current rating of 500mA. You might be getting close to that with these LEDs. Granted, the CCS will use less current if it's input voltage is higher, say +24vdc. I would still be cautious doing it this way, but it theoretically should work.

billbo911
01-03-2016, 21:44
Just a visual of the "Photon Cannon". #NotAFlashlight #NotALaser

https://billbo911.smugmug.com/Hobbies/2016/i-w2ptGJr/0/XL/20160301_181333-XL.jpg

https://billbo911.smugmug.com/Hobbies/2016/i-mQjwK37/0/XL/20160301_181659-XL.jpg