Alpha Electronz https://alphaelectronz.com World of Innovation Thu, 02 Apr 2020 12:25:22 +0000 en-GB hourly 1 https://wordpress.org/?v=5.3.2 https://i2.wp.com/alphaelectronz.com/wp-content/uploads/2019/11/cropped-20191106_122751_0000-2.png?fit=32%2C32&ssl=1 Alpha Electronz https://alphaelectronz.com 32 32 171995848 Blynk – The Definitive Guide to Beginners https://alphaelectronz.com/blynk/ Wed, 12 Feb 2020 08:11:02 +0000 http://alphaelectronz.com/?p=1283 If you know anything about IoT using Arduino or NodeMCU then you must be knowing what Blynk is. It is one of the most popular IoT Platforms for Hobbyist and creators.

The post Blynk – The Definitive Guide to Beginners appeared first on Alpha Electronz.

]]>
Blynk Tutorial
Blynk Tutorial

If you know anything about IoT using Arduino or NodeMCU then you must be knowing what Blynk is. It is one of the most popular IoT Platforms for Hobbyist and creators.

It is mostly used for,

  • Displaying Sensors Data in Graph, Levels, Indicator Form.
  • Controlling Digital or Analog Pins through the App.
  • One Awesome Feature known as Virtual Pins (which will discuss later!).

You can connect over more than 400 Hardware Boards with your Blynk App.

Some of the common and famous boards are –

  • Arduino Nano, Mini, Pro Mini, Pro Micro, Due, Mega.
  • ESP8266
  • ESP32 
  • Teensy 3.2/3.1
  • DFRobot Bluno
  • Intel Edison
  • Intel Galileo
  • Launchpad MSP432
  • Raspberry Pi
  • SparkFun RedBoard
  • STM32 Nucleo
  • BBC micro:bit

You can find the full list of supported hardware Here.

There are three major components in the platform:

  • Blynk App – allows to you create amazing interfaces for your projects using various widgets we provide.
  • Blynk Server – responsible for all the communications between the smartphone and hardware. You can use our BlynkCloud or run your private Blynk server locally. It’s open-source, could easily handle thousands of devices and can even be launched on a Raspberry Pi.
  • Blynk Libraries – for all the popular hardware platforms – enable communication with the server and process all the incoming and outcoming commands.

We are going to discuss about Blynk App.

Structure of Blynk App

Blynk Architecture
Blynk Architecture

The above image shows the Architecture of the Blynk App.

Now lets understand the above Architecture with an example :

Every time you press a Button in the Blynk app, the message travels to the Blynk Cloud, where it magically finds its way to your hardware. It works the same in the opposite direction and everything happens in a Blynk of an eye.

Now, The Requirements

To learn the Blynk Platform we need some Prerequisites, which I’ve mentioned below.

The Hardware

We will need a Hardware Board which we are going to use to display some values or controlling the hardware using Blynk App.

In this Guide we are going to use an Arduino Uno and ESP 01 WiFi Module.

You can buy those components from the Links given Below.

Arduino Uno

ESP 01 WiFi Module

For Blynk to work we need our hardware to connect to internet.

So for this tutorial we are going to use ESP 01 WiFi Module with our Arduino Uno to connect it to Internet.

A Smart Phone

To control or see any data on Blynk we need to Download the official app of Blynk. Links given below.

Android – Blynk

iOS – Blynk

Blynk Library

To use Blynk with Arduino and it’s IDE, we need to download the Blynk Library.

Click here to download

All the widgets/function available in Blynk we can find in the Example sketches after adding the Library.

If you are first timer then see our tutorial on adding Libraries to Arduino IDE.

Installing Additional Libraries to Arduino

Blynking LED using Blynk and NodeMCU

You will need a NodeMCU and Blynk App for this Example.

Blynk App Configuration

After Login, Create a New Project.

Blynk Configuration

Select your board as NodeMCU and give your Project a Name.

Then the AUTH Token will be sent to your Registered Mail ID. Save that for Programming

Blynk Configuration

Then Select your Widget which is Button

Blynk Configuration

Then Configure your Button to any Pin of NodeMCU.

I’ve set it to D4 which is the onboard LED Pin of NODEMCU

Code

/*************************************************************
  Download latest Blynk library here:
    https://github.com/blynkkk/blynk-library/releases/latest

  Blynk is a platform with iOS and Android apps to control
  Arduino, Raspberry Pi and the likes over the Internet.
  You can easily build graphic interfaces for all your
  projects by simply dragging and dropping widgets.

    Downloads, docs, tutorials: http://www.blynk.cc
    Sketch generator:           http://examples.blynk.cc
    Blynk community:            http://community.blynk.cc
    Follow us:                  http://www.fb.com/blynkapp
                                http://twitter.com/blynk_app

  Blynk library is licensed under MIT license
  This example code is in public domain.

 *************************************************************
  This example runs directly on ESP8266 chip.

  Note: This requires ESP8266 support package:
    https://github.com/esp8266/Arduino

  Please be sure to select the right ESP8266 module
  in the Tools -> Board menu!

  Change WiFi ssid, pass, and Blynk auth token to run :)
  Feel free to apply it to any other example. It's simple!
 *************************************************************/

/* Comment this out to disable prints and save space */
#define BLYNK_PRINT Serial


#include <ESP8266WiFi.h>
#include <BlynkSimpleEsp8266.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "YourAuthToken";

// Your WiFi credentials.
// Set password to "" for open networks.
char ssid[] = "YourNetworkName";
char pass[] = "YourPassword";

void setup()
{
  // Debug console
  Serial.begin(9600);

  Blynk.begin(auth, ssid, pass);
}

void loop()
{
  Blynk.run();
}

Now upload the Code and wait for NodeMCU to connect with Blynk.

After connection press the button and see your On-board LED on NodeMCU Blynking.

Checkout Projects Made using Blynk

The post Blynk – The Definitive Guide to Beginners appeared first on Alpha Electronz.

]]>
1283
IoT Based Smart Dustbin Monitoring System https://alphaelectronz.com/smart-dustbin-monitoring-iot/ https://alphaelectronz.com/smart-dustbin-monitoring-iot/#respond Fri, 07 Feb 2020 11:05:42 +0000 http://alphaelectronz.com/?p=1321 In this tutorial we are going to create a IoT Based Smart Dustbin Monitoring System. We are going to monitor whether the Dustbin is full or not

The post IoT Based Smart Dustbin Monitoring System appeared first on Alpha Electronz.

]]>
IoT Based Smart Dustbin

In this tutorial we are going to create a IoT Based Smart Dustbin Monitoring System

We are going to monitor whether the Dustbin is full or not and if full then notify the Owner through a push notification on their phone.

Table of Content :

Software Requirements

Hardware Requirements

Ultrasonic Sensor

ESP8266 – 01 WiFi Module

Servo Motor SG90

Configuration ESP8266 – 01 WiFi Module

Configuration of Blynk Application

Circuit Diagram

Code

OUTPUT Video

Software requirements :

Blynk Application

Arduino IDE

Hardware Requirements :

Ultrasonic Sensor

IoT Based Smart Dustbin

It emits an ultrasound at 40 000 Hz which travels through the air and if there is an object or obstacle on its path It will bounce back to the module. Considering the travel time and the speed of the sound you can calculate the distance.

ESP8266 – 01 WiFi Module

IoT Based Smart Dustbin
ESP8266-01 WiFi Module

ESP8266-01 is a Serial WiFi Transmitter and Receiver which can give any Micro-controller access to WiFi Network.

ESP8266 module is of low cost and comes pre-programmed with an AT command set firmware, meaning, you can simply hook this up to your Arduino device and get about as much WiFi-ability as a WiFi Shield offers.This module has a powerful on-board processing and storage capability that allows it to be integrated with the sensors and other application through its GPIOs .

Features :

  1. Wi-Fi Direct (P2P), soft-AP
  2. Integrated TCP/IP protocol stack
  3. It features an integrated TR switch, balun, LNA, power amplifier and matching network
  4. Equips integrated PLL, regulators, DCXO and power management units
  5. Integrated low power 32-bit CPU could be used as an application processor
  6. SDIO 1.1 / 2.0, SPI, UART
  7. STBC, 1×1 MIMO, 2×1 MIMO
  8. A-MPDU & A-MSDU aggregation & 0.4ms guard interval
  9. Wake up and transmit packets in < 2ms
  10. Standby power consumption of < 1.0mW (DTIM3)

Servo Motor SG90

servo motor is an electrical device which can push or rotate an object with great precision. If you want to rotate and object at some specific angles or distance, then you use servo motor. It is just made up of simple motor which run through servo mechanism. If motor is used is DC powered then it is called DC servo motor, and if it is AC powered motor then it is called AC servo motor. We can get a very high torque servo motor in a small and light weight packages. Doe to these features they are being used in many applications like toy car, RC helicopters and planes, Robotics, Machine etc.

Configuring your ESP8266 – 01 WiFi Module

Connect your ESP 01 in according to the connections given below.

Then upload this code to your Arduino Uno.

#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(2,3); //connect esp rx pin to 3
                               //connect esp tx pin to 2
void setup()
{
  Serial.begin(9600);
  while (!Serial)
  {
  }
  mySerial.begin(115200);
  mySerial.println("AT");
  delay(1000);
  mySerial.println("AT+CWMODE=1");
  delay(1000);
  mySerial.println("AT+UART_DEF=9600,8,1,0,0");
}

void loop()
{
  if (mySerial.available())
  {
    Serial.write(mySerial.read());
  }
  if (Serial.available())
  {
    mySerial.write(Serial.read());
  }
}

Now Upload the code and open Serial Monitor. Selectr Both NL & CR and Set baud rate to 9600.

COM Port
COM Port

Try sending the basic command : AT

You must get a OK response. (This means your ESP 01 is working Fine).

Now your ESP 01 will be automatically configured. There are two commands which we have written in the above code.

AT+CWMODE=1 ( Sets the Wi-Fi mode (Station/AP/Station+AP) )

AT+UART_DEF=9600,8,1,0,3 (This will change the baud rate to 9600 you can even set it to 115200.)

Configuration Blynk App

Now let’s setup your Blynk App to receive data of Temperature and Humidity on Graphs.

Steps : Click on New Project

Blynk Configuration

Step 2: Add your Project Name and which Board we are going to use, In our Case it is Arduino Nano

Blynk Configuration

Step 3 : Select your Widget i.e. Level Vertical

Blynk Configuration

Step 4 : Configure the Pins and Data range

Blynk Configuration

Now your Blynk should Look Like this

Blynk Configuration

Circuit Diagram

IoT Based Smart Dustbin
Circuit Diagram

In the above diagram all the connections are shown for this project IoT Based Smart Dustbin .

We have used an Arduino Nano Shield for ease of connection. Connection will be the same for Arduino Nano Shield too.

Code

#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include<Servo.h>

char auth[] = "your Auth Token";
char ssid[] = "Your Wifi Name";
char pass[] = "Your WiFI Password";

Servo myservo;
#define TRIGGERPIN  11
#define ECHOPIN     12
#define IR          10

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&Serial);

long distance, duration;

void setup()
{
  myservo.attach(9);
  Serial.begin(ESP8266_BAUD);
  delay(10);
  pinMode(TRIGGERPIN, OUTPUT);
  pinMode(ECHOPIN, INPUT);
  pinMode(IR, INPUT);
  Blynk.begin(auth, wifi, ssid, pass);
}

void sendSensor()
{
  // start working...
  digitalWrite(TRIGGERPIN, LOW);
  delayMicroseconds(2);
  // Sets the TRIGGERPIN on HIGH state for 10 micro seconds
  digitalWrite(TRIGGERPIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIGGERPIN, LOW);
  // Reads the ECHOPIN1, returns the sound wave travel time in microseconds
  duration = pulseIn(ECHOPIN, HIGH);
  // Calculating the distance
  distance = duration * 0.034 / 2;
  // Prints the distance on the Serial Monitor
  Serial.print("Distance: ");
  Serial.println(distance);
  Blynk.virtualWrite(V1, distance);
  delay(500);

  if (digitalRead(IR))
  {
    Serial.println("enter");
    myservo.write(120);
  }

  else
  {
    myservo.write(0);
  }
}

void loop()
{
  sendSensor();
  Blynk.run();
}

Now upload the code and Open The Serial Monitor and wait for the ESP 01 to connect with your WiFi then it will automatically connect to blynk ( don’t forget to press the play button in blynk application).

