NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Basic Electronics » What's the part I need?

February 23, 2010
by rdalton
rdalton's Avatar

I want the controller to be able to turn on and off a 24V (i think DCV) magnet. It's being powered from a 110V house outlet but goes through a conversion brick (like all laptops have).

Theoretically, i can just pass an on/off to a pin and this device will turn on the magnet without risking a full 110v rushing into the controller melting everything.

In a more generic world, i'd like to be able to control the 110v side so i could use this with any household item. But just doing the 24v is sufficient now.

I think it's a relay but I don't understand all the options on how to choose one.

I can't seem to find any 5V to 24V relays. Can I just use anything higher? (i.e. 5v to 64v?) Do i need to worry about amperage ? Does the DCV require different parts than would another type of V? I've heard of x10 modules that do this but am wary of dealing with them considering the number of pop-ups and spam they put out. I can certainly go that route.

Any suggestions of websites that break down the specs of electrical components? Resistors are done everywhere but I can't find too much information on relays or stepper motors.


February 23, 2010
by mongo
mongo's Avatar

Best bet for a turn-key operation is a solid state relay. Though not a commonly available component, they are around. Simple hookup, the input takes anything from 3V to 30V DC and the output simply goes in series with the load. There are cheaper ways to go but this is the easiest.

February 23, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi rdalton,

I'd recommend you actually check whether the load you're trying to switch is AC or DC, because DC may have an easy solution. First, look on the "brick" -- it should indicate whether the output is DC or AC. (Sometimes, there are two parallel lines, one solid and one dashed, to indicate DC -- or a squiggly line to indicate AC.)

Another technique is to take an LED and put a 1K resistor in series with it, so you have two terminals (call them A and B) -- one of the LED terminals, and the open end of the resistor. Connect A and B to the output of your brick, and see if the LED lights. Then, reverse A and B, and again see if it lights. If it lights one way only, it's DC, and if it lights both ways, it's AC.

If it's DC, then figure out how much current the magnet is drawing, and you can actually make this all work with a single MOSFET as a switch -- just like in our Motors and Microcontrollers video.

However, there's a reasonable chance that your magnet is on 24V AC, at which point the MOSFET solution is no good. (There's a source-to-drain diode in the MOSFET that will get in your way.) I'm only guessing that it might be AC because an electromagnet won't care too much either way, and the original manufacturer could probably have saved a few pennies with the cheaper (AC) transformer brick.

Let us know what happens!


February 23, 2010
by mongo
mongo's Avatar

Here is a link to what I was referring to:


February 27, 2010
by Hexorg
Hexorg's Avatar

I was thinking about making the same device (that controls any 110VAC appliance), except with computer's parallel port, not nerdkit... Parallel port on my machine sends 3.3V on 1, and about 0.01V on 0

So I figured easiest scheme would be

|Extra power supply|---+--------+
+==================+   |        |
                       |        |
+==========+   +=======+==+  +==+==+  +=========+
|pin output|---|transistor|--|Relay|--|wall_plug|
+==========+   +==========+  +=====+  +=========+

Post a Reply

Please log in to post a reply.

Did you know that you can build an analog amplifier with one transistor and a few resistors? Learn more...