Go Down

Topic: Relay for Arduino (Read 1 time) previous topic - next topic

Meister_Petz

Hi,

what is the advantage of using a relais board instead of using the relais directly?

Many Thanks

Petz

pwillard


convenience... (though some would argue that some relay boards are more trouble than convenience).

If you feel comfortable making a circuit like I've attached on your own... then do it yourself and get the results you want versus some generic design that may not be what you want.


Meister_Petz

May I ask some questions to the circuit:

- What is the Reason for the R1 1K Resistor?
- Is the Diode D1 and the Transistor Q1 part of the Relay or is this a separate part to add to the circuit?

Many Thanks

Petz

CrossRoads

R1 limits the current flow from Arduino pin into the base of the transistor; the base of a transistor looks like a diode connected to Gnd. Vbe is around 0.7V.
Current thru the resistor is thus (5V - 0.7)/1000 = 4.3mA.
Diode D1 and the transistor are not part of an individually purchased relay; their equivalent may be part of a relay module; the transistor may be the output side of an optocoupler.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

CrossRoads

Attached shows the various ways a relay module may have for controlling the coil current.
The left top & bottom use optocouplers that require the Arduino to either drive high or low to put current thru the LED to turn on the output stage.
The right top & bottom skip the opto; the Arduino either drives current into the NPN to turn it on directly, or drives the voltage high to turn on the MOSFET directly.  A good design will have a resistor to Gnd to keep the MOSFET off when not connected, and a small resistor to limit Arduino current into the gate; the gate has an input capacitance that looks like a short to Gnd when switching states.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

zoomkat

Quote
what is the advantage of using a relais board instead of using the relais directly?
If the relay board uses optical isolators to control the relays on the relay board, then the optical isolator itself probably can be directly driven by the arduino output pins.

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Meister_Petz

Hi,

this relay is what I intend to use: FRS1B-S DC5V 1A/125VAC
it is for switching a 12VAC doorbell.

http://www.produktinfo.conrad.com/datenblaetter/500000-524999/505188-da-01-en-RELAIS_WASCHDICHT_1XUM__5_V.pdf

Two questions:
- what parts would I need to connect this to an arduino? Transistors, Relays, ...
- what would happen if I just connect the arduino directly to this relay? with GND and a PIN

Many thanks for the help!

Petz

michael_x

FRS1B 5V has a coil resistance of 56 Ohms or takes 0.45W. This is too much load for an Arduino Pin.
You need an NPN + a resistor between Pin and Transistor Base. And a flyback diode across the coil of course.

D1, Q1, R2 in the schematic above is minimum.


Meister_Petz

Ok, sorry for my ignorance... what is a NPN?

Many Thanks

Petz

Meister_Petz

What would be the best values for D1, Q1, R1 (is NPN a Transistor = Q1)?

Thanks

raschemmel

Q1 = 2n2222
R1 = 1 k
D1 = 1n4001 (or a schottky diode) SCHOTTKY DIODE
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

olf2012

here is one of the few relays that can be driven directly from an Arduino pin. I use them with an additional resistor of 33 Ohm, and a diode across the coil, of course. It should be sufficient for your doorbell

Meister_Petz

Many Thanks! It works fine.

That's how it looks now:


Any additional things I should change?

Petz

Go Up