Video tutorial With OUTPUT – IoT Based Smart Dustbin

Checkout More IoT Projects :

IoT based Soil Moisture Monitoring and Control System

The post IoT Based Smart Dustbin Monitoring System appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/smart-dustbin-monitoring-iot/feed/ 0 1321
Temperature and Humidity Monitoring using Blynk https://alphaelectronz.com/temperature-and-humidity-monitoring-blynk/ https://alphaelectronz.com/temperature-and-humidity-monitoring-blynk/#respond Sun, 26 Jan 2020 13:44:00 +0000 http://alphaelectronz.com/?p=1247 In this tutorial w are going to Monitoring Temperature and Humidity using DHT11 and send the Data to cloud using Blynk

The post Temperature and Humidity Monitoring using Blynk appeared first on Alpha Electronz.

]]>
 Temperature and Humidity Monitoring using Blynk
Temperature and Humidity Monitoring using Blynk

In this tutorial w are going to Monitoring Temperature and Humidity using DHT11 and send the Data to cloud using Blynk

Components Required for this Tutorial :

ESP8266 – 01 WiFi Module

ESP8266-01 WiFi Module
ESP8266-01 WiFi Module

ESP8266-01 is a Serial WiFi Transmitter and Receiver which can give any Micro-controller access to WiFi Network.

ESP8266 module is of low cost and comes pre-programmed with an AT command set firmware, meaning, you can simply hook this up to your Arduino device and get about as much WiFi-ability as a WiFi Shield offers.This module has a powerful on-board processing and storage capability that allows it to be integrated with the sensors and other application through its GPIOs .

Features :

  1. Wi-Fi Direct (P2P), soft-AP
  2. Integrated TCP/IP protocol stack
  3. It features an integrated TR switch, balun, LNA, power amplifier and matching network
  4. Equips integrated PLL, regulators, DCXO and power management units
  5. Integrated low power 32-bit CPU could be used as an application processor
  6. SDIO 1.1 / 2.0, SPI, UART
  7. STBC, 1×1 MIMO, 2×1 MIMO
  8. A-MPDU & A-MSDU aggregation & 0.4ms guard interval
  9. Wake up and transmit packets in < 2ms
  10. Standby power consumption of < 1.0mW (DTIM3)

DHT11 Temperature and Humidity Sensor

DHT11 Temperature and Humidity Sensor
DHT11 Temperature and Humidity Sensor

The DHT11 is a basic, ultra low-cost digital temperature and humidity sensor. It uses a capacitive humidity sensor and a thermistor to measure the surrounding air, and spits out a digital signal on the data pin (no analog input pins needed). Its fairly simple to use, but requires careful timing to grab data.

The only real downside of this sensor is you can only get new data from it once every 2 seconds, so when using our library, sensor readings can be up to 2 seconds old.

TECHNICAL DETAILS

  • Low cost
  • 3 to 5V power and I/O
  • 2.5mA max current use during conversion (while requesting data)
  • Good for 20-80% humidity readings with 5% accuracy
  • Good for 0-50°C temperature readings ±2°C accuracy
  • No more than 1 Hz sampling rate (once every second)
  • Body size 15.5mm x 12mm x 5.5mm
  • 4 pins with 0.1″ spacing

Download Section

Circuit Diagram

Monitoring Temperature and Humidity using Blynk
Circuit Temperature and Humidity Monitoring

The above Circuit Diagram shows the connection between Arduino Nano, ESP-01 and DHT11 Temperature and Humidity Sensor.

You can download the Fritzing File Here

Configuring your ESP8266 – 01 WiFi Module

Connect your ESP 01 in according to the connections given below.

Temperature and Humidity Monitoring using Blynk Configuring ESP8266-01 Wifi Module

Then upload this code to your Arduino Uno.

#include <SoftwareSerial.h>
 
SoftwareSerial mySerial(2,3); //connect esp rx pin to 3
                               //connect esp tx pin to 2
void setup()
{
  Serial.begin(9600);
  while (!Serial)
  {
  }
  mySerial.begin(115200);
  mySerial.println("AT");
  delay(1000);
  mySerial.println("AT+CWMODE=1");
  delay(1000);
  mySerial.println("AT+UART_DEF=9600,8,1,0,0");
}

void loop()
{
  if (mySerial.available())
  {
    Serial.write(mySerial.read());
  }
  if (Serial.available())
  {
    mySerial.write(Serial.read());
  }
}

Now Upload the code and open Serial Monitor. Selectr Both NL & CR and Set baud rate to 9600.

COM Port
COM Port

Try sending the basic command : AT

You must get a OK response. (This means your ESP 01 is working Fine).

Now your ESP 01 will be automatically configured. There are two commands which we have written in the above code.

AT+CWMODE=1 ( Sets the Wi-Fi mode (Station/AP/Station+AP) )

AT+UART_DEF=9600,8,1,0,3 (This will change the baud rate to 9600 you can even set it to 115200.)

Configuration Blynk App

Now let’s setup your Blynk App to receive data of Temperature and Humidity on Graphs.

Steps :

In the widget Box find Gauges, one for Temperature and second for Humidity.

Gauges in Widget Box
Gauges in Widget Box

Setup for Temperature Widget.

Temperature Widget Setup
Temperature Widget Setup

Setup for Humidity Widget.

Setup for Humidity Widget
Setup for Humidity Widget

Now upload the Code and Play.

Code

#define BLYNK_PRINT Serial
#include <ESP8266_Lib.h>
#include <BlynkSimpleShieldEsp8266.h>
#include <SimpleDHT.h>

char auth[] = "Paste Your Authorization Code Here";

char ssid[] = "Paste your WiFi Name Here";
char pass[] = "Paste Your WiFi Password Here";

// Your ESP8266 baud rate:
#define ESP8266_BAUD 9600
ESP8266 wifi(&Serial);

const int pinDHT11 = 13; // GPIO2 on your ESP8266 Wifi Module
SimpleDHT11 dht11;

void setup()
{
  Serial.begin(ESP8266_BAUD);
  delay(10);
  //Set ESP8266 baud rate
  // EspSerial.begin(ESP8266_BAUD);
  delay(10);
  Blynk.begin(auth, wifi, ssid, pass);
}

