Arduino Projects

Automation Using TSOP 1738 Sensor And Arduino

Introduction

Hey techies, welcome back to Techatronic. We are sure that you are aware of the term automation. This topic is in trend nowadays. So in this article, we are going to automate three LEDs using a TSOP 1738 sensor module and Arduino UNO. Make the circuit according to the given diagram and then upload the code to the Arduino. You can also check out our articles on IoT and basic electronics.

HTML Image as link
Qries
tsop 1738 sensor with arduino

Description

  • When you provide power to the Arduino then first of all LCD will display “remote control automation”, you can change this text as per your requirements by changing the code.
  • In this project, you can switch on or off the LED lights just by sending signals wirelessly.
  • You can perform these operations using an IR remote control as we are using an IR sensor module (at the receiver) for decoding the signals.
  • When we turn the lights on or off a message is appear on the LCD screen.
  • You can also check the remote control robot using the TSOP 1738 module and Arduino made by us.
  • In this project, we are using three LEDs but you can connect more DC as well as AC appliances (using relay) to it.
tsop 1738 sensor with arduino

Components Required

tsop 1738 sensor with arduino component

Circuit for Automation Using TSOP

tsop 1738 sensor with arduino circuit
  • Take the TSOP 1738 sensor module and connect its VCC pin with the 5 volts pin of the Arduino.
  • You can go through our article on the working of TSOP sensors with Arduino.
  • Join the GND pin of the TSOP sensor module with the GND pin of the Arduino.
  • Attach the OUT pin of the TSOP sensor module with the digital- pin of the Arduino. Now join the pins of 16×2 LCD with the digital pins (3 to 8) of the Arduino as shown in the diagram.
  • You can also refer to our article for making connections between the LCD and Arduino. Connect the positive leg of the first LED with the digital- pin of the Arduino.
  • Join the positive leg of the second LED with the digital- pin of the Arduino. Attach the positive leg of the third LED with the digital- pin of the Arduino.
  • Connect the negative legs of all the three LEDs with the GND pin of the Arduino via 220 ohm resistor.
  • At last, connect the 10K potentiometer with the LCD module as shown above. Your circuit is complete now.

PCBWay PCB Prototyping Services

I have assembled the whole circuit on a breadboard. As you know breadboard assembly is not effective for this type of project. So, PCBWay offers Rapid PCB Prototyping for Your Research Work. I personally, recommend PCBWay because you can get your first-try boards right in 24 hours!

PCBWay website

The prototyping stage is the most critical period of time for engineers, students, and hobbyists. PCBWay not only makes your boards quick but also makes your job right as well as cost-effective. This greatly reduces your cost and shortens the time for developing your electronic

PCBWay can provide 2 Layer PCBs to highly advanced HDI and flex boards. Even though the PCBs they produce differ a lot regarding functionality and areas of use. I am impressed with the quality of the boards, the delivery time, and the cost-effectiveness

HTML Image as link
Qries

Code for Automation Using TSOP

NOTE: Please upload this code to the Arduino. Before compiling the code you need to install <IRremote.h> and <LiquidCrystal.h> libraries so that the software does not show any error. If you don’t know how to install a zip library to the IDE then check our article on it.

// TECHATRONIC.COM  
 // IR LIBRARY LINK  
 // https://github.com/Arduino-IRremote/Arduino-IRremote  
 #include <IRremote.h> 
 #include "LiquidCrystal.h"
 LiquidCrystal lcd(8,7,6,5,4,3); 
 int val1=0; // Inializing the variable for storing the last status of Relay_pins  
 int val2=0;  
 int val3=0;  
 int val4=0;  
 int RECV_PIN = 12;  
 int Data ;  
 IRrecv irrecv(RECV_PIN);  
 decode_results results;  
 void setup()  
 {  
  Serial.begin(9600);  
  lcd.begin(16,2);
  
  // In case the interrupt driver crashes on setup, give a clue  
  // to the user what's going on.  
  Serial.println("Enabling IRin");  
  irrecv.enableIRIn(); // Start the receiver  
  Serial.println("Enabled IRin");  
  pinMode(11,OUTPUT); // LED 1   
  pinMode(10,OUTPUT); // LED 2   
  pinMode(9,OUTPUT);  // LED 3  
    lcd.setCursor(0,0);
   lcd.print(" Remote Control    ");
   lcd.setCursor(0,1);
   lcd.print("   Automation   ");
   delay(5000);
    lcd.clear();
   
 }  
 void loop() {  
  if (irrecv.decode(&results))   
  {   
   Data = results.value, HEX ;  
   Serial.println(Data);
   lcd.setCursor(0,0);
   lcd.print(Data);  
   irrecv.resume(); // Receive the next value  
   if(Data==18615)  
   {  
    val1=digitalRead(11);  
    if(val1==0)  
    {  
     digitalWrite(11,HIGH);  
     val1=1;  
     lcd.setCursor(7,0);
     lcd.print("Led 1 ON     ");
     delay(500);  
    }  
    else  
    {  
    digitalWrite(11,LOW);  
    val1=0;  
     lcd.setCursor(7,0);
     lcd.print("Led 1 OFF     ");
    delay(100);  
    }  
   }  
   if(Data==22695)  
   {  
    val2=digitalRead(10);  
    if(val2==0)  
    {  
     digitalWrite(10,HIGH);  
     val2=1;  
     lcd.setCursor(0,1);
     lcd.print("L 2 ON ");
     delay(500);  
    }  
    else  
    {  
    digitalWrite(10,LOW);  
    val2=0;  
     lcd.setCursor(0,1);
     lcd.print("L 2 OFF");
    delay(100);  
    }  
   }  
   if(Data==2295)  
   {  
    val3=digitalRead(9);  
    if(val3==0)  
    {  
     digitalWrite(9,HIGH);  
     val3=1;  
     lcd.setCursor(7,1);
     lcd.print("L 3 ON ");
     delay(500);  
    }  
    else  
    {  
    digitalWrite(9,LOW);  
    val3=0;  
     lcd.setCursor(7,1);
     lcd.print("L 3 OF");
    delay(100);  
    }  
   }
  }
   delay(100);
 }

We hope that you liked this project and understand it’s working as well. If you have any doubts regarding this post then do let us know in the comments section given below. Also, do check out more articles on Arduino and Raspberry Pi.

Thanks for reading!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button