What kind of magnetic sensor is used in rotary-control lights?

fyrstormer

Banned
Joined
Jul 24, 2009
Messages
6,617
Location
Maryland, Near DC, USA
I'm pretty sure they're called Hall-effect sensors, but all the ones I see online give some kind of digital readout in degrees or radians. If I understand anything about flashlight electronics, either the driver would need a microprocessor to interpret the digital readout, or the Hall-effect sensor would need to behave like a variable resistor so it could stand-in for the current-sensing resistor used to control the driver's output. The second approach seems much easier to implement at (relatively) low cost. Any idea if a Hall-effect sensor exists that produces an analog output?
 
Common tiny hall effect sensors are digital. All you need is a couple of them and a bunch of magnets spaced appropriately. Or you could use multiple sensors, all depends on the implementation.

uC reads the hall devices to determine activity and direction (which sensor gets activated before the other(s)).

Analog sensors exist, but for dimming control on a light, the digital ones will provide all the info that is needed.

You can search for Will's custom light, he's put speed sensing into the firmware so that you can move the ring quickly and scroll through a large range of intensity or move the ring slowly for fine adjustment.

The dimming input (whether from hall sensor or whatever) will only be an input to the uC, the uC will then control the current regulator core as needed to change the constant current or PWM current. You do NOT want to use the hall sensor as a variable resistor as the current sense resistor... There are more elegant ways to adjust output current...

cheers,
george.
 
Why not use the hall sensor as a variable resistor, if such a thing is possible? Elegant doesn't have to mean complex.

From looking at the variable brightness circuit used in the Sunwayman V10R (and V11R) when I did my Nichia 219 LED swap, my best educated guess is that Sunwayman "is" using the an analog output hall sensor. The control/driver/whatever is very simple, as these lights (V10R/V11R) are "very" susceptible to external magnets, so there is no state machine or anything like that. I recall a forum member that played with moving the magnet in the control ring past the normal detent and he was able to get an even lower "low" level, so it definitely responded to distance from the sensor(s).

Will
 
The output of a Hall effect device (sensor) is voltage, not resistance. And you have to have a significant excitation current to make them work. Thus in their raw (analog) form they are not suitable for low power circuits like flashlights (low power when off - you don't want them discharging the battery while just sitting in a drawer, or pocket, or holster).

The angular position sensors you have found are probably bulky and expensive, not to mention power hungry, so not well suited to flashlights. They are complex systems built up around the relatively simple sensors.

Clever engineers have devised ways to make low power sensors by turning them on very briefly, measuring the output, then turning them off for a while and driving a latch circuit that holds the output between samples. This happens very rapidly to detect a moving magnet, but the on time is so short that the average current is in the tens of microamps. This is insignificant to all but the smallest of flashlight batteries (20 uA would take over 80 years to discharge a CR123 cell). But these devices all have binary (AKA digital) outputs - they are either on or off. Also, they require a regulated voltage supply, typically between 2.7 and 5 volts.

If you wanted to use a Hall effect sensor in analog mode, you'd have to address the excitation current issue, then you'd have to have an LED driver that accepted an analog (voltage) dimming input. It's not sufficient to connect the hall sensor to the gate of the drive FET because the FET turns on over a fairly small and poorly defined voltage range, while the Hall sensor would have a larger output range.

The other option for magnets is reed switches. These are also binary (on/off) devices, but don't require complex control schemes that include microprocessors, though that is certainly an option. They also don't require regulated supplies, ground references, etc. so they are much more easily integrated into your system.

Lastly, georges80 didn't mention it, but he makes small boards that include a Hall sensor and high current output. They are much more sensitive than reed relays (this is a good thing) but do require a little more thoughtful design.
 
A magnetometer can be used for detecting the distance of a magnet. The distance can then be translated in the micro as brightness level. You only need one high resolution digital magnetometer that gives you as many levels as you want but with hall effect sensors, you will need many of them.
 
Last edited:
The ATTiny microcontrollers are, as the name says, tiny and are compatiable with Arduino. If you want to, you can connect one of them to hall effect sensors (or something else that detects magnetic fields) and program it to dim the light or etc.

Depending on how the sensor emits data, it could be pretty easy and short to program a dimming driver. I have not done this yet, or played with any magnetic sensors, but I have used a pot and a microcontroller to control the output of an LED via PWM.
 
IIRC, some multimore flashlight drivers do use the ATTiny chip, that or a similar PIC chip. On mouser, those chips are $0.60-1.50 for individual prices (cheaper in bulk of course, don't forget shipping!) so they don't cost too much. The cheapest has 64 bit memory and 1 KB flash. Tiny, but enough space for something simple like a flashlight controller.

The chip is 5x4x1.5 mm, 4 channel ADC, and 6 IO pins. I was thinking about buying a few (with more ram and flash) to play with.

Ooo, the cheapest µC on mouser has 16bit ram with 384 bit flash. 3.1x1.8x1.3 mm and 4 IO pins, but no ADC. That might be better for something simple light a flahslight driver, cost $0.51 for individual prices though, so migh as well "upgrade" to the attiny.

IMO a microcontroller might be the easy path to go, PWM is pretty easy to set up, but I haven't figured out current control yet though.

Edit: A 3 mode drive I got from Shiningbeam has an ATTiny 13A
 
Last edited:
Unfortunately I have zero ability to solder microcomponents with the tools I have, hence why I was looking for a "bolt-on" solution with the tiny bits pre-assembled.
 
You can get the ATTiny in DIP package, fits well on a breadboard and could be nice for prototyping (btw, you can also try reflow soldering for small SMD parts, solder paste + cooking pan or something). The size might make it harder to fit into a flashlight though.

Trying to get something pre-assembled might make it hard to program.
 
Back
Top