void sendSensor()
{
  // start working...
  Serial.println("=================================");
  Serial.println("Sample DHT11...");

  // read without samples.
  byte temperature = 0;
  byte humidity = 0;
  int err = SimpleDHTErrSuccess;
  if ((err = dht11.read(pinDHT11, &temperature, &humidity, NULL)) != SimpleDHTErrSuccess) {
    Serial.print("Read DHT11 failed, err="); Serial.println(err); delay(1000);
    return;
  }
  // for debug purposes.
  Serial.print("Sample OK: ");
  Serial.print((int)temperature); Serial.print(" *C, ");
  Serial.print((int)humidity); Serial.println(" H");
  // DHT11 sampling rate is 1HZ.
  delay(1000);
  Blynk.virtualWrite(V6, temperature);
  Blynk.virtualWrite(V5, humidity);
}

void loop()
{
  sendSensor();
  Blynk.run();
}

Now upload the code and wait for ESP 01 to connect with Blynk and then press the Play button.

Video Tutorial

The post Temperature and Humidity Monitoring using Blynk appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/temperature-and-humidity-monitoring-blynk/feed/ 0 1247
AC Light Dimmer without Zero crossing Detector https://alphaelectronz.com/ac-light-dimmer/ https://alphaelectronz.com/ac-light-dimmer/#respond Sun, 26 Jan 2020 09:47:26 +0000 http://alphaelectronz.com/?p=1223 In this tutorial we are going to control the intensity of a 100W AC Bulb without using Zero Crossing Detector so you can also other Libraries which uses Interrupts such as SoftwareSerial.h.

The post AC Light Dimmer without Zero crossing Detector appeared first on Alpha Electronz.

]]>
AC LIGHT DIMMER WITHOUT ZERO CROSSING DETECTOR
AC LIGHT DIMMER WITHOUT ZERO CROSSING DETECTOR

In this tutorial we are going to control the intensity of a 100W AC Bulb without using Zero Crossing Detector so you can also other Libraries which uses Interrupts such as SoftwareSerial.h.

In spite of the simplicity of the Zero Crossing Detector circuit the software needed was a bit complicated as it needed to keep looking always of the zero crossing of the AC signal, then keep a watch on the time and then finally open the TRIAC. So to avoid letting the arduino just wait for most of the time, an interrupt and a timer were necessary.

We will just use PWM, like with LED’s. Someone looking for that would no doubt end up at design by Ton Giesberts/Elektor Magazine that can do PWM of an AC source.

The components Required for this Tutorial are listed below :

Arduino Uno

Arduino Uno AC Light Dimmer

BR1010 Bridge Rectifier

BRIDGE RECTIFIER BR1010
BRIDGE RECTIFIER BR1010

Optocoupler 4N35

OPTOCOUPLER 4N35 AC Light Dimmer
OPTOCOUPLER 4N35

IRF730 MOSFET

IRF730 POWER MOSFET AC Light Dimmer
IRF730 POWER MOSFET

IN4001 and IN4744 Diodes

DIODES

100uF 450V Electrolytic Capacitor

CAPACITORS
CAPACITORS

100K 0.5W Resistor & 6.8K 0.5W Resistor

RESISTORS AC Light Dimmer
RESISTORS

Circuit Diagram

CIRCUIT DIAGRAM OF AC LIGHT DIMMER

As you can see in the above circuit diagram the AC Input is rectified using a BR1010 Bridge Rectifier (Datasheet at the end of the post) and that is provided to the voltage divider of resistors 100K and 6.8K of 0.5 or 1W to provide switching voltage to the Power MOSFET IRF730 which has max gate to source voltage of +/- 20V.

Voltage Divider Formula
Voltage Divider Formula for Gate Switching

Thus we are applying 10.357V on the gate of MOSFET IRF730 for switching.

Code For dimming Effect

int ledPin = 9;    // LED connected to digital pin 9

void setup() {
  // nothing happens in setup
}

void loop() {
  // fade in from min to max in increments of 5 points:
  for (int fadeValue = 0 ; fadeValue <= 255; fadeValue += 5) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);
    // wait for 30 milliseconds to see the dimming effect
    delay(100);
  }

  // fade out from max to min in increments of 5 points:
  for (int fadeValue = 255 ; fadeValue >= 0; fadeValue -= 5) {
    // sets the value (range from 0 to 255):
    analogWrite(ledPin, fadeValue);
    // wait for 30 milliseconds to see the dimming effect
    delay(100);
  }
}

Now Connect the AC Wires Carefully and Upload the code to Arduino Uno and watch your 100W AC Bulb Fade.

The post AC Light Dimmer without Zero crossing Detector appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/ac-light-dimmer/feed/ 0 1223
MPU6050 – Accelerometer and Gyroscope Module https://alphaelectronz.com/mpu6050-accelerometer-and-gyroscope-module/ https://alphaelectronz.com/mpu6050-accelerometer-and-gyroscope-module/#respond Fri, 17 Jan 2020 10:18:35 +0000 http://alphaelectronz.com/?p=1186 It is the world first six dimension motions tracking device. It was designed for low cost and high performances smartphones, tablets and wearable sensor. It is capable of processing nine-axis algorithms, it captures motion in X, Y and Z axis at the same time. MPU6050 is used in different industrial projects and electronic devices to …

MPU6050 – Accelerometer and Gyroscope Module Read More »

The post MPU6050 – Accelerometer and Gyroscope Module appeared first on Alpha Electronz.

]]>
MPU6050 Accelerometer and Gyroscope Module
MPU6050 Module

It is the world first six dimension motions tracking device. It was designed for low cost and high performances smartphones, tablets and wearable sensor. It is capable of processing nine-axis algorithms, it captures motion in X, Y and Z axis at the same time.

MPU6050 is used in different industrial projects and electronic devices to control and detect the 3-D motion of different objects.

In today’s post, we will have a look at its working, pinout, protocol, it’s interfacing with Arduino, features, applications, etc.

MPU6050 Module Pinouts

MPU6050-Pinout
MPU6050-Pinout

Pin Numbers and Names Functions
1 – VCC

Provides power for the module, can be +3V to +5V. Typically +5V is used

2 – GND

Connected to Ground of system

3 – SCL (Serial Clock)

Used for providing clock pulse for I2C Communication

4 – Serial Data (SDA)

Used for transferring Data through I2C communication

5 – Auxiliary Serial Data (XDA)

