1

I have an Arduino Uno and the I/O Shield wired up and I'm trying to switch (i.e. engage) a relay on the I/O Shield, but nothing seems to be working.

I've identified the input pins correctly and am able to send digital signals to it and it responds correctly. I also see the LED next to the relay light up when I do a digital write on the Arduino to a specific relay pin.

I'm starting to think that I might need to use an alternative power source or that I am not using the Arduino API correctly to switch the relay. At the moment I do a digitalWrite(13, HIGH), delay, and then do a digitalWrite(13, LOW) - pretty simple.

The shield is just powered by the Arduino at the moment, and I haven't been able to find where I might be able to plug in power, so I'm assuming the Arduino supplies it with all of the power it needs.

#include <Arduino.h>

int relayPin = 13;

void setup() {
    pinMode(relayPin, OUTPUT);
}

void loop() {
            digitalWrite(relayPin, HIGH);
        delay(5000);
        digitalWrite(relayPin, LOW);
        delay(5000);
}

enter image description here

  • So you did everything correctly? Then it works correctly, case closed. Maybe show someone what you did? – PlasmaHH May 24 '16 at 13:33
  • pinMode(13, OUTPUT); ? – Wesley Lee May 24 '16 at 13:34
  • yeah I setup the pin as an output as well – The Pax Bisonica May 24 '16 at 13:36
  • 2
    @wesleyLee - He is able to light up the LED which is next to the relay so I think he has declared the pin as output correctly. – Whiskeyjack May 24 '16 at 13:37
  • 2
    or that I am not using the arduino API correctly to trip the relay Arduinos know nothing about relays, they only know about pins that can be outputs and then can go high or low (or float). If the connected LED turns on and off then that part is OK. Check the supply voltage for the relay, it needs more power than an LED. – Bimpelrekkie May 24 '16 at 13:39
1

Based on your newly-added photo, you are using the Velleman VMA05 I/O Shield (or the KA-05 kit version).

This shield requires a 12V 500mA (minimum current capability) power supply input to the Arduino Uno, as that board uses relays with a 12V coil. Your symptoms (LED lights but relay does not switch) suggest that you are using a lower voltage, or lower current, power supply to your Arduino. If so, then the fix is: Use the required power supply to the Arduino.

I'm assuming the arduino supplies it with all of the power it needs.

Yes - but only if you meet the minimum requirements of the power supply which you connect to the Arduino. As documented in the Vellemen VMA05 datasheet and manual, this must be a 12V supply (not lower, not higher) capable of a minimum of 500mA.

(You would likely be able to use a 12V supply capable of a slightly lower current output, if you only wanted to have one or two relays active at the same time. However if more relays were active simultaneously, the risk would increase of incorrect or erroneous behaviour, due to the additional current necessary for each relay coil, in addition to powering the Arduino, eventually exceeding the capabilities of the power supply.)

  • I'm assuming I plug the power in to the power in pin of the arduino, from what I understand we can only supply 5v through the micro usb slot. – The Pax Bisonica May 24 '16 at 15:14
  • @ThePaxBisonica - "I'm assuming I plug the power in to the power in pin of the arduino" - Yes, using the round "barrel connector" (also called "coaxial power connector" or "DC power jack"). – SamGibson May 24 '16 at 15:20
  • @ThePaxBisonica - In case you are unsure about Arduino power supplies (perhaps you have always used the USB connection for power?) here is a link to the Arduino website explaining more about choosing & connecting an Arduino external DC power supply. Although for powering just an Arduino Uno then a 9v supply would suffice, when using your relay shield (and several other models of relay shield), a 12V supply with sufficient current capability (in your case ideally 500mA minimum) is required. – SamGibson May 24 '16 at 16:08
1

Unless you share a schematic, it will be very difficult to provide a good answer.

Here are the things that you might be doing wrong:

1) Using a power supply which is not able to provide enough current to the relay.

2) Using a power supply of wrong voltage as required by relay coil. The relay might be needing 12 V and you might be trying to power it up with a 5 V power supply.

3) You might be trying to drive the relay directly with your GPIO pin (without using any external transistor switch).

4) Trying to raise a dead relay. There is a possibility that the relay is damaged. Check it by powering it up directly using a battery or another adequate power supply that you got.

  • when you say the relay might need 12v I'm a little confused because I've looked for a power input and there doesn't seem to be any, do you mean I need to power the arduino with a 12v power supply? – The Pax Bisonica May 24 '16 at 14:16
1

Yes, 12V / 500mA supply is the minimum required for this board to work correctly. 9V will make the LED turn on but not pull the relay contacts properly. Also, I have had two of these boards where the back EMF diodes across the relay coils have gone short circuit causing excessive heating in the associated switching transistors. The solution is to replace these diodes with a more suitable 1N4001 type since the 1N4148 that is supplied with the kit is really a small signal diode and really not suitable for this purpose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy