Show Posts
Pages: 1 ... 16 17 [18] 19 20 ... 22
256  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 04, 2009, 12:49:45 pm
Really you just have to look around and find a relay that fits your criteria. If it fits it's good enough. ;-)

That one is expensive though.

Just look around at electronics sites until you find something that sounds good. It sounds like what you are looking for is a 5V coil DPDT (dual pole, dual throw) relay with a 15A 12/250v contact rating. Hopefully you can find something cheaper than the one I linked to above.
257  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 04, 2009, 12:16:50 pm
That should work. The only thing I'm a bit unsure of is whether you can get a 5V actuated relay that can pass 120AC 15 or 20A power through it (for use as the relay to control the three way switch.) You should be able to get a 9V or 12V actuated relay that can do that. So you might need to use a transistor to actuate the three way switch relay. Most arduinos are powered off of a 9V wall wart so if you get a 9V relay you should be able to actuate it with the power from the wall wart. Granted, I don't know how you plan to power your arduino.

Then eventually you'd want a 120V actuated relay for use in determining whether the lights are turned on or not.
258  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 03, 2009, 10:58:41 pm
Yeah, under the circumstances it's a lot easier to pay a little extra and get a 120AC actuated relay than to deal with the the alternative. It's a mess. That's sort of what I was trying to get at. I'd stick to the 120AC relay if it were me.
259  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 03, 2009, 04:59:38 pm
To get 120AC (RMS) down to 5V you could use a voltage divider and diodes. The problem is that the step from 120 (RMS) which is really 110 x 1.4 (approx) at peak (154V peaks) to 5V DC is LARGE. A voltage divider with large resistance values would work to step down the power without a lot of waste but the 5V relay will want some amperage.

There is an interactive javascript voltage divider calculator at:

Now, assume your input voltage is 154 DC (This goes in the battery voltage area). Say that the relay takes 100ma. (Enter 0.1 in for current).  Your V out is 5v. Then click calculate. This will show you the resistances you need for a voltage divider for this circuit. The resistances aren't bad. (1490 and 50). But look at the power going through R1. It's nearly 15 watts of power. All of this resistance will manifest as heat. You'll need a pretty hefty resistor to handle that sort of load. The 50 ohm resistor can be seen to need only a 1/2 watt resistor, though you should use a 1 watt for safety.

I quickly drew up a simple schematic of a fairly low complexity way to go about it. Remember that you need some hefty wattage resistors. (Editting this message yet again...) Also, remember that I've sort of ignored showing a ground, and that relays are an inductive load so don't let this circuit touch anything with sensitive electronics unless you properly compensate for that. That would involve putting at least a diode in reverse across the relay connections.
260  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 03, 2009, 12:08:49 am
The second relay would be one whose coil is activated by 120ac. That way it closes when the coil is charged at 120ac. You put it in line with the lighting wiring so that when the lights get power so does the relay's coil. When it closes it completes a circuit. That circuit sends 5V to an arduino pin. When that pin gets it's 5v you know your relay is closed and thus the light is on. I gotta get to bed. Hopefully all of this has been helpful. G'night.
261  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 03, 2009, 12:04:04 am
I like your idea too. I was constraining myself to doing it as a three way switch but your idea is cleaner.

There are a couple of minor issues with your plan but so long as he doesn't care it'll be a LOT simpler. The biggest issue is that it'd be possible to have both switched on which means both need to be turned off to shut the lights off. You can't switch one or the other. This may or may not be a big deal.

Realistically your idea is so simple and brilliant that I would use it if I were him as long as he can live without a three way switch. Even if he uses a three way switch configuration I'd still use your idea of a second 120AC relay to figure out if power is flowing. Good idea! Who knows why I wanted him to do it in such a difficult way... Maybe it's not a good idea to give people advice at midnight... Yawn... To bed for me...
262  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 02, 2009, 11:40:50 pm
That's an awesome idea (using the inductor).
Now this brings up the question of safety. How can I make my inductor more safe. I'm aware of the possible 'complications' if the inductor, for whatever reason, were to make contact with the live 110 wire... YIKES ! How can I make this more safe ?

Well, there isn't any real danger so long as you don't break the insulation around the wires you are testing. It's not a great idea to put the inductor really close to the end of the wire where it has to be bared. Put it at least a few inches away and there really isn't a whole lot of danger. Standard wiring is rated up to 600V. I don't remember the dielectric breakdown voltage but it would practically take a lightning strike to do that. So, in a lightning strike you are likely to see your arduino blow up. If you want to prevent that you'll need optoisolators and then you'll definitely need an amplifier.

Also about amplifying the signal, how can I go about doing that, using another transistor ?

