Tuesday, January 7, 2020

Connect Lcd 16x2 to Arduino with just 4 wires !!!!!!

Normally connecting a LCD 16x2 to  arduino we require around 14 pins (using in 4 bit mode which is by default in arduino example sketch)

Connecting  LCD 16x2 in this way may use up many pins of Arduino Uno and very less pins will be left for us to interface another interfacing devices 

So to save us some pins on the Arduino we use a I2C module for LCD 16x2. As name says this module uses I2C Protocol, this ,odule takes data in I2C format  and converts it into LCD compatible data i.e Parallel data.

LCD 16x2 I2C module for Arduino


This module just requires 4 pins from arduino. Those are
  • VCC
  • GND
  • SDA (Serial data)
  • SCL (Serial Clock)
Using 4 pins instead of 14 saves a lot of pins for further interfacing.

Connection Diagram



Code

To use I2C module for LCD 16x2 we need to download the library.

Arduino I2C library Download link:

https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library






After downloading this library zip file do  the following steps:

  • Extract the Zip file.

  • Copy the Extracted file to the arduino library folder which is located in C:\Program Files (x86)\Arduino\libraries.





  • Open the Arduino IDE.
  • Go to Sketch and then click on include library you will see list of library.




  • Click on Arduino-LiquidCrystal-I2C-library-master to include the library.
  • Then go to Files > Examples > Arduino-LiquidCrystal-I2C-library-master and select any example  you want to  execute.




 OUTPUT







Wednesday, November 27, 2019

Distance Measuring Using UltraSonic Sensor and Arduino


In this project we are going to measure distance using ultrasonic sensor and the measured distance value will be displayed on computer screen.

We will be using Processing 3 software to display the distance on the compter screen.


For this project we need
  • Arduino uno
  • Ultrasonic sensor HC-SR04
  • BreadBoard jumper wires

Theory Behind Measuring Distance

The Sensor works on the phenomenon of Echo of sound.

In order to generate the ultrasound you need to set the Trig on a High State for 10 µs. That will send out an 8 cycle sonic burst which will travel at the speed sound and it will be received in the Echo pin. The Echo pin will output the time in microseconds the sound wave traveled.

As speed of sound is 340 m/s (0.034 cm/us) we can calcute the received echo signal pulse duration and hence the formula for calculating distance is


Distance = (Echo pulse Duration) * 0.034 / 2


Dividing by two is done because the same wave is transmitted and received back

Connection Diagram


Arduino and Processing Code

Pocket Size CO (carbon Monoxide) Detector



In this project we will be making a pocket sized CO detector which is used to detect Carbon monoxide in air our goal was to make this device portable and which fits in pocket size.
Now a days we are facing problem of air Pollution due to industrialization every day harmful gases are released into air and even vehicles releasing harmful Carbon monoxide.
So we thought of making this project which we could carry anywhere and check the air condition whether it is clean or polluted.
We have build this project in a affordable budget,it costed around 12 USD.Parts Used


Parts used
  • Arduino Pro Mini
  • Oled 128*96 Display
  • MQ9 Carbon Monoxide Sensor
  • Li polymer battery
  • Li polymer battery charger (Extracted from a old Powerbank)
  • led 2mm
  • Slide Switch
  • Screws
  • Cardboard
  • Masking tape


Circuit Diagram


Arduino Code

Click on the link below to download the code:


Final Output



Social handle links


Connect Lcd 16x2 to Arduino with just 4 wires !!!!!!

Normally connecting a LCD 16x2 to  arduino we require around 14 pins (using in 4 bit mode which is by default in arduino example sketch) ...