Go Down

Topic: Trouble with 1-channel relay and lcd (Read 269 times) previous topic - next topic

JitenSinha

I am using this basic code to test the working of relay and lcd.

Code: [Select]
#include <LiquidCrystal.h>
#define relay 8

LiquidCrystal lcd (9, 2, 4, 5, 6, 7);


void setup() {
  lcd.begin(16,2);
  lcd.print("Testing");
  pinMode(relay,OUTPUT);// put your setup code here, to run once:
  digitalWrite(relay,HIGH);
}

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

}


During the switching of relay , the lcd shows garbage value and the delay also does not work . I am not using a relay with a built in opto-isolation circuit.The relay and lcd works fine when the motor is not connected to the relay.All the problems of halting,garbage values and delay occurs when i connect the motor to the relay.

Please Help.


JitenSinha

#2
Jun 28, 2018, 09:42 pm Last Edit: Jun 28, 2018, 09:46 pm by JitenSinha
i am using the connection similar to this :-
Instead of bulb , i am using a 6v motor.




Another thing, when i am only using the relay and the motor and switching them via arduino , no problems seem to occur.

My relay does not have opto isolation build in.

Go Up