Working with Relay Brick

Hi there,

I'm doing this project where I need to turn on 220V lamp using Arduino. I got myself a 5V Relay Brick Module from ITEAD Studio (the one like this http://imall.iteadstudio.com/prototyping/electronic-brick/im120710007.html which able to output 250V max. I tried testing it using a 50W 12V DC lamp, connected to the relay and then to the Arduino using this schematic

Note that I just copied it blatantly from that DFRobot doc since I couldn't find a tutorial from ITEAD Studio, but I assume it should be the same.

I also used this bit of code

//Arduino Sample Code
//www.DFRobot.com
//Last modified on 14th March 2012 by HJS
//This code has been updated to work with the sample code provided in the Wiki
 
int Relay = 3;
  
void setup()
{
  pinMode(13, OUTPUT);         //Set Pin13 as output
  digitalWrite(13, HIGH);     //Set Pin13 High
  pinMode(Relay, OUTPUT);     //Set Pin3 as output
}
void loop()
{
          digitalWrite(Relay, HIGH);   //Turn off relay
          delay(2000);
          digitalWrite(Relay, LOW);    //Turn on relay
          delay(2000);
}

However, I couldn't turn on the lamp. I can hear the click that I assume is the sign that the relay is working. Is there anything I did wrong? Or, should the schematic be okay if I use a 220V lamp?

hmm, I measured the output voltage, it only produces some 5V. so, how do I supply more voltages to the lamp? Is it because I only supply the relay from Arduino's 5V output?

You need to show us how you are wiring the relay's output up, that is the common and normally open contacts. The drawing you show is just switching arduino +5vdc to power a led on and off, and that would work, but there is no way that drawing would show you how to wire up a 50 watt 12vdc lamp circuit to the relay's output contacts. The fact that the relay clicks says your sketch code and wiring to the input circuit to the relay is fine and working but you need to more clearly show what and how you want to control something using the relay's contacts output wiring.

Lefty

ah yes. so, as I said I just followed blatantly the above schematic, the Lamp that I used looks like this

I couldn't figure out which one is the anode and which one is the cathode, so I just plug on of its pin to the Arduino's ground and another pin to the NO pin of the relay. Then, the COM output of the relay is connected to Arduino's Digital Output Pin 13, which is turned HIGH, thus providing it with a 5V output. I'm pretty sure this isn't the correct setup since I couldn't get a bigger voltage output than 5V.

Most incorrect indeed. There is no way you can power those lamps with just an arduino board, it just does not have the current requirements needed. You will have to use an external power supply with those lamps. We would need to see a link to a datasheet for those lamps to be of any further help to you on this matter.

Lefty

yeah, I think so. I'll tinker with it again later tonight since I have to go to work now. So I should use like a 12V power supply then? I don't have the datasheet of the lamp, it's just a cheap lamp I could get and the packaging only says 12V, 50W and that's it.

lunchboxav:
yeah, I think so. I'll tinker with it again later tonight since I have to go to work now. So I should use like a 12V power supply then? I don't have the datasheet of the lamp, it's just a cheap lamp I could get and the packaging only says 12V, 50W and that's it.

So yes, you will require a 12 volt power source rated at 5 amps or higher to power that lamp. You didn't state if it's a AC or DC lamp? Without a datasheet we really don't know what you are working with, but certainly it's not something you can power with an arduino board, but yes you can control it with an arduino board via your relay board and an external power supply.

Lefty

oops, sorry it's a 12V DC lamp. I think I have a suitable power supply for that. Will give it a try later. Thanks for pointing me out :slight_smile:

Anyway, is there anyway to dim lamp using relay? I figure that the lamp would only turn on and off since it relies on the bridge inside the relay, and there's no halfway bridged connection. Am I right? So how do I dim the lamp?

lunchboxav:
oops, sorry it's a 12V DC lamp. I think I have a suitable power supply for that. Will give it a try later. Thanks for pointing me out :slight_smile:

Anyway, is there anyway to dim lamp using relay? I figure that the lamp would only turn on and off since it relies on the bridge inside the relay, and there's no halfway bridged connection. Am I right? So how do I dim the lamp?

To dim the light would require that rather then using a relay you would use a power transistor to switch power on and off to the lamp at a variable duty cycle by using an arduino PWM output pin to control the power transistor. The relay being a electromechanical device is not capable of switching on/off fast enough to accomplish dimming control and the relay's contacts would soon be worn out in such service.

Lefty

ah, I get it. okay then. so can i use transistor for 220v ac lamp? I understand that it's okay to use it for a 12v dc one.

lunchboxav:
ah, I get it. okay then. so can i use transistor for 220v ac lamp? I understand that it's okay to use it for a 12v dc one.

No, AC power control usually involves using solid state relays (SSR) that are usually Thyristor based (SCR or Triac devices) for simple on/off applications but for dimming of AC lamps requires more complex phase controlled SSR devices.

Lefty