need the simplest circuit possible to dim an led with an analogue hall effect sensor

Thread Starter

robinscottlawrie

Joined Feb 15, 2018
96
hi all, i have a project where i need an led to remain off in the presence of a small magnet, and gradually brighten as the magnet moves away (a few cm difference between full on and off i hope, although the mechanical design could be adapted for smaller distances if necessary) .

alternatively if its simpler, i guess the opposite might be acceptable, i.e. led gets brighter as magnet approaches, again with a modified mechanical design. .

i assume a hall effect sensor is the answer, and im hoping i can find one which can do what i ask with extremely minimal external components, as i have to build literally hundreds of the things for an art installation.

most of the stuff online uses the sensor as a switch, or to provide a pwm output to an arduino or similar.

i understand that analogue hall sensors will output a variable voltage depending on field strength, but i am unsure if a) one exists that can directly drive an led (ideally a fairly bright one) and b) if one exists with an inverse output so the led gets brighter with reducing field strength.

any pointers would be most appreciated.
 

sghioto

Joined Dec 31, 2017
8,633
If you find one that exists the sensor output can be configured to drive a pwm or a linear circuit that will power the LED.
EDIT: Apparently they do make some called an AH or AH5. Check out the
AH49H hall sensor which might possibly be just what's needed.
Do you have a particular LED in mind, meaning color, size and just how bright is fairly bright?
If this involves hundreds of sensors and LEDs power supply requirements are a big factor as well.
 
Last edited:

Thread Starter

robinscottlawrie

Joined Feb 15, 2018
96
If you find one that exists the sensor output can be configured to drive a pwm or a linear circuit that will power the LED.
EDIT: Apparently they do make some called an AH or AH5. Check out the
AH49H hall sensor which might possibly be just what's needed.
Do you have a particular LED in mind, meaning color, size and just how bright is fairly bright?
If this involves hundreds of sensors and LEDs power supply requirements are a big factor as well.
thanks so much for the super fast and helpful reply.


im currently at a very early stage of the project, considering methods. id imagine your typical " ultrabright" led would be fine, nothing that needs a heatsink or anything. colour tbc.

-just looked at the datasheet for that hall sensor.. wow itll handle 400mw. that should be more than enough for a decent bright led :)

regarding the power supply, to be honest for this part, its the least of my worries on this overall project, - i also have to drive an installation with 18 10m 5v led strips. 144 leds/m each one needs a circa 40 amp 5v meanwell supply. the cabling runs to feed power to both ends of the strip is giving me nightmares eeek.
 

Thread Starter

robinscottlawrie

Joined Feb 15, 2018
96
reading closer i see the output seems to do waht i want as well. with the correct input voltage id get a nice output for driving the led directly, and if i bring the north pole of a magnet closer the voltage will drop until the led goes out.

of course if i get the magnet the wrong way round ill blow the led :D
 

Reloadron

Joined Jan 15, 2015
7,852
You can start with a Google of "Linear Hall Effect Sensor" which will give you a linear output based on the magnetic field strength. Look to names like Allegro, and Texas Instruments to name a few. Fortunately these are inexpensive so you can try a few depending on the magnetic gauss strength of your magnetic field. The AH49E is a popular choice but again, depends on your field strength.

If you want to control LED i9ntensity it's normally done using PWM (Pulse Width Modulation) and a micro-controller (uC). Your Hall Effect outputs a voltage proportional to field strength and in turn your uC outputs a PWM signal proportional to the voltage in from the hall effect.


Ron
 

boostbuck

Joined Oct 5, 2017
1,032
TI's DRV5057 (for example) has a linear response PWM output at 2 kHz, which you may find more appropriate for driving LEDs.

In any solution requiring visual linear response, you will possibly find the non-linearity of the LED visual brightness is an issue.

Personally, I would be inclined to use a microprocessor between the sensor and the LED. At the added complexity of one six pin chip and the need for a bit of code, you will gain complete flexibility in the tailoring the response to whatever you find necessary as you experiment. AND changing the response or behaviour will only require changes to code, not hardware.
 

Thread Starter

robinscottlawrie

Joined Feb 15, 2018
96
Thanks for the further replies. To clarify, i am not concerned with linearity or a particularly tailored response. the individual devices are simple "flaps" which when the wind blows, move, and are illuminated. the stronger the wind, the more the flap is lifted, the brighter the illumination. many of these arranged in a long grid should allow quite nice visualisation of wind gusts and turbulence. there will potentialy be a different coloured led on each side, so when the wind changes direction, the flap will lift in the other direction, and be hit by a different colour. I appreciate that microcontrollers and code would allow more control, but honestly, i hope its not needed. im building these alone, as part of several installations and time wise there is a big difference between wiring an led to a singe component and a power source, and getting pcbs made and dealing with microcontrollers and coding, neither of which i am knowlegeable about. the original idea was to use small windmills with cheap motors connected, the windmill spins and the motor generates enough juice to light led.. no power needed. these even exist off-the-shelf. but its a beach location and the sea air and sand would not be kind to cheap motors.
 