I don't think that an inductor would properly turn a normal transistor on. It's likely to be too weak. You'll need an amplifier IC. You can get them really cheap.

Also, I forgot, an inductor will produce AC voltage. You'd have to run it through a diode before it would be safe to run it to a pin on the arduino. Of course, most diodes have a drop of at least .3v so if the inductor can't produce more than that you'll never see it.

And about the 3-way relay wiring, I still don't get it but bare with me. I'll sit on it for a day or two and I'll figure it out, ha ha.


Go there. The picture is really about the clearest that the concept can be explained.
263  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 02, 2009, 11:23:18 pm
Oh, I forgot to answer about the relay (apparently I like posting a lot...)

You need a relay that has a set of connections which are connected when the relay is open and a set which is connected when the relay is closed. This isn't uncommon in industrial control relays.

Three way switches have a red and black wire that they use instead of just black. You hook the reds up to either open or closed connections on the relay and the blacks to the other.
264  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 02, 2009, 11:20:37 pm
How you get data back from the inductor to the arduino is to put one end of the inductor into the ground lead and one into an analog pin. But, like I said, you'll likely actually have to amplify the signal. Otherwise it might not even be strong enough to make it's reading larger than the normal 2-4 value fluctuation. If it's strong enough to register even 20 or 30 (which is something like a 1/10 of a volt) then you are set. You just check to see if the pin is reading 20 more than it usually does. If it is then you've got power running in the wires.
265  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 02, 2009, 11:16:39 pm
Adding to what I said,

The inductor would need a LOT of turns in order to achieve any sort of voltage all by itself. It's likely that it's output would need to be amplified to be reliable. One way to test is this:

Take an old lamp and split apart the two wires of it's cord (at least for a little ways). Now wrap something like 100 - 200 turns of 28 gauge electromagnet wire around one of the wires (don't strip those lamp wires! I don't want to explain anything to your parents and/or widow) Strip off the insulation from both ends of your new inductor, turn the lamp on and use a multimeter to test how many volts you get from your inductor. It almost certainly won't be a whole bunch.

It goes without saying that you should be really, really careful when wrapping wire around 120AC lines.
266  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 02, 2009, 11:09:36 pm
Yikes... That'll complicate things... Well, you'll have to wire your relay like a three way switch. That is, it'll sort of have a power wire on both sides (open and closed, one with the red wire, one with black). Then you'd need to actually directly sense whether current is flowing (if it is then obviously the light is on). You could use an inductor wrapped around the wires. If current is flowing in them it'll flow in the inductor as well. This isolates you from having to directly sample 120AC.
267  Forum 2005-2010 (read only) / Interfacing / Re: How to determine current in line ? on: January 02, 2009, 04:16:17 pm
Well relays are not that difficult to use. Just need to connect Arduino to MOSFET, and MOSFET in turn switches on the relay. You cannot connect the relay directly to the Arduino

Google around for more information about relays and MOSFETs.
P.S. For a mosfet I'd suggest the IRF530 - its common and cheap

While one CAN use a MOSFET for this purpose I'm not sure I'd recommend that for a newbie. The reason being that MOSFETs break if you look at them funny after skuffing your feet on the carpet. A bipolar transistor is a lot less prone to failure from accidents. The only real downside of a NPN or PNP transistor is that it takes a little bit of current to keep it going. This should be no problem at all in a power switching circuit.

I suppose this isn't an issue if you've got some to spare and/or you have an anti-static wrist strap.
268  Forum 2005-2010 (read only) / Interfacing / Re: How do I control fan speed on 12V DC fan? on: January 06, 2009, 10:02:19 am
It will indeed work as you said. It's 1% off of the target. Of course, all those resistors being 5% you could be off by an additional 15% but it's pretty unlikely. ;-)
269  Forum 2005-2010 (read only) / Interfacing / Re: Automatic door on: January 06, 2009, 02:11:24 pm
Just keep in mind that the device linked to above is a "fail safe" design which is a misnomer if I've heard heard one. By fail safe they mean that your door is wide open when the power dies. Sure, that'll save you if there's a fire but it'll also let any Tom, Dick, or Harry into your house in the case of a power outage. It's better to get a lock which defaults to locked and must be actuated to unlock. For safety there should be an inside latch to open it in case of power outage.
270  Forum 2005-2010 (read only) / Interfacing / Re: Will this power supply work? on: December 31, 2008, 10:06:06 pm
Oh wait! Positive on the outside? I think that's wrong. !
Can someone confirm for sure whether + or - should be on the outside?

Sigh... You mean I have to get up and walk 20 feet to look at the plug? ;-)

I looked and it is positive center.
Pages: 1 ... 16 17 [18] 19 20 ... 22