I have a circuit of LEDs - say L1-L10. My requirements:

  1. No visible switch
  2. Illuminate the LEDs successively (only ever one at a time) every time the user passes a magnetic "wand" over the switch. (Mode 1-10)
  3. Using the same "wand" permit the user to set the circuit to an automatic mode whereby an LED lights for a few seconds then the next, etc. Again only one LED at a time. (Mode 11)
  4. Permit the user to turn on all LEDs simultaneously. (Mode 12)
  5. The circuit should remember which Mode was last enabled when reactivated.
  6. Battery operated 9V.

I've seen kits advertised with this type of feature using a reed switch. Thus far I've been unable to locate any information on how such a switch is used to change modes. Can anyone help me find out how this is done?

  • \$\begingroup\$ it is simply a switch, same as a pushbutton switch ... the difference is how it is actuated \$\endgroup\$ – jsotola Sep 27 '19 at 6:58

Put the reed switch from the input of a microcontroller (like Atmega, PIC, STM32, ...) to Vcc and put a pull-down resistor from the input the GND. You can now read the switching of the input like with any other button (don't forget to debounce if the reed switch contacts aren't covered with mercury).
Now you can change the modes in software and enable whatever LED you want to light up.

  • \$\begingroup\$ I'd not worked with MCs before - that was what I needed, just didn't know it. \$\endgroup\$ – JJC Sep 27 '19 at 9:22

A reed switch and magnet is the same electrically as a pushbutton switch. The rest is simple interfacing and programming a micro (or designing a logic circuit with debouncing and some flip-flops or whatever to retain the states, but a micro would be, by far, the most appropriate solution in the real world).

Speaking of the latter, if this is a homework problem, please show the actual question and your attempts to solve it.

  • \$\begingroup\$ Not a homework problem at all. Just trying to figure out how to add this functionality to a circuit In designing for a real project. I've searched the net but guess I don't know the right keywords to hone in on contextual information. \$\endgroup\$ – JJC Sep 27 '19 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.