dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
2451
share rss forum feed

hoolahoous

join:2004-08-25
Red Valley, AZ

wifi driven gpio circuit

I have one of the old fon wifi routers lying around. As per this link

»stupidhax.blogspot.com/2010/02/f···ake.html

I should be able to use that to drive a relay using GPIO pins. I plan to drive my garage door opener using this circuit.
The circuit diagram shown in above link doesn't give part numbers (I can write software but am an electronics noob. I do have Fry's electronics store nearby where I can buy parts) . Can you help me with part numbers I need buy ?



SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS

1 edit

Like this




I have to look up a relay

Edit: here is a relay »www.digikey.com/product-detail/e···/2034036 Sure there are others

I wouldn't follow his construction techniques

hoolahoous

join:2004-08-25
Red Valley, AZ

Thanks.. if this circuit is not perfect, how would you change this circuit ?
btw your link for relay has this spec..
Turn On Voltage (Max) 2.1 VDC

isn't the switching voltage 3.3 ?


public

join:2002-01-19
Santa Clara, CA

said by hoolahoous:

Thanks.. if this circuit is not perfect, how would you change this circuit ?

A resistor, about 1k is needed in the base of the 2n2222.
Why not switch the internal power, or better yet drive the cpu reset pin?


SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS
reply to hoolahoous

said by hoolahoous:

Thanks.. if this circuit is not perfect, how would you change this circuit ?
btw your link for relay has this spec..
Turn On Voltage (Max) 2.1 VDC

isn't the switching voltage 3.3 ?

Last question first - Relays have a turn on-turn off voltage. For this relay it's 2.1V on and 0.3V off. It means that if you don't put at least 2.1V on the coil it may not pick (turn on). Conversely, if you don't get the voltage to 0.3V it may not drop out (turn off).

The problem is there are unknowns (at least to me). I don't know what the GPIO pin is capable of supplying. Ideally, it should be at least 7 mA. A base resistor as pointed out by public See Profile should be used but I'd say ~ 270 ohms to ensure enough base current to drive the transistor into saturation.

I also don't know exactly what you plan on switching. If it's the garage door opener motor you will most likely kill the relay. It's for resistive loads. There are ways around it but it depends what you want and how much you want to do this.

Contact Spec.




--
--
--
"Facts do not cease to exist because they are ignored." - Aldous Huxley

"I’m not familiar precisely with exactly what I said, but I stand by what I said, whatever it was.." - Mitt Romney


Cho Baka
Premium,MVM
join:2000-11-23
there
kudos:2
reply to hoolahoous

Many garage door openers have a low voltage set of contacts that can be used to open/close the door when connected momentarily.
(unless I am missing what is desired...)
--
The talented hawk speaks French.


hoolahoous

join:2004-08-25
Red Valley, AZ
reply to public

said by public:

said by hoolahoous:

Thanks.. if this circuit is not perfect, how would you change this circuit ?

A resistor, about 1k is needed in the base of the 2n2222.
Why not switch the internal power, or better yet drive the cpu reset pin?

thanks for your response. as I said, I am noob when it comes to electronics so if you can translate 'Why not switch the internal power, or better yet drive the cpu reset pin?' in plain english that will be helpful.

@sparkchaser
appreciate your explanation about voltage. I am planning on driving the low voltage garage door switch (not the motor directly). can you please give updated circuit with base resister (and part number)..


SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS

said by hoolahoous:

@sparkchaser
appreciate your explanation about voltage. I am planning on driving the low voltage garage door switch (not the motor directly). can you please give updated circuit with base resister (and part number)..

Good, I was confused by your original schematic that has an AC outlet shown.

In that case you can go to a relay like this »www.digikey.com/product-detail/e···D/369039

It draws a bit less current. The resistor just goes in series with the connection from GPIO to the Base of the transistor and could be changed to 470 ohms 1/4 watt. »www.digikey.com/product-detail/e···/1830342
--
--
--
"Facts do not cease to exist because they are ignored." - Aldous Huxley

"I’m not familiar precisely with exactly what I said, but I stand by what I said, whatever it was.." - Mitt Romney

hoolahoous

join:2004-08-25
Red Valley, AZ
reply to hoolahoous

