From googling, it appears that there are a bunch of white-labeled vendors selling the same product, with perhaps Sainsmart being the manufacturer? Anyway, I can’t find a datasheet and there are apparently many variants of the board. This one claims to have opto-isolation and requires a 20mA driver current.
I understand that a low signal to the relay turns it on and I can program the Pi to work with that fine.
Can I directly wire the relay input to the Pi’s GPIO pin? Can the Pi sink the amps or will I be eating burnt pie?
I’ve seen other schematics where folks used a transistor with resistors to enable inverted logic (high signal turns relay on) and used pull-up/down resistors to prevent floating states on startup, but for my sprinkler project that should not be a concern since I can cycle though the states on startup.
I’m thinking of connecting the 5V from Pi power pin to JD-VCC on relay and the 3.3V from Pi to VCC. Can the 5V pin on the Pi source 8 X 20 mA?
I have bought several of those blue cheap relay boards and drive them directly from the Raspberry PI. The ones I use have power connections and I run them to the PI +5 and GND, then the control lines I run off of the GPIO pins. I haven’t had any trouble running them that way, but I only click them once in a while and don’t run them with any serious duty cycle. Mine controls my garage door.
Tested the amperage draw yesterday, when a relay input is pulled to low, there is ~70 ma draw per activated relay across the JD-VCC power (the pic shows 130 ma with 2 relays activated).
Wired it up, and works fine and dandy so far. For my use case, only 1 relay will be activated at a time, so connecting JDVCC on the relay board to pin2 (5V) on the Pi is working just great.
When the Pi boots up, it looks like the Pi defaults to trying to turn on relays 1-7 (but not 8), but none of the relays click - I’m guessing there is not sufficient power. Once my app starts, it brings all pins to high and all is well. I have pin0 wired to relay1, and so on.
I’m using pi4j based on a cursory scan of the interwebs (Java guys are reluctant to learn phyton), is that the best option for Java?