Magnetic driven relays for LEDs

Hi everyone,
I am developing an installation that requires LEDs to be turned on when they are sufficiently away from the Arduino.
In order to do so, I cannot connect the LEDs directly to the board (need them to be wireless), but having them connected via WiFi/Bluetooth would be too expensive.

The solution that came into my mind is to use relays, driven by a magnetic field:

when the LEDs are close enough to the magnetic field (e.g. generated by a magnet) the relay would open the circuit, turning the LED off.

When the LEDs are far away from the magnet, the relay would close the circuit and turn the LEDs on.

My questions are:

  1. Is this physically possible?
  2. If so, can someone post a link where I could buy the relays?

I hope my words make sense.
Thank you so much in advance for your time and help.

Cheers!

Reed switches are designed to switch when close to a magnet. Unfortunately for you, 'close' is on the order of a couple of cm.

A what distance do you want the switching to occur?

Hi johnwasser,

that's very good news actually!
The distance for the switch to change from open to close is just fine!
Just to double check:

  • the switch is close to the magnet = circuit is open = LED is off;
  • the switch is away from to the magnet (>2cm) = circuit is close = LED is on;

Where could I buy those switches online?

You might want to look up Hall Effect sensors and switches. They come in different configurations. The sensor will give you field strength along 1 axis of the chip. The switch is used for security work usually on windows and doors. They are cheap and the only moving parts are electrons. :wink:

Just to double check:

  • the switch is close to the magnet = circuit is open = LED is off;
  • the switch is away from to the magnet (>2cm) = circuit is close = LED is on;

Use the NC side of a SPDT switch or a SPST-NC switch.

Where could I buy those switches online?

http://www.digikey.com/product-search/en/switches/magnetic-reed-switches/

How strong does the magnet need to be?

I am quite a newbie on this topic and...

With the reed switches I got a bit lost: I don't undertand if I can use them for turn the LEDs on when not affected by the magnetic field.

On the other side, the hall switches seem to be easier to use.

The magnet can be a small one (let's say a 0.25x0.25x0.25 inches).
As long as the toggle happens when the hall switch is 1.5-4 inches away from the magnet the job is done.

I checked out this product: Hall-Effect Sensor - US1881 (Latching) - COM-09312 - SparkFun Electronics
Do you think it works for me? I tried to go through the datasheet, but I couldn't understand if it was ok for me.
Again, me being newbie doesn't help, apologies for that and

Thank you so much for the help!

noidsign:
With the reed switches I got a bit lost: I don't undertand if I can use them for turn the LEDs on when not affected by the magnetic field.

You can. It's a switch; it can be used to switch things on. If necessary you can use a transistor to invert the signal or increase the current capability, but a standard small LED could probably be driven directly.

The range would be determined by how strong the magnet was (and how sensitive the switch was), but a neodymium magnet that size would be pretty strong.

If the Arduino is a necessary part and you can spare a pin then connect your switch to a pin you will use as digital INPUT HIGH (HIGH to activate the built-in pullup) and the other side of the switch, connect to ground. Then use the LOW or HIGH of that pin to tell when to light the led.

The switch can be either. I asked about magnet strength because the reed switch has to be moved to change state. Hall switches can detect small fields, there are security Hall switches that will switch on refrigerator magnets. I'd go with the linear Hall just because I could then set the distance by analog input value. Heck, you could make the led go from dim to bright just by distance away from the magnet.

I'd go with the linear Hall just because I could then set the distance by analog input value. Heck, you could make the led go from dim to bright just by distance away from the magnet.

That sounds pretty cool, but... the all thing about using halls/reeds is because the LEDs cannot be wired to the Arduino (meaning they are "wire-less"), and if I am not wrong both halls/reeds are on/off switches.

Or there would be a way to dim the light according to the distance to the magnet (without the LEDs being wired to the Arduino)?

BTW, thank you so much for the help.

Could he use RFID and have the code say when the tag gets to a weak signal turn on the LED? New here so don't bet on it, just a thought.

Linear Hall sensor is analog, it lets more current through with stronger field strength.
Without the Arduino you might use a transistor, a resistor or 2 and power with led and Hall sensor.

OTOH a circuit of power --> resistor --> led --> ground that lights the led could have a Hall sensor added:

power --> resistor --> X --> led --> ground, and from X --> Hall device --> ground

Then as the Hall detects strengthening field (closer to magnet or coil) it bleeds more current to ground and the led dims until it is off. Or if a reed or Hall switch; click, led turns off.

There are Hall switches and you do have to be sure -which- Hall effect device you buy because there are different packages. The switches are usually called security switches but at Mouser I see terms like 'bipolar' and 'omnipolar' with 'latch' for the switch types and 'linear' for the analog sensing types. They just wrap the effect with parts to suit different applications.

http://www.mouser.com/Sensors/Hall-Effect-Magnetic-Sensors/_/N-6g7q4/

I misread your 1st post, was thinking you were showing distance of Arduino from the magnet. :astonished:
Sorry, my bad. =(

noidsign:
the LEDs cannot be wired to the Arduino (meaning they are "wire-less")

Obviously you will need some power supply and control circuit wired to the LEDs. Any restrictions (size? cost?) on what those consist of?

The logic of a typical reed switch is the reverse of what you want, but you'd only need a transistor to invert it. So your remote unit would consist of LED, battery, reed switch, transistor and a couple of resistors. It's hard to see how you'd get a smaller or cheaper solution than that. It's not especially flexible though - it would only give you on-off control, and the only way to control the range would be to vary the strength of the magnet.

You don't need the transistor. I guess what I tried to show above isn't clear.

Heck, if you power it with a single 1.5V battery you might not need the resistor!

Hi all,
thank you so much for the help!

I managed to achieve the goal with a reed and a transistor!
For future reference here I attach the Frizing and a short demo video.
Happy holidays to everyone!

Video: Hall effect - YouTube
Frizzing: http://fritzing.org/media/fritzing-repo/projects/h/hall-effect/fritzing/cheers_LED_breadbord.fzz