Can be used to interface other I2C modules with MPU6050. It is optional

6 – Auxiliary Serial Clock (XCL)

Can be used to interface other I2C modules with MPU6050. It is optional

7 – AD0

If more than one MPU6050 is used a single MCU, then this pin can be used to vary the address

8 – INT (Interrup)

Interrupt pin to indicate that data is available for MCU to read.

MPU6050 Features

  • MEMS 3-aixs accelerometer and 3-axis gyroscope values combined
  • Power Supply: 3-5V
  • Communication : I2C protocol
  • Built-in 16-bit ADC provides high accuracy
  • Built-in DMP provides high computational power
  • Can be used to interface with other IIC devices like magnetometer
  • Configurable IIC Address
  • In-built Temperature sensor

I2C Protocol in MPU6050 Module

MPU6050 was first introduced by the Philips semiconductors in 1982. For sending and receiving data between two or more devices we need a path which called BUS. I2C is a bidirectional two-wire bus which use to send data between integrated circuits.

I2C consist of three data transfer speed which is, standard, fast-mode, and high-speed mode. I2C sports 7 bit and 10-bit address devices.

I2C is the best choice where simplicity and low manufacturing cost are more important than speed.

For a better understanding of how I2C protocol works, let’s see is a picture.

MPU6050 Module I2C
MPU6050 Module I2C

Interfacing MPU6050 Module with Arduino

Arduino MPU6050 Circuit Interfacing
Arduino MPU6050 Circuit

The library provides two example programs, which can be found at File -> Examples -> MPU6050. In these two examples one will give raw values while the other will give optimised values using the DMP. The following data values can be obtained using this example program.

  • Quaternion Components [w, x, y, z]
  • Euler angles
  • Yaw, Pitch, Roll
  • Real world Acceleration
  • World frame acceleration
  • Teapot invent sense Values

Out of all these data, the Yaw, Pitch, Roll us commonly used. However the library is capable of performing more than that and can be used for different purposes. Once the program is uploaded, open serial monitor and set it to 115200 baud rate and you should see the data being printed on the screen.

The post MPU6050 – Accelerometer and Gyroscope Module appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/mpu6050-accelerometer-and-gyroscope-module/feed/ 0 1186
Installing Additional Arduino Libraries https://alphaelectronz.com/arduino-libraries/ https://alphaelectronz.com/arduino-libraries/#respond Thu, 16 Jan 2020 14:15:45 +0000 http://alphaelectronz.com/?p=1163 Once you are comfortable with the Arduino software and using the built-in functions, you may want to extend the ability of your Arduino with additional libraries. What are Libraries? Libraries are a collection of code that makes it easy for you to connect to a sensor, display, module, etc. For example, the built-in LiquidCrystal library makes it …

Installing Additional Arduino Libraries Read More »

The post Installing Additional Arduino Libraries appeared first on Alpha Electronz.

]]>
Once you are comfortable with the Arduino software and using the built-in functions, you may want to extend the ability of your Arduino with additional libraries.

What are Libraries?

Libraries are a collection of code that makes it easy for you to connect to a sensor, display, module, etc. For example, the built-in LiquidCrystal library makes it easy to talk to character LCD displays. There are hundreds of additional libraries available on the Internet for download. The built-in libraries and some of these additional libraries are listed in the reference. To use the additional libraries, you will need to install them.

How to install a Library?

Using the Library Manager

To install a new library into your Arduino IDE you can use the Library Manager (available from IDE version 1.6.2). Open the IDE and click to the “Sketch” menu and then Include Library > Manage Libraries.

 
Installing Additional Arduino Libraries

Then the Library Manager will open and you will find a list of libraries that are already installed or ready for installation. In this example we will install the Bridge library. Scroll the list to find it, click on it, then select the version of the library you want to install. Sometimes only one version of the library is available. If the version selection menu does not appear, don’t worry: it is normal.

 
Installing Additional Arduino Libraries

Finally click on install and wait for the IDE to install the new library. Downloading may take time depending on your connection speed. Once it has finished, an Installed tag should appear next to the Bridge library. You can close the library manager.

Installing Additional Arduino Libraries

You can now find the new library available in the Sketch > Include Library menu. If you want to add your own library to Library Manager, follow these instructions.

Importing a .zip Library

Libraries are often distributed as a ZIP file or folder. The name of the folder is the name of the library. Inside the folder will be a .cpp file, a .h file and often a keywords.txt file, examples folder, and other files required by the library. Starting with version 1.0.5, you can install 3rd party libraries in the IDE. Do not unzip the downloaded library, leave it as is.

In the Arduino IDE, navigate to Sketch > Include Library > Add .ZIP Library. At the top of the drop down list, select the option to “Add .ZIP Library”.

You will be prompted to select the library you would like to add. Navigate to the .zip file’s location and open it.

Return to the Sketch > Include Library menu. menu. You should now see the library at the bottom of the drop-down menu. It is ready to be used in your sketch. The zip file will have been expanded in the libraries folder in your Arduino sketches directory.

NB: the Library will be available to use in sketches, but with older IDE versions examples for the library will not be exposed in the File > Examples until after the IDE has restarted.

Manual installation

When you want to add a library manually, you need to download it as a ZIP file, expand it and put in the proper directory. The ZIP file contains all you need, including usage examples if the author has provided them. The library manager is designed to install this ZIP file automatically as explained in the former chapter, but there are cases where you may want to perform the installation process manually and put the library in the libraries folder of your sketchbook by yourself.
You can find or change the location of your sketchbook folder at File > Preferences > Sketchbook location.

Go to the directory where you have downloaded the ZIP file of the library

Extract the ZIP file with all its folder structure in a temporary folder, then select the main folder, that should have the library name

Copy it in the “libraries” folder inside your sketchbook.

 
Installing Additional Arduino Libraries

Start the Arduino Software (IDE), go to Sketch > Include Library. Verify that the library you just added is available in the list.

Installing Additional Arduino Libraries

Please note: Arduino libraries are managed in three different places: inside the IDE installation folder, inside the core folder and in the libraries folder inside your sketchbook. The way libraries are chosen during compilation is designed to allow the update of libraries present in the distribution. This means that placing a library in the “libraries” folder in your sketchbook overrides the other libraries versions.

