Infrared receiver which is a special photodiode

Infrared Sensor:  Infrared Sensor is a sensor that measures the light radiating from an object in front of it and detecting if the light reflected back or not. An infrared sensor consists of IR transmitter, which sends an invisible light to a human being using a light emitting diode (LED) and the distance can be adjusted by an adjustable potentiometer. An infrared sensor also consists of IR receiver which is a special photodiode that only detects infrared light. When the IR transmitter sends a light if there is an object comes across the light some of the radiation reflects back as shown in the figure below.  Infrared Sensor Layout: #    Description1    VCC2    GND3    OUT4    Distance Adjustable 5    IR Receiver6    IR Transmitter7    Obstacle LED8    Power LED Infrared Sensor Specifications:Operating Voltage    3.0V to 5.0VCurrent    3.3V: approximately 23 mA 5.0V: approximately  43 mADetection Range    2cm to 30cm (Adjusted using potentiometer)Detection Angle    35oActive output level    Outputs Low logic level when obstacle is detectedLED    Onboard Obstacle Detection LED indicatorOnboard Power LED indicatorDimensions    3.1cm * 1.5cmTesting Infrared Sensor:Testing Infrared Sensor Arduino code:int inputPin = A0;void setup() {  Serial.begin(9600);  pinMode(inputPin, INPUT);}void loop() {  int inputStatus = digitalRead(inputPin);  Serial.println(inputStatus);  delay(1);}Schematic Diagram for Testing Infrared Sensor: Tuning an Infrared Sensor: 1.    Put a paper in front of the infrared sensor.2.    Adjust the distance by adjusting the potentiometer until the obstacle LED turned on or from the Arduino IDE open the Serial Monitor. LCD Display:  The display that is used in the project is 1602 or 16×2 where 2 is the number of rows and 16 is the number of characters per row. Therefore, the display can display up to 32 characters.The problem with connecting LCD directly to an Arduino that it requires many pins. Consequently, I2C (Inter-Integrated Circuit) module is used which reduce the number of pins used to only two pins. I2C module uses serial communication that sends data packages one after another through SDA (Serial Data Communication line) and SCL (Serial Clock Line). The two wires are all connected to a master which is an Arduino and multiple slaves which is all LCD.  I2C Working Principle:When the master wants to talk to a slave. A start condition which is the switching of SDA line from high-level voltage to low-level voltage followed by a switching of SCL line from high-level voltage to a low-level voltage.  After that, the data begin transformed form the master to the slave in 8 bits sequence where the SCL switch from high to low. In addition, the SDA line must remain stable when SCL is high during data transformed. An ACK (acknowledgment) at the end of the data transformed of 8 bits must be sent.  Then, other data byte of another slave starts receiving data. If an ACK bits of all slave devices, sends back to the master high then the stop sequence started. The stop sequence is the switching from low to high of SCL followed by the switching from low to high of SDA. LCD Display Layout: #    Description 1    GND2    VCC3    SDA4    SCL5    Contrast Adjustment 6    Backlight Jumper7    I2C Solder Addressing SelectorLCD Display Specifications:Number of Characters    16 Characters x 2 RowsI2C Addressing Range    From 0x20 to 0x27Dimension    80mm x 36mm x 20 mmVoltage    5V DCCurrent    approximately 26mALCD Type    STN, TransflectiveLCD Display Addressing:The master which is the Arduino starts by sending the address to one of the slaves that the master wants to send data or communicate with that slave. After that, the slave compares the address with it is own address. A low-voltage ACK bit sends back from slave to the master if the address is the same. Otherwise, the SDA line remains high and the master tries another slave.The address of an LCD can be changed by soldering the solder jumpers A0, A1, and A2. The following table shows the LCD addresses:LCD Address    A0    A1    A20x27    0    0    00×26    0    0    10×25    0    1    00×24    0    1    10×23    1    0    00×22    1    0    10×21    1    1    00×20    1    1    1Note: Zero means the solder jumpers are not bridges together. One means the solder jumpers are bridges together.Testing LCD Display:An LCD library is required for using LCD. The library that is used in the project is Called “New LiquidCrystal”. Installing New LiquidCrystal Library:1.    Go to https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/ and download the latest version. 2.    Open Arduino IDE and go to “Sketch” then “Include Library” then “Add .ZIP Library…”. After that, select the library file.  3.    Make sure that the library is added successfully by going to “File” then “Examples” then the “NewliquidCrystal” examples must be available. Testing LCD Display Arduino code:#include  #include //i2c pinsLiquidCrystal_I2C lcd1(0x3F, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE); // change 0xXX to match I2C addressvoid setup() {lcd1.begin(16,2);lcd1.backlight();//Power on the back light}void loop() {lcd1.setCursor(1,0);lcd1.print(“KHALEEL MASAID”); // stuff name in the first rowlcd1.setCursor(6,1);lcd1.print(“ICET”); // Stuff Major}Testing LCD Display Schematic Diagram:  Tuning an LCD Display: Adjust the contrast by adjusting the contrast adjustment potentiometer until the characters are showing correctly.Gating Started With Cayenne:First of All, you need to create an account with myDevices. You can use a computer or Mobil Application.User Creation Using Computer:1.    Go To https://mydevices.com Website and press “SIGN UP FREE”. 2.    Type your first name, last name, email address, and password. Check the checkbox of “I agree to the myDevices Cayenne terms.”  and Press “GET STARTED FREE”. 3.    Cayenne is going to ask to choose a device, select Arduino. 4.    An Arduino IDE is needed to connect to Cayenne. To download Arduino IDE go to https://www.arduino.cc/en/Main/Software and choose your computer operating system. After that, install the program and run it.5.    Adding Cayenne library to an Arduino IDE is needed. To add the library go to “Sketch” then “Include Library” then “Manage Libraries…”. 6.    Type Cayenne in the search bar then the library “Cayenne by myDevices” is going to show up. Choose the latest version then press “Install” and wait for the library to download. 7.    Verify that Cayenne library installed properly by going to “Sketch” then going to “Include Library”. Make sure that the Cayenne library included at the bottom in the “Contributed libraries” section.  8.    Change the following selections by going to “Tools”:Board    Arduino/Genuine Mega or Mega 2560Processor    ATmega2560 (Mega 2560).Port    Choose the port that is connected to Arduino 9.    Go back to Cayenne website and press “Next”. 10.    Select the “Arduino Mega” then “W5500”. Configuring Ethernet Shield:1.    Ethernet Shield library is necessary in order to use the Ethernet Shield, which can be download by going to https://github.com/adafruit/Ethernet2 and press “Clone or download”. After that, press “Download ZIP”. 2.    Add the library by going to “Include Library” then “Add .ZIP Library…” and select the file that you download. 3.    Make sure that the library was added correctly by going to “Sketch” then “Include Library” then “Ethernet2” must be included in the libraries. Arduino Mega Code://#define CAYENNE_DEBUG         // Uncomment to show debug messages#define CAYENNE_PRINT Serial  // Comment this out to disable prints and save space#include // Cayenne authentication token. This should be obtained from the Cayenne Dashboard.char token = “”;void setup(){  Serial.begin(9600);  Cayenne.begin(token);}void loop(){  Cayenne.run();}Adding a new Stuff:1.    Go to Cayenne dashboard. After that, select “Add new…” and then go to “Device/Widget”. 2.    Select “Sensors and then “Generic”. 3.    Select “Digital Input” then Change the following:Widget Name    Stuff NameSelect Device    Select The Arduino MegaConnectivity    Select DigitalPin    Select the digital pin that is connected to stuff box.Choose Widget    Select 0/1 stateInvert Logic    Make sure that the checkbox is checkedAfter that, press “Step 2: Add Sensor”. 4.    The stuff is going to be added to the dashboard, which can be moved and dragged around by holding left click. Edit Current Stuff Widget:1.    Go to Cayenne dashboard. After that, press the settings icon of the stuff that needs some changes. Then, select “Settings”. 2.Edit the following settings:Widget Name    Stuff NameChoose Widget    0/1 2 stateChoose Display    ValueSelect GPIO    Integrated GPIO ( Digital Input)Select Channel    Select the digital pin that is connected to stuff box.Invert Logic    Make sure that the checkbox is checkedAfter that, save the settings by pressing “Save”. Removing a Stuff Completely:1.    Go to Cayenne dashboard. After that, press the settings icon of the stuff that needs to be removed. Then, select “Settings”. 2.    Press “Remove” Configuring Email and Mobile Number Trigger for a Stuff:1.    Go to Cayenne dashboard. After that, press the settings icon of the stuff that needs some changes. Then, select “Trigger”. 2.    Type the stuff into the “Name your trigger” field. Then, drag the device and drop it in the if the section.  3.    Press the “- Select Trigger – “then choose the stuff. 4.    In the then section press “setup notification”. 5.    Press “Add custom reception”  6.    Press “Add more recipient”. After that, type the email address and mobile phone number respectively.  7.    Save the settings by pressing the “Save” button. After that, the trigger is going to be added and Cayenne is going to move you to “My Triggers” section.  Editing A Trigger for a Stuff:1.    Go to Cayenne dashboard. After that, select “Add new…” and then go to “Trigger”. 2.    Go to my triggers by pressing “My Triggers”. 3.    Edit the email and mobile number by first locating the stuff name.After that press the edit icon. 4.    Edit the information which needs some changes and press the save button. Deleting a Trigger for a Stuff:1.    Go to Cayenne dashboard. After that, select “Add new…” and then go to “Trigger”. 2.    Go to my triggers by pressing “My Triggers”. 3.    Locate the stuff name.After that press the edit icon. 4.    Press the delete button at the bottom. After that, a confirmation message is going to show up. Then, press “Confirm” button and the trigger is going to be removed.  Disabling and Enabling a Trigger for a Stuff: 1.    Go to Cayenne dashboard. After that, select “Add new…” and then go to “Trigger”. 2.    Go to my triggers by pressing “My Triggers”. 3.    Locate the stuff name.After that, enable or disable the trigger by switching the switch. Note: Trigger is on if the switch is green. Otherwise, the trigger is off if the switch is gray.https://github.com/myDevicesIoT/cayenne-docs/blob/master/docs/GETTINGSTARTED.mdhttps://wiki.eprolabs.com/index.php?title=IR_Obstacle_Sensorhttp://www.circuitbasics.com/basics-of-the-i2c-communication-protocol/https://bitbucket.org/fmalpartida/new-liquidcrystal/overview