Last edited:

LowQCab

Joined Nov 6, 2012
5,101
Don't risk your LEDs,
at the very least use a CL520N3G Current-Limiter-Chip on every LED.

This will keep the Current below ~20-mA regardless of supply Voltage variances.

These come in a TO92-Transistor-Package so they're easy to work with
and probably won't need a Heat-Sink if the Voltage is kept below ~5-Volts. ( ~3-Volts would be better ).
.
.
.
 

Thread Starter

robinscottlawrie

Joined Feb 15, 2018
96
Don't risk your LEDs,
at the very least use a CL520N3G Current-Limiter-Chip on every LED.

This will keep the Current below ~20-mA regardless of supply Voltage variances.

These come in a TO92-Transistor-Package so they're easy to work with
and probably won't need a Heat-Sink if the Voltage is kept below ~5-Volts. ( ~3-Volts would be better ).
.
.
.
i was looking at the datasheet and its not clear what the behaviour is when the input voltage drops below the threshold for putting 20ma through the led. i saw a related product (cl25) which had a graph showing the output dropping suddenly to zero below 5v.. im not sure how this would play with having the led ramp up slowly to full brightness.. i interpret it to mean that the led would either be off, or at full brightness as the constant current driver pegs it at 20ma. unfortunately my electronics skills extend to asking questions and soldering, so some playing will be necessary.
 

LowQCab

Joined Nov 6, 2012
5,101
This device has a 1-Volt Drop-Out-Voltage.

Meaning that, You need to calculate the
Minimum-Forward-Voltage at 20mA required by your chosen LED, ( at a particular Temperature ),
then add 1-Volt to that Voltage-number,
and You will now have the minimum-required Power-Supply-Voltage
that is required to push the LED to 20mA of Current.


Any other Devices, ( like the Hall-Sensor ), between the Power-Supply and the CL520 Current-Limiter,
may further increase the Minimum-Required-Power-Supply-Voltage
to achieve 20mA of Current flowing through the LED.

I'm not sure how well-versed You may be at calculating LED-Current.
LEDs operate on Current, NOT Voltage.

To calculate what is likely to happen,
the Spec-Sheets for ............
the Hall-Effect-Device,
and the CL520,
and the LED that You intend to use,
must be posted here for everyone to peruse in one spot.

As far as I know, the Data-Sheet for the CL520 does not contain any Voltage-Related-Graph,
however, the CL25 is a High-Voltage-Version of the CL525 which has a ~5-Volt Drop-Out-Voltage.

All the numbers and letters matter in a part-number.

I was wondering how You came-up with the information You did,
I could have saved a lot of time if I hadn't assumed that your part number was just a typo.

I provided a link to DigiKey's CL520 listing which includes the appropriate PDF-file,
don't use the CL25 PDF.
.
.
.
 

Thread Starter

robinscottlawrie

Joined Feb 15, 2018
96
i apologise if i wasted your time. i appreciate that the devices are not the same, i was looking at similar devices to try and find some information on their behaviour when the voltage drops below that required to supply 20ma. since the datasheet for the cl520 does not specify this information. (or at least in terms i understood), i was looking at other similar devices on the digikey site. My concern was that if the supply voltage (from the hall sensor) fell below what was necessary to drive 20ma to the led, it would simply cut out rather than gracefully dimming the led as i require. Regarding driving leds i appreciate that it is the current that counts, not the voltage - im an awful long way from being expert (or even knowledgeable), however i have used LEDs in my various little projects probably hundreds of times.
 

BobTPH

Joined Jun 5, 2013
11,463
The problem I see with a linear voltage output controlling an LED, is that an LED (white) will go from barely visible to full on over a range of about 2.8V to 3.3V. And not linearly. Unless your sensor outputs exactly that over the range of field strength your magnets provide, it will stll need further processing.

I think you will save yourself a lot of frustration by abandoning the “simplest possible” criterion. PWM, as others have mentioned, is the best practice for linear control of LED brightness.
 

LowQCab

Joined Nov 6, 2012
5,101
My concern was that if the supply voltage (from the hall sensor) fell below what was necessary to drive 20ma to the led,
it would simply cut out rather than gracefully dimming the led as i require
.
No, there is no abrupt shut-down below 20mA.
It is a " Current-Limiter", it wont let the Current "exceed" 20mA.

It also drops 1-Volt at all times.

It will not approximate a PWM-Circuit like the one above.

I've never seen a self-oscillating, one Transistor PWM-Controller,
I might have to figure that out that Circuit.
.
.
.
 

Ian0

Joined Aug 7, 2020
13,097
Ian0 meant you can't make a pwm driver that's as simple as this linear driver that I verified working as the simulator shows.
I wasn't very clear, was I? But maybe it is possible with a unijunction? Unfortunately, I don't have one in my copy of SPICE.
 
Top