206
people found this helpful, as of 2023
ranked #154,003 most helpful
out of 571,544,897 reviews
★★★★★
LOTS OF MISINFORMATION EXISTS IN REVIEWS, PLEASE READ
Making the documentation myself:
As there is no documentation, I was very skeptical of this unit trying to sink too much current to my RasPi's GPIO pins (which can only sink/source a max of 16mA per pin). Reading the datasheets for the individual components "confirmed" this believe by the Optocoupler (817C) showing normal operating current of 20mA - yikes!
I crunched the numbers and took some readings from my relay module in use and found that the unit only sinks ~2.1mA on the IN'X' pins, well within the tolerance of the RasPi (most Arduinos can sink/source 40mA or so, so even less of a problem there). The reason why is there is a 1k ohm resistor in series with the optocoupler and an LED, so basically 2 LEDs and a 1k resistor (the input side of the Optocoupler is just an LED).
Why did they make the optocoupler run at suboptimal current? It enables the relay to be de-energized when using 3.3V as is common on Arduino and is the only voltage the RasPi's GPIO can handle.
READ HERE FOR HOW TO HOOK THIS BAD BOY UP THE RIGHT WAY (WITHOUT BLOWING UP YOUR PI OR ARDUINO):
Arduino:
Most Arduinos can handle I/O DC current of up to 40mA (This relay module only draws 2.1mA from the I/O pin). You probably won't encounter a microcontroller that cannot handle this current (if you do, that means you are probably an embedded engineer and this guide isn't for you). Some Arudinos can operate at 3.3V (not from USB), if this is your case then you will need a separate 5V circuit to power the relay module.
RasPi:
Raspberry Pi's are a bit more limited I/O wise than their Arduino brethren, only being able to take I/O DC current up to 16mA. Again, this is still well within the limits. We are using the Raspberry Pi's power bus, which the supported current is dependant on the USB powersupply you have chosen - if you are using a 2A charger like you should be, you won't encounter any issues.
Relay Board:
There are two rows of input pins (GND IN1 IN2 IN3 IN4 VCC) and (JD-VCC VCC) with the latter coming with a jumper bridging the pins (keep the jumper on!). Connect a wire from GND on your device to GND on the relay module. Connect a wire from the 5V pin on your micro to the VCC pin that is adjacent to IN4 (not the one next to JD-VCC!). Also note the 5V pin I mentioned is the actual 5V rail of the micro, not the GPIO or I/O pin that you are going to be using to trigger the relay. Finally hook the GPIO or digital I/O pin up to IN1 and set the pin to 'low' or 0V in the software to activate and 'high' or 3.3V-5V to deactivate.
Special Considerations:
If your board cannot source ~60mA from the 5V rail or if your board only runs at a maximum of 3.3V you have to use a secondary power source to power the relay.
February 2016 · Electronics · verified purchase