Go Down

Topic: help with 5v 8 channel isolated relay (Read 11459 times) previous topic - next topic

DmarkL

Hi everyone,

I must start by saying my electronics knowledge on a scale of 1 to 10 is somewhere around 1.5, I have an arduino mega that i use for controlling led`s.
As I now need to increase the number of leds used I have purchased a 5v 8 channel relay. My plan is to use the 5v from the usb to power the arduion and i have a separate 24v psu for the relay side.
I think im ok with the wiring but my question is about the three pins on the relay board marked
Gnd
Vcc
JDVcc
these have a jumper to potentially bridge beween two of the pins and i`m unsure what position I need this in.

Any help will be much appreciated,

thanks in advance,

Dave

Erdin

Did you buy it on Ebay ? (if not, you paid too much).

That board has optocouplers and relays.
The JDVcc jumper is to power the relays with the Vcc voltage (I think).
If you want to power the relays with a seperate 5V, you don't use the jumper.
Some information here: http://www.raspberrypi.org/phpBB3/viewtopic.php?t=36225
But you need a multimeter and check the traces on the pcb to be sure.

DmarkL

Thanks for the reply,

Yes I bought it on ebay.
what does JDVcc and Vcc stand for? and
if I wanted to power the relays with a seperate 5v supply where would I attach this?

sorry if this sounds dumb but it will help me understand this,

thanks again,

Dave

retrolefty


Thanks for the reply,

Yes I bought it on ebay.
what does JDVcc and Vcc stand for? and
if I wanted to power the relays with a seperate 5v supply where would I attach this?

sorry if this sounds dumb but it will help me understand this,

thanks again,

Dave



Vcc is the +5vdc source voltage coming from your arduino if you wire the proper connection pins going to the arduino board to the arduino 5V pin. JDVcc is the pin that supplies +5vdc to the relay coils. So if you wire +5vdc from the arduino to the relay board and you have the jumper connecting the Vcc pin and JDVcc pins then the relays will get their coil voltage from your attached arduino board. If you remove the jumper and wire an external +5vdc to the JDVcc pin and a ground pin somewhere then the relays will get there coil voltage from your external +5vdc voltage source.

Make sense?

Lefty

DmarkL

thankyou very much guys for the help, that is now clear..

Dave

wellman6996

The pins are marked GND VCC JD-VCC. jumper from VCC to JD-VCC for normal use. Jumpering from GND to VCC is used for a safety lockout. This prevents the relays from energising when the high voltage circuits are worked on. I hope this helps.

Wawa

My plan is to use the 5v from the usb to power the arduion and i have a separate 24v psu for the relay side.
If you want opto isolation, you have to use two independent power supplies.

A 5volt relay board needs a 5volt relay supply.
Eight relays will draw 8 * ~80mA when active. A 5volt/1Amp cellphone/tablet supply/charger could work.
If you want to use that 24volt supply, then a 24volt to 5volt buck converter is needed.

Connect relay supply to JD-VCC and GND of the relay board. Jumper removed.

Connect VCC to Arduino's 5volt pin.
Connect the eight relay inputs to Arduino output pins.

Do NOT connect relay GND to Arduino ground.
If you do, you loose opto isolation.

Write a HIGH to all output pins in void setup() BEFORE you set the pin to OUTPUT.
That prevents relay chattering during Arduino bootup.

These boards use "TTL logic", so a HIGH on a pin is relay off, and a LOW is relay on.
Leo..

myggle

#7
Jan 17, 2017, 01:57 am Last Edit: Jan 17, 2017, 02:00 am by myggle
I tested a Sainsmart 8 channel with a separate 5V1A supply, and the respective relay(s) that were called to energize, just produced a faint hummm noise and didn't click.  As I wanted full isolation in my project, another member on another thread advised me to set my pins as INPUT_PULLUP and connect VCC to Arduino's 5V pin to make the digital pins function as Arduino's ground to complete the circuit and fully isolate as wanted.  Now there are two separate circuits on the module.  A continuity test across the GND pins on the relay board proves that they are connected.

Here's the code that was shared with me, though I changed the pins to reflect my own connections.

Code: [Select]
/* 8 Relay Module configured for Opto-isolation
   Arduino UNO pins 3 to 10 connected to IN1 to IN8
   Connections: http://i.imgur.com/MDNQGeC.png */

void setup() {
  for (int i = 30; i <= 37; i++) {
    pinMode(i, INPUT_PULLUP);
    pinMode(i, OUTPUT); // defaults HIGH (relays off)
  }
}

void loop() {
  for (int i = 30; i <= 37; i++) {
    digitalWrite(i, LOW); // energize relays until all on
    delay(1000);
  }
  for (int i = 30; i <= 37; i++) {
    digitalWrite(i, HIGH); // de-energize relays until all off
    delay(1000);
  }
}


Edit - I neglected to mention that I was also advised that a minimum of 1.5 amps was needed from the separate power supply, so I have two 2 amp 5vdc supplies in the mail.

Wawa

Code seems ok.

A 5volt/1Amp supply should be ok, since one relay draws ~75-80mA.

Could you post a picture of the setup.
Leo..

myggle

#9
Jan 17, 2017, 12:21 pm Last Edit: Jan 17, 2017, 12:30 pm by myggle
Here's a YouTube link.  My phone didn't capture the humm that well, but you can still hear it somewhat.

Lack of power to relays

Edit - What has me stumped is the fact that prior to getting these suggestions, I previously fed 5V and GND from Arduino and had JD-VCC jumped to VCC, and the power that the Arduino sourced was sufficient to toggle any and every relay.  I also had an RTC and a  DHT22 sensor connected and running at the same time and the relays were given high and low DHT and RTC value, and each toggled as coded for.  My project involves a couple of 5 Amp loads on mains voltage, and I desired full isolation.

Wawa

The relay board LEDs are powered by the Mega. That part seems to work ok.

The external supply only provides power to the relay coils.
If the relays are humming (mains hum?), I expect problems with that supply.
Did you measure 5volt (JD-VCC/ground) on the relay board.

Maybe wise to wait for the new supplies.
Leo..

Go Up