The same happens for the libraries present in additional cores installations. It is also important to note that the version of the library you put in your sketchbook may be lower than the one in the distribution or core folders, nevertheless it will be the one used during compilation. When you select a specific core for your board, the libraries present in the core’s folder are used instead of the same libraries present in the IDE distribution folder.

Last, but not least important is the way the Arduino Software (IDE) upgrades itself: all the files in Programs/Arduino (or the folder where you installed the IDE) are deleted and a new folder is created with fresh content.

This is why we recommend that you only install libraries to the sketchbook folder so they are not deleted during the Arduino IDE update process.

The post Installing Additional Arduino Libraries appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/arduino-libraries/feed/ 0 1163
Distance Measurement Using Ultrasonic Sensor https://alphaelectronz.com/distance-measurement-using-ultrasonic-sensor/ https://alphaelectronz.com/distance-measurement-using-ultrasonic-sensor/#respond Thu, 16 Jan 2020 12:27:36 +0000 http://alphaelectronz.com/?p=1152 Today we are going to create a digital Scale for Measurement of Objects distance. We are going to create a Distance Measurement using Ultrasonic Sensor system which will display the Distance in ‘cm’ on a 16X2 LCD Display everything will be controlled by Arduino. So first Gather all the components : Arduino Uno Ultrasonic Sensor …

Distance Measurement Using Ultrasonic Sensor Read More »

The post Distance Measurement Using Ultrasonic Sensor appeared first on Alpha Electronz.

]]>
Distance Measurement using Ultrasonic Sensor

Today we are going to create a digital Scale for Measurement of Objects distance. We are going to create a Distance Measurement using Ultrasonic Sensor system which will display the Distance in ‘cm’ on a 16X2 LCD Display everything will be controlled by Arduino.

So first Gather all the components :

What is I2C?

I2C combines the best features of SPI and UARTs. With I2C, you can connect multiple slaves to a single master (like SPI) and you can have multiple masters controlling single, or multiple slaves. This is really useful when you want to have more than one microcontroller logging data to a single memory card or displaying text to a single LCD.

Like UART communication, I2C only uses two wires to transmit data between devices:

Introduction-to-I2C-Single-Master-Single-Slave

SDA (Serial Data) – The line for the master and slave to send and receive data.

SCL (Serial Clock) – The line that carries the clock signal.

I2C is a serial communication protocol, so data is transferred bit by bit along a single wire (the SDA line).

For more detailed information on I2C – Click Here

For more information on Ultrasonic Sensor – Click Here

Circuit Diagram

I2C Ultrasonic LCD CIrcuit Diagram
I2C Ultrasonic LCD CIrcuit Diagram

Connections of the distance measurement using Ultrasonic sensor is shown above.

you can download the fritzing file here.

Code

/*
  Ultrasonic Distance Measurement on I2C LCD.
  Created by - Alpha Electronz
  Date Created - 16-01-2020
  For more information visit - http://alphaelectronz.com/distance-measurement-using-ultrasonic-sensor
*/
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x3f, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display
const int trig_pin = 8;
const int echo_pin = 9;
long distance, duration;
void setup()
{
  Serial.begin(9600);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, INPUT);
  digitalWrite(7, HIGH);
  lcd.init();                      // initialize the lcd
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("   Welcome to   ");
  lcd.setCursor(0, 1);
  lcd.print("Alpha Electronz");
  delay(1000);
  lcd.clear();
}
void loop()
{
  digitalWrite(8, HIGH);
  delayMicroseconds(20);
  digitalWrite(8, LOW);
  delayMicroseconds(20);
  duration = pulseIn(echo_pin, HIGH); //To receive the reflected signal.
  distance = duration * 0.034 / 2;
  Serial.print(distance);
  Serial.println("cm");
  lcd.setCursor( 0, 0); //set the cursor to column 0 and line 1
  lcd.print(distance);
  lcd.setCursor( 0, 1);
  lcd.print("cm");
  delay(500);
  lcd.clear();
}


Output Video

The post Distance Measurement Using Ultrasonic Sensor appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/distance-measurement-using-ultrasonic-sensor/feed/ 0 1152
Fire Fighting Robot Using Arduino https://alphaelectronz.com/fire-fighting-robot/ https://alphaelectronz.com/fire-fighting-robot/#respond Tue, 14 Jan 2020 19:04:42 +0000 http://alphaelectronz.com/?p=1017 Today we are going to build a Fire Fighting Robot using Arduino, which will automatically sense the fire and start the water pump. In this project, we will learn how to build a simple robot using Arduino that could move towards the fire and pump out water around it to put down the fire. Material …

Fire Fighting Robot Using Arduino Read More »

The post Fire Fighting Robot Using Arduino appeared first on Alpha Electronz.

]]>
Today we are going to build a Fire Fighting Robot using Arduino, which will automatically sense the fire and start the water pump.

In this project, we will learn how to build a simple robot using Arduino that could move towards the fire and pump out water around it to put down the fire.

Material Required:

Arduino Sensor Shield V5

Arduino Sensor Shield
Arduino Sensor Shield

sensor-shield-v50

Arduino Sensor Shield is a low-cost board that allows you to connect a range of sensors to your Arduino using easy-to-attach jumper cables.

It’s a simple board with no electronics on it other than a couple of resistors and an LED. Its main role is to supply those header pins to make it easier to attach external devices like our servo motors.

Features:

  • The Arduino Sensor Shield V5.0 allows plug and play connection to various modules like sensors, servos, relays, buttons, potentiometers and more
  • Suitable for Arduino UNO and Mega Boards
  • IIC interface
  • Bluetooth module communication interface
  • SD card module communication interface
  • APC220 wireless RF module communication interface
  • RB URF v1.1 ultrasonic sensors interface
  • 128 x 64 LCD parallel interface
  • 32 servo controller interface

You can easily connect with usual analog sensors by using this expansion board, such as temperature sensor. Those 3-way male pins allow you to connect servo motors.

Everything is plug and play, and it’s designed to be Arduino UNO compatible. So all you need to do is to read the data from the sensors and output PWM to drive the servos by program in arduino.

This is the latest version of sensor shield in the market. The major improvement over its predecessor is the power source. This version provides an external power connector so you don’t need to worry about overloading the Arduino micro controller while driving too many sensors and actuators.