thanks so much !! you guys are expert at this. btw another noob question.. I will probably pickup the parts at local store Frys/Radioshack, (to save on shipping). so when I go to buy the parts what info do I need.. do i just ask to get a

1) 2N2222
2) 1n4002
3) 470 ohms 1/4 watt resister
4) relay with 3 volt coil voltage

and the store folks would know what to fetch ?



tschmidt
Premium,MVM
join:2000-11-12
Milford, NH
kudos:9
Reviews:
·G4 Communications
·Fairpoint Commun..
·Hollis Hosting

said by hoolahoous:

I will probably pickup the parts at local store Frys/Radioshack, (to save on shipping).

If you have to purchase the parts you are better off just going with a Solid State Relay, SSR. That will connect directly to the controller for a much neater implementation.

Just ask for a DC input SSR, Since you are controlling an Outlet need one rated for whatever current you want to switch. If this were a commercial device would need some form of over-current protection but as it is a homebrew that is up to you.

For safety there are pretty stringent separation/insulation requirements, much easier to build a safe circuit with an SSR then and EMR.

»www.mpja.com/10A-480VAC-Solid-St···7154+RL/
/Tom


SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS

said by tschmidt:

said by hoolahoous:

I will probably pickup the parts at local store Frys/Radioshack, (to save on shipping).

If you have to purchase the parts you are better off just going with a Solid State Relay, SSR. That will connect directly to the controller for a much neater implementation.

Just ask for a DC input SSR, Since you are controlling an Outlet need one rated for whatever current you want to switch. If this were a commercial device would need some form of over-current protection but as it is a homebrew that is up to you.

For safety there are pretty stringent separation/insulation requirements, much easier to build a safe circuit with an SSR then and EMR.

»www.mpja.com/10A-480VAC-Solid-St···7154+RL/
/Tom

He's not switching 120VAC. That's what I thought of at first.
He is switching low voltage but don't know if it's AC/DC.

mpja show this »www.mpja.com/IDC-5P-Input-Interf···9124+RL/ but the specs don't match OPTO22's
--
--
--
"Facts do not cease to exist because they are ignored." - Aldous Huxley

"I’m not familiar precisely with exactly what I said, but I stand by what I said, whatever it was.." - Mitt Romney


tschmidt
Premium,MVM
join:2000-11-12
Milford, NH
kudos:9
Reviews:
·G4 Communications
·Fairpoint Commun..
·Hollis Hosting

2 edits

said by SparkChaser:

He's not switching 120VAC. That's what I thought of at first.
He is switching low voltage but don't know if it's AC/DC.

mpja show this »www.mpja.com/IDC-5P-Input-Interf···9124+RL/ but the specs don't match OPTO22's

My bad for not reading the entire thread, just your schematic and his response.

Looks like the MPJA description is bad, it is an input module not a SSR:
»www.opto22.com/site/pr_details.a···em=IDC5P

Assuming he is switching DC something like this ought to work if open circuit is between 12 - 110V:
»www.mpja.com/2A-12-110VDC-Solid-···8193+RL/

If the switching current is low enough a reed relay would be a good fit. That way doesn't care if it is AC or DC, might even be able to drive it directly.

3.3v is a pretty low voltage and severely limits the kind of EMR you can use. My all purpose NPN transistor is 2N3904, I have a drawer full of them.

/tom


SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS
reply to hoolahoous

said by hoolahoous:

thanks so much !! you guys are expert at this. btw another noob question.. I will probably pickup the parts at local store Frys/Radioshack, (to save on shipping). so when I go to buy the parts what info do I need.. do i just ask to get a

1) 2N2222
2) 1n4002
3) 470 ohms 1/4 watt resister
4) relay with 3 volt coil voltage

and the store folks would know what to fetch ?

Yes, but I looked at Fry's and RS and don't see the relay. As Tom said, the 3.3V limits you. While the relays exist, they might not be readily available.

The 1N4002 could be a 1N4001 to 1N4004. The same for the 2n2222,any NPN transistor that can handle the current will probably work.
--
--
--
"Facts do not cease to exist because they are ignored." - Aldous Huxley

