Flashlight recieving power from digital outputs

We do not own a vex flashlight, but were wondering if the 5 volts given off by a digital out would be able to power the light?
Would it also be possible to use a y cable off a motor port so the flashlight gets power as well as the motor?
Coluld you plug the flashlight into the power expander and get constant power from the batteries?

Thanks in advance.

You could probably power it from +5V and Ground (where red and black wires go on the digital port). You will not be able to turn it on and off using a digital output. The 4 leds in the flashlight probably use somewhere around 100mA (and I don’t have one either so cannot measure it) and a digital output cannot source or sink that much current.

Yes, but not sure if that is legal.


To control brightness, a motor controller 29 can also be used, but it uses up one available motor port.


THIS IS MY 100th POST!!!

May I ask why you are using a Flashlight? This isn’t to blind the opposing drivers, is it?

We all know how well that went…

Exactly. I’m curious what they would be useful for.

We were thinking of using them to get a better responce from light sensors for sensing starting tile, but we did not want to give up using a motor for this function

Oh, that’s cool. Any idea if it works? That could be used for detecting the colour of buckyballs during Autonomous, too.

I realized that our PLTW robotics class kits have flashlights so I will see if I can test one of them tomorrow

BAHAHAHAHAHA That is hilarious! I love Karthik’s response “Seriously?” :smiley: That was awesome.

I have had no experience with flashlights, but I do know in Gateway team 1001(H?) used a flashlight to tell if their intake had released for autonomous. That’s all I have seen so far.

At Northern New England championship some team was talking about “some idiot who asked if using flashlights to blind opponents was legal” and they didn’t realize that “idiot” was Kyle and was at the competition.

That team definitely wasn’t mine :wink:

Team 80X in Gateway used the flashlight and light sensor to make an auto-chomper of game elements. Got them an Amaze Award at worlds!

See near the front wheels…

So I have a working solution that controls a VEX flashlight using a digital port from ROBOTC (with the same control of brightness as you would get if used in a motor port). I want to get my hands on a real flashlight before releasing anything so I can make measurements of how much power it actually uses, I had guessed at 100mA but there’s a chance it’s more than that. Probably release the code in a couple of weeks. You can get a hint of how I did this from the question I asked earlier today.


I happen to have a flashlight handy, so I did a teardown and took some measurements. It is a 2x2 series-parallel array with a 240Ω limiting resistor on each leg.

At 5V, it is uselessly dim; good enough for an indicator, but not as an illumination source. When run at the nominal 7.2v, the voltage drop across each LED is 2.96V.

Here is the current draw for the whole flashlight module at various supply voltages:
*]17.9mA @ 8.4V
*]10.3mA @ 7.2V
*]3.3mA @ 6.0V
*]0.1mA @ 5.0V


This particular flashlight was purchased pretty much as soon as it was made available. It is possible newer flashlights have different characteristics.

I’ll add this info to the wiki tomorrow. [EDIT] Wiki page now posted here [/EDIT]


  • Dean
    VEX Flashlight F.jpg
    VEX Flashlight B.jpg

Thanks for testing this. So using it on the digital out 5V would probably not have a real use. If you have time could you plug the light into a power expander so it is constantly powered on from the expander to see if this works?

Sadly, I don’t think so. You would have to rewire it as a 1x4 matrix to get it to run well off 5V, but that modification would render it illegal for competition use.

Unfortunately, my power expander is packed away. I’ll try to dig it out tonight and give it a try, but I’m certain it will work.

In the past, I have run this flashlight from a MC29, so I know that works well. You want to run the motor port at full speed or the light will flicker (less than 100% duty cycle on the PWM output).

Another handy thing you can do is use a Y adapter after the MC29, and attach a pair of flashlights, one with reversed polarity. That will allow you to turn on one light (full forward), the other light (full reverse) or neither light (full stop). If you color detection scheme doesn’t require both lights at once, this saves you a MC29 and a motor port.


  • Dean

Thanks Dean, why I ever though in my wildest dreams that there might be a constant current source driving the leds I don’t know. I had hoped to drive the flashlight using an MC29 but with pwm control from one of the digital ports. The pwm and MC29 idea works, but with the way the flashlight is designed it’s obviously not going to work with a 5 volt source. I wanted to be able to use the flashlight while the robot was disabled by field control, what a PITA.

I am surprised at how little current is being drawn, the “cheap” white leds I’ve used are rated for 20mA so would have thought the whole flashlight might have been closer to 40mA. I guess with a 12V input it would be up there.

There is plenty of room in the enclosure for whatever controller you might want to add. It is 90% air :wink:

It is a shame VEX doesn’t offer something like the BlinkM RGB LED - it would be perfect for this type of thing.

If I understand the field control, it disables the motor ports by shutting off the PWM signal, but the battery voltage is still present. If that is the case, you could use one unswitched light source and a pair of light sensors, each with their own filter.

I was also surprised it draws this little power, given how bright it seems. However, it has a fairly narrow beam, so the energy is less spread out.


  • Dean

I was looking for a competition legal solution. I guess the Sparkfun led would be VexU legal.

I know it can be done using motor ports, but I had ideas about how to make the software smarter and motor ports are always a premium resource.