Illuminating LED from linear Hall-effect device

Started by David, January 06, 2009, 09:23:18 AM

Previous topic - Next topic

David

I am trying to recreate a project Brett Robinson did a long time ago.  I'd like to use an Allegro Semiconductor A1302 linear Hall-effect device to control the brightness of an LED. Well, 2 LEDs actually.  I'd like to be able to drive a 3-terminal Rock'n'Control from it.  This project has languished for a long time -- because of a magnet.  That's right, a magnet.  The area I live in is Siberia when it comes to hobby shops, and the only bar magnets I could find on-line required quadruple their cost to ship.  In the process of cleaning the basement recently, I found a discarded toy of my daughter's that just happened to be chock-full of magnets that were the exact type and approximate size that I needed.  That takes care of the magnet part.

The pedal part I took care of a long time ago.  I have a prototype for a pedal which appears to be easy to construct and implement.  In contrast to Mic Farlow's excellent products, mine is not intended to be self-contained.  It's intended to be integrated into a larger device.

The final piece of the puzzle is that it appears that I need to translate the voltage output of the Hall-effect device into a current to illuminate the LED.  This begs the question, "how do you convert voltage into current?"  A Google reference indicated that somebody asked that very question on an electronics forum, and was laughed iinto oblivion.  I am trying to avoid that person's fate.  Google searches I have done indicate that I might do this as simply as sticking a resistor between the 1302 and the LED.  Other searches indicated that I can do it with a "cathode follower", a "voltage follower" or a transconductance amplifier.

Can somebody give me a clue as to how I might do this?  Thanks in advance!

PerroGrande

#1
The datasheet indicates that the Hall Effect sensor you mention can (at absolute maximum) sink 10mA of current.   If you're not certain that the device can drive your LED correctly, you'll need something to be a current amplifier following the Hall Effect device. 

There are several ways to accomplish this, mildly complicated by the fact that the device can swing to both power supply rails.   At zero field, its output sits at half of the supply voltage.  (Note -- you'll need to provide this thing less that 8v, which is its absolute maximum. It looks like it is really made to run at 5v).  Its output swings positive due to south magnetic fields, negative due to north.   Of course, you don't have to run the sensor and the rest of the circuit off the same supply (you could provide a different (lower) voltage to the sensor).

Some ideas that immediately come to mind:

1) Op-Amp buffer to provide extra current to the LED
2) MOSFET source follower
3) Emitter Follower
4) A better idea thought of by someone else :)


At some point, you'll need to compensate for the "offset" that the sensor does naturally (1/2 supply voltage output = 0 input).  If you DC couple the following stage, it, too, will contain some variety of this offset.  There are numerous ways to accomplish this as well.  If you don't do this, the LED will light with zero input, which is probably not what you're after. 

PerroGrande

I suppose I need to ask a few more questions...

Do you care about the polarity of the magnetic field that is driving the sensor?  An LED is, after all, a diode and will act like a rectifier.  The take-away from that is that with only 1 LED (and without any additional circuit tricks) you'll only get illumination on *either* positive-going *or* negative-going waves, depending on the orientation of the diode in the circuit.

So -- you *could* try to run an LED directly off the sensor with a resistor to ground to both limit current and to float the diode.  With only 10mA of source current from the sensor, it is a bit unlikely that this will work as well as hoped, but might be worth a try.  You'll only "see" 1/2 of the waveform, though.

David

Now the ball is rolling!  I've already tried to think some of this out.  What I had intended to do was use the side of the magnet that makes the sensor decrease voltage output as the magnet approaches.  I expected that this would decrease the brightness of an optocoupler LED.  My plan was to somehow rig this to give me a swing of 0 - 100K on the LDR portion of the optocoupler (although I have a backup plan to use a 0 - 10K swing if that's all I can get).

PerroGrande

That would probably work.  I figured that an opto-coupler was in the works somewhere, but wasn't certain. 

I think it is always worth a try to do the "simple" method first -- and in this case, try illuminating the LED directly from the sensor.

A couple of caveats, though. I don't know if the sensor is protected from damage in the case of output current overload.  It *probably* is okay, but I wouldn't want you to smoke your sensor if the output current requirement exceeds the capability of the unit.  Secondly, remember that once the LED falls out of forward biasing, it will shut off fairly abruptly.  This may not be the behavior you want.  Essentially, if the field falls too far (LED no longer biased), it will just shut off...


David

Quote from: PerroGrande on January 06, 2009, 11:21:46 AM
That would probably work.  I figured that an opto-coupler was in the works somewhere, but wasn't certain. 

I think it is always worth a try to do the "simple" method first -- and in this case, try illuminating the LED directly from the sensor.

A couple of caveats, though. I don't know if the sensor is protected from damage in the case of output current overload.  It *probably* is okay, but I wouldn't want you to smoke your sensor if the output current requirement exceeds the capability of the unit.  Secondly, remember that once the LED falls out of forward biasing, it will shut off fairly abruptly.  This may not be the behavior you want.  Essentially, if the field falls too far (LED no longer biased), it will just shut off...



If I use one of these:

1) Op-Amp buffer to provide extra current to the LED
2) MOSFET source follower
3) Emitter Follower

to drive my LED, will this minimize or eliminate the LED bias fall-off you identified?  What prevents this in Anderton's de-scratch mod?

PerroGrande

I'm not familiar with the mod in question.  I take it you're looking to accomplish something similar to: http://www.geocities.com/thetonegod/rockncontrol/rock.html

except instead of using an external pot, you want to control the LED/LDR portion of things by moving a magnet and using the output of the hall effect sensor to drive the LEDs?


David