If you remove the pin connector next to the power input, you can power it externally. You shouldn’t power it with more then 5v or you can damage the arduino underneath.

Flame Sensor

Flame Sensor

A flame sensor module that consists of a flame sensor (IR receiver), resistor, capacitor, potentiometer, and comparator LM393 in an integrated circuit. It can detect infrared light with a wavelength ranging from 700nm to 1000nm.The far-infrared flame probe converts the light detected in the form of infrared light into current changes. Sensitivity is adjusted through the onboard variable resistor with a detection angle of 60 degrees.

Working voltage is between 3.3v and 5.2v DC, with a digital output to indicate the presence of a signal. Sensing is conditioned by an LM393 comparator.

Features:

  • High Photo Sensitivity
  • Fast Response Time
  • Sensitivity adjustable

Specification:

  • Woriking voltage: 3.3v – 5v
  • Detect range: 60 degrees
  • Digital/Analog output
  • On-board LM393 chip

L298N Motor driver

L298N Motor Driver
L298N Motor Driver

The L298N is a dual H-Bridge motor driver which allows speed and direction control of two DC motors at the same time. The module can drive DC motors that have voltages between 5 and 35V, with a peak current up to 2A.

The module has two screw terminal blocks for the motor A and B, and another screw terminal block for the Ground pin, the VCC for motor and a 5V pin which can either be an input or output.

This depends on the voltage used at the motors VCC. The module have an onboard 5V regulator which is either enabled or disabled using a jumper. If the motor supply voltage is up to 12V we can enable the 5V regulator and the 5V pin can be used as output, for example for powering our Arduino board. But if the motor voltage is greater than 12V we must disconnect the jumper because those voltages will cause damage to the onboard 5V regulator. In this case the 5V pin will be used as input as we need connect it to a 5V power supply in order the IC to work properly.

We can note here that this IC makes a voltage drop of about 2V. So for example, if we use a 12V power supply, the voltage at motors terminals will be about 10V, which means that we won’t be able to get the maximum speed out of our 12V DC motor.

Circuit Diagram of Fire Fighting Bot

Fire fighting bot circuit diagram
Fire fighting bot circuit diagram

All the connections required for this fire fighting bot is given below.

Download Fritzing File of above Circuit Diagram  – Click Here

Application Link – https://drive.google.com/file/d/1RFp2n5pDVhkZuviZddoQFgRBB909e_va/view

Note:
On relay Connect 5V Submersible Pump.

Red wire of pump to Positive of 9V Battery
Black Wire of Pump to NO of Relay Module
Negative of Battery to COM of Relay Module

Code

#include <SoftwareSerial.h>
#define m11 11
#define m12 10
#define m13 8
#define m14 9
#define r 19
#define o 12
#define b 17
SoftwareSerial BT(4, 5); //TX OF BLUETOOTH ON 4
String readvoice;
void setup()
{
  pinMode(m11, OUTPUT);
  pinMode(m12, OUTPUT);
  pinMode(m13, OUTPUT);
  pinMode(m14, OUTPUT);
  pinMode(r, OUTPUT);
  pinMode(o, OUTPUT);
  pinMode(b, OUTPUT);
  digitalWrite(m11, HIGH);
  digitalWrite(m12, HIGH);
  digitalWrite(m13, HIGH);
  digitalWrite(m14, HIGH);
  digitalWrite(o, HIGH);
  BT.begin(9600);
  Serial.begin(9600);
}
//-----------------------------------------------------------------------//
void loop()
{
  readvoice = ""; //Reset the variable

  if (BT.available())
  {
    while (BT.available())
    { //Check if there is an available byte to read
      delay(10); //Delay added to make thing stable
      char c = BT.read(); //Conduct a serial read
      readvoice += c; //build the string- "forward", "reverse", "left" and "right"
    }
  }

  if (digitalRead(6) == HIGH)
  {
    digitalWrite(o, LOW);
  }
  else
  {
    digitalWrite(o, HIGH);
  }
  if (readvoice.length() > 0)
  {
    Serial.println(readvoice);

    if (readvoice == "*forward#" || readvoice == "FF" || readvoice == "FORWARD")
    {
      digitalWrite(m11, HIGH);
      digitalWrite(m12, LOW);
      digitalWrite(m13, HIGH);
      digitalWrite(m14, LOW);

    }

    else if (readvoice == "BB" || readvoice == "*backward#" || readvoice == "BACKWARD")
    {
      digitalWrite(m11, LOW);
      digitalWrite(m12, HIGH);
      digitalWrite(m13, LOW);
      digitalWrite(m14, HIGH);
      Serial.println(readvoice);
    }

    else if (readvoice == "*right#" || readvoice == "RR" || readvoice == "RIGHT")
    {
      digitalWrite(m11, HIGH);
      digitalWrite(m12, LOW);
      digitalWrite(m13, LOW);
      digitalWrite(m14, HIGH);


    }

    else if ( readvoice == "*left#" || readvoice == "LL" || readvoice == "LEFT")
    {
      digitalWrite(m11, LOW);
      digitalWrite(m12, HIGH);
      digitalWrite(m13, HIGH);
      digitalWrite(m14, LOW);


    }

    else if (readvoice == "*stop#" || readvoice == "SS" || readvoice == "STOP")
    {
      digitalWrite(m11, HIGH);
      digitalWrite(m12, HIGH);
      digitalWrite(m13, HIGH);
      digitalWrite(m14, HIGH);
    }

    else if (readvoice == "SWS" || readvoice == "RUN WATER")  //
    {
      digitalWrite(o, HIGH);

    }

    else if (readvoice == "SwS" || readvoice == "STOP WATER")  //
    {
      digitalWrite(o, LOW);

    }

    else if (readvoice == "SUS")
    {
      digitalWrite(r, HIGH);

    }
    else if (readvoice == "SuS")
    {
      digitalWrite(r, LOW);

    }
    else if (readvoice == "SVS")
    {
      digitalWrite(b, HIGH);

    }
    else if (readvoice == "SvS")
    {
      digitalWrite(b, LOW);

    }


  }
}

  

Output Video