"I’m not familiar precisely with exactly what I said, but I stand by what I said, whatever it was.." - Mitt Romney

lutful
... of ideas
Premium
join:2005-06-16
Ottawa, ON
kudos:1
reply to hoolahoous

said by hoolahoous:

I should be able to use that to drive a relay using GPIO pins. I plan to drive my garage door opener using this circuit.

You can actually use the I2C port to drive a relay. The software is already there and the hardware is really simple - just pullup resistors on SCL/SDA lines. More details on this page: »www.dd-wrt.com/wiki/index.php/La···ware_i2c

There are also off-the-shelf I2C based relay boards. One deluxe example: »www.remotemonitoringsystems.ca/i2crdb/

hoolahoous

join:2004-08-25
Red Valley, AZ

what is advantage of i2c over above method ? also looks like i will need additional IC for i2c.


hoolahoous

join:2004-08-25
Red Valley, AZ
reply to hoolahoous

found some more details.. the reciever is genie GR390 ( »www.ehow.com/how_10019799_wire-g···nie.html ) seems it operates on 24 volts. any chance I can directly switch this without the relay ?



SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS

1 recommendation

said by hoolahoous:

found some more details.. the reciever is genie GR390 ( »www.ehow.com/how_10019799_wire-g···nie.html ) seems it operates on 24 volts. any chance I can directly switch this without the relay ?

You don't like relays?

I'd be more comfortable with the devices isolated. You could use an opto-isolator to drive a transistor.
--
--
--
"Facts do not cease to exist because they are ignored." - Aldous Huxley

"I’m not familiar precisely with exactly what I said, but I stand by what I said, whatever it was.." - Mitt Romney

hoolahoous

join:2004-08-25
Red Valley, AZ

said by SparkChaser:

You don't like relays?

I'd be more comfortable with the devices isolated. You could use an opto-isolator to drive a transistor.

good point about isolating the circuits. since i don't have too much experience with relays, are they reliable ? i mean since it will be controlling my garage door there are security consideration. can a power serge/lightning cause it to trip and open the door ?


tschmidt
Premium,MVM
join:2000-11-12
Milford, NH
kudos:9
Reviews:
·G4 Communications
·Fairpoint Commun..
·Hollis Hosting

said by hoolahoous:

are they reliable ? i mean since it will be controlling my garage door there are security consideration. can a power serge/lightning cause it to trip and open the door ?

The telephone system ran on them for a 100 years.

As SparkChaser See Profile posted you really want to isolate the two systems. Relays or optoisolator will do that. Since you aren't sure exactly what the Genie needs a relay is the safer bet, metallic contacts don't care if they are switching AC or DC (within reason for nit pickers).

/tom


SparkChaser
Premium
join:2000-06-06
Downingtown, PA
kudos:3
Reviews:
·Verizon FiOS
reply to hoolahoous

said by hoolahoous:

good point about isolating the circuits. since i don't have too much experience with relays, are they reliable ? i mean since it will be controlling my garage door there are security consideration. can a power serge/lightning cause it to trip and open the door ?

Relays are very reliable. A power surge/lightning will affect the electronics much more than any relay and as tschmidt See Profile pointed out the relay gives you more flexibility in what you can switch.
--
--
--
"Facts do not cease to exist because they are ignored." - Aldous Huxley

"I’m not familiar precisely with exactly what I said, but I stand by what I said, whatever it was.." - Mitt Romney

hoolahoous

join:2004-08-25
Red Valley, AZ
reply to hoolahoous

unfortunatly my local store Fry's was a disappointment when I went there to get parts. Each of the part (transistor etc) was about $3 each. Even with shipping digikey will be way cheaper.
Here is the part list I assembled at digikey.. can you please confirm if they are okay..

transistor »www.digikey.com/product-detail/e···D/920244

resistor »www.digikey.com/product-detail/e···/1830342

relay »www.digikey.com/scripts/dksearch···Z2909-ND

diode »www.digikey.com/product-detail/e···ND/42177


hoolahoous

join:2004-08-25
Red Valley, AZ

1 recommendation

reply to hoolahoous

thanks everyone.. I ordered the parts above and created the circuit.. it worked like a charm !!!
appreciate all your help..