Go Down

Topic: relay problem !! (Read 726 times) previous topic - next topic

angel545

Hi, I am currently working on a project. I am using a relay module to act as a switch and an array of photodiodes to sense whether is there any light source.

Once there is light source, the relay will be trigger and switch on my device.

I having problem with the relay module. If I just running it without using any sensors, it work just fine.(Just sending HIGH and LOW to the pin)
But when I connect it to my main circuit, which is with the sensors, the red led on relay lights up but the relay won't work.

I supposed is current not enough?

http://www.sgbotic.com/index.php?dispatch=products.view&product_id=1717

the relay I am using right now

larryd

Help us help you.
Show a schematic and image of your project.

.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

angel545

Code: [Select]

void setup(){
  Serial.begin(9600);
  pinMode(7,OUTPUT);
}

void loop(){
  digitalWrite(7,LOW);
  int val1 = analogRead(A3);
  if(val1 < 700){
    Serial.println("wake up");
    digitalWrite(7,HIGH);
  }
}





hope this helps, currently away from my desktop so drew it using hand

larryd

Is the voltage written on your relay  5volts?

I believe the coil resistance for the 5v version of the board is 70ohms (needs about 70mA to pick).

Although I do not like to supply relays with an Arduino, you should be able to drive this relay board.

If this is a current supply problem however, try connecting VCC to an external 5 volt power supply to see if the problem goes away.
No technical PMs.
If you are asked a question, please respond with an answer.
If you are asked for more information, please supply it.
If you need clarification, ask for help.

angel545

Hi, thanks for the reply
I solved this problem already. Seems like it is a coding problem
I shifted the digital write pin to low into else section and it is working now

Go Up