The post Fire Fighting Robot Using Arduino appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/fire-fighting-robot/feed/ 0 1017
4×3 Keypad Interfacing with Arduino https://alphaelectronz.com/arduino-4x3-keypad/ https://alphaelectronz.com/arduino-4x3-keypad/#respond Mon, 13 Jan 2020 10:31:47 +0000 http://alphaelectronz.com/?p=1038 Keypads allow users to input data while a program is running. In This tutorial we show how to connect a twelve-button keypad to an Arduino and how to use the library Keypad.h. A keypad is often needed to provide input to an Arduino system, and membrane-type keypads are an economical solution for many applications. They …

4×3 Keypad Interfacing with Arduino Read More »

The post 4×3 Keypad Interfacing with Arduino appeared first on Alpha Electronz.

]]>
Keypads allow users to input data while a program is running. In This tutorial we show how to connect a twelve-button keypad to an Arduino and how to use the library Keypad.h.

A keypad is often needed to provide input to an Arduino system, and membrane-type keypads are an economical solution for many applications. They are quite thin and can easily be mounted wherever they are needed.

In this tutorial, we demonstrate how to use a 12-button numeric keypad, similar to what you might find on a telephone. A 12-button keypad has three columns and four row. Pressing a button will short one of the row outputs to one of the column outputs. From this information, the Arduino can determine which button was pressed. For example, when key 1 is pressed, column 1 and row 1 are shorted. The Arduino will detect that and input a 1 to the program.

How the rows and column are arranged inside the keypad is shown in the figure below,

keypad
keypad

Components required for this tutorial:

Download Keypad Library here

Circuit Diagram

Arduino 4x3 Keypad Circuit Diagram
Arduino 4×3 Keypad Circuit Diagram

Code

/*
  Arduino 4x3 Keypad Tutorial.
  Created by - Alpha Electronz
  Date Created - 13-01-2020
  For more information visit : http://alphaelectronz.com/arduino-keypad
*/
#include <Keypad.h>
const byte Rows= 4; //number of rows on the keypad i.e. 4
const byte Cols= 3; //number of columns on the keypad i,e, 3
//we will definne the key map as on the key pad:
char keymap[Rows][Cols]=
{
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};
//  a char array is defined as it can be seen on the above
//keypad connections to the arduino terminals is given as:
byte rPins[Rows]= {A6,A5,A4,A3}; //Rows 0 to 3
byte cPins[Cols]= {A2,A1,A0}; //Columns 0 to 2
// command for library forkeypad
//initializes an instance of the Keypad class
Keypad kpd= Keypad(makeKeymap(keymap), rPins, cPins, Rows, Cols);
void setup()
{
     Serial.begin(9600);  // initializing serail monitor
}
//If key is pressed, this key is stored in 'keypressed' variable
//If key is not equal to 'NO_KEY', then this key is printed out
void loop()
{
     char keypressed = kpd.getKey();
     if (keypressed != NO_KEY)
     { 
          Serial.println(keypressed);
     }
}

 

The post 4×3 Keypad Interfacing with Arduino appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/arduino-4x3-keypad/feed/ 0 1038
I2C LCD 16X2 Interfacing with Arduino https://alphaelectronz.com/arduino-i2c-lcd/ https://alphaelectronz.com/arduino-i2c-lcd/#respond Mon, 13 Jan 2020 07:55:55 +0000 http://alphaelectronz.com/?p=1025 Hello and Welcome to Alpha Electronz.!We provide Tutorials (Post + Videos) about Projects based on Arduino, Raspberry Pi, etc. In this Tutorial we are going to Interface I2C LCD 16X2 Module with Arduino Uno and display our Name on LCD. Before starting we should first Understand what I2C is? I2C Communication Protocol I2C combines the best features of …

I2C LCD 16X2 Interfacing with Arduino Read More »

The post I2C LCD 16X2 Interfacing with Arduino appeared first on Alpha Electronz.

]]>
Hello and Welcome to Alpha Electronz.!We provide Tutorials (Post + Videos) about Projects based on Arduino, Raspberry Pi, etc.

In this Tutorial we are going to Interface I2C LCD 16X2 Module with Arduino Uno and display our Name on LCD.

Before starting we should first Understand what I2C is?

I2C Communication Protocol

I2C combines the best features of SPI and UARTs. With I2C, you can connect multiple slaves to a single master (like SPI) and you can have multiple masters controlling single, or multiple slaves. This is really useful when you want to have more than one microcontroller logging data to a single memory card or displaying text to a single LCD.

Like UART communication, I2C only uses two wires to transmit data between devices:

Introduction-to-I2C-Single-Master-Single-Slave

SDA (Serial Data) – The line for the master and slave to send and receive data.

SCL (Serial Clock) – The line that carries the clock signal.

I2C is a serial communication protocol, so data is transferred bit by bit along a single wire (the SDA line).

For more detailed information on I2C Click Here

Components Required for this tutorial :

Circuit Diagram

Arduino I2C LCD Circuit Diagram
Arduino I2C LCD Circuit Diagram

The Connections are as Follows:

GND –> GND

VCC —> 5V

SDA —> A4

SCL —> A5

Code

/*
   Arduino I2C LCD 16X2 Tutorial.
   Created By - Alpha Electronz
   Date Created - 13-01-2020
   For more information - http://alphaelectronz.com/arduino-i2c-lcd/
*/
#include <LiquidCrystal_I2C.h>
//I2C pins declaration
LiquidCrystal_I2C lcd(0x27, 16,2);
void setup()
{

  lcd.begin(); //Defining 16 columns and 2 rows of lcd display
  lcd.backlight();//To Power ON the back light
  //lcd.backlight();// To Power OFF the back light
}
void loop()
{
  //Write your code
  lcd.setCursor(0, 0); //Defining positon to write from first row,first column .
  lcd.print(" Alpha Electronz "); //You can write 16 Characters per line .
  delay(1000);//Delay used to give a dynamic effect
  lcd.setCursor(0, 1); //Defining positon to write from second row,first column .
  lcd.print("Like | Share");
  delay(8000);

  lcd.clear();//Clean the screen
  lcd.setCursor(0, 0);
  lcd.print(" SUBSCRIBE ");
  lcd.setCursor(0, 1);
  lcd.print(" Alpha Electronz ");
  delay(8000);
}

Hope you like the Tutorial.

If you have any doubts feel free to ask in the comment section.
 

The post I2C LCD 16X2 Interfacing with Arduino appeared first on Alpha Electronz.

]]>
https://alphaelectronz.com/arduino-i2c-lcd/feed/ 0 1025