Quote from: PerroGrande on January 06, 2009, 01:16:03 PM
I'm not familiar with the mod in question.  I take it you're looking to accomplish something similar to: http://www.geocities.com/thetonegod/rockncontrol/rock.html

except instead of using an external pot, you want to control the LED/LDR portion of things by moving a magnet and using the output of the hall effect sensor to drive the LEDs?



Correct.  This results in the only mechanical function being in the wah pivot.

PerroGrande

David,

You can try something like:



This is a very basic envelope detector like the one used in the Nurse Quacky.  Ignore the pinout of the Hall Effect -- yours might be different. 

You can probably increase the value of R5 a bit. 

Optionally, you can move R5 to the LEFT of the LDR's LED (in series before the LED) and put a capacitor to ground at the junction point (between the re-positioned R5 and the LDR).  This will slow down the "attack" of the circuit, which may make things more controllable.  Just an idea to get things started.

brett

Hi
my potless wah simply used a standard Dunlop design, but replaced the pot with an LDR.  A small neodynium magnet (1/16th diameter, 1/32nd height) under the footplate was enough to vary the hall effect device output from about 1.5 to 2.5V (it was powered by a 7805 5V voltage regulator).

As David noted, a series resistor can work for connecting the HED to the LED.  I used a small value resistor in series with the HED output (somewhere about 47 ohms should be good) was just right (I used a yellow LED, which probably had a Vf of 2 V and a current limit of 20 or 50 mA).  So 2.5 V - 2 V, divided by 47 ohms is about 10 mA.
cheers
Brett Robinson
Let a hundred flowers bloom, let a hundred schools of thought contend. (Mao Zedong)

PerroGrande

Brett,

That's good to know.  I wasn't certain that the Hall Effect sensor would safely drive the LED, but figured it was worth a try first.  Thanks for sharing your experiences!  :)

David

Brett:

Thanks for checking in!  Hope things are going well.  The whole reason I started this thread is that you have a post from 2004 or so that states that you hung an emitter follower after your Hall-effect device to drive the LED.  I couldn't find a schematic.  I DID find one online, but got rid of it when I decided I would go with the LED/LDR technique -- which I have not been able to implement to save my life.  And of course, I can't find the stupid thing!

And Perro, thanks for your help too!

Paul Perry (Frostwave)

PerroGrande, my understanding is that the hall device puts out a voltage that varies with the magnetic field across it.
So I think there is a problem with the 10uF electrolytic C1, surely the output must be direct coupled?..

As for the question about magnet polarity, yes, it matters! And one more thing for people experimenting with Hall devices, you need a linear one for this application (that is, voltage out varies linearly with the magnetic field) and these linear ones are much rarer than the digital kind, that has an output that just snaps from off to full on when the magnetic field reaches a certain point.

David

Quote from: Paul Perry (Frostwave) on January 07, 2009, 08:08:59 AM
PerroGrande, my understanding is that the hall device puts out a voltage that varies with the magnetic field across it.
So I think there is a problem with the 10uF electrolytic C1, surely the output must be direct coupled?..

As for the question about magnet polarity, yes, it matters! And one more thing for people experimenting with Hall devices, you need a linear one for this application (that is, voltage out varies linearly with the magnetic field) and these linear ones are much rarer than the digital kind, that has an output that just snaps from off to full on when the magnetic field reaches a certain point.

Good points all, Paul!  I have already tried to take them into account.  The A1302 is ratiometric (read "linear") and cheap.  It was available from multiple sources here in the US.  If I remember correctly, I also checked into whether it could be sourced outside the US.  The whole purpose of this thread was to determine how I could reliably use voltage to vary current to the LED component in an optocoupler.

earthtonesaudio

Keep in mind an LED's light output does not change linearly with current. (might not be a problem for you though)

If I already had a nice linearly variable voltage soruce and I wanted to sweep a filter or volume pot, I'd go straight for an OTA-based, or even PWM-based design.  Trying to get an LED biased correctly is troublesome.

PerroGrande

#15
Good point on the capacitor.  I thought that the item of interest was the *change* in the incoming voltage. My bad.

I'd still try running it directly first and see what happens.  You may get what you're looking for without any additional complexity.

David

Quote from: earthtonesaudio on January 07, 2009, 09:32:27 AM
Keep in mind an LED's light output does not change linearly with current. (might not be a problem for you though)

Not to dispute this, but Craig Anderton used an optocoupler in his wah pot descratch widget, and the Tone God uses optocouplers in the Rock'n'Control.  Perhaps the LDR masks this non-linearity.  R.G. has said of Anderton's widget "it works, and it's very smooth indeed"

PerroGrande

If you find that you want/need to drive multiple LEDs, etc, and the sensor doesn't have enough current you can do (among other things):


David


PerroGrande

Regarding dimming LEDs...

I've done some reading on this, because in one of my many "other" interests, I build a lot of LED-based illumination devices (including IR and UV stuff). 

An LED's output is NOT linear as a function of voltage.  Because we power most LED's from a voltage source (fixed voltage power supply), we end up using a series resistor to not only limit current (avoid the untimely death of an LED), but to approximate a current source.  While this method isn't truly linear, it is close "enough" for many uses.  Alternatively, one could use a current source to drive the LED and vary the current running to it.  As long as you're within the compliance of the current source (and not above the current capability of the LED) this too will work. 

Purists will tell you that varying the current into an LED *will* dim the device, but it will also cause it to change color slightly.  Depending on what one is trying to accomplish, this may be an issue.  Also, diodes vary, so if one is attempting to dim a bank of LEDs this way, some may shut off completely before others do, etc.

Pulse Width Modulation (PWM) as was mentioned earlier on this thread is the widely accepted way to dim LEDs without color shift.

However, for your application, I'm going to guess that the series resistance will be "close enough" to give you controllable behavior.