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?
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.
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.
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.
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.
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
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.