In this tutorial I’ll show how you can create your own LED Cube 3x3x3. I’m sure you’ve already seen some similar projects to this one but you never took action and made your own. Now it’s time to make your own! Materials needed
May be you don't know how to use an ultrasonic sensor to measure the distance with an LCD display, so in this instructable I decided to make you happy and help you getting started. This sensor is very popular among the Arduino Geeks. In this project the ultrasonic sensor read and write the distance between the sensor and the object in front of it in the LCD display, It’s really simple.
My goal is to help you understand how this sensor works and then you can use this example in your own projects.
#include<SoftwareSerial.h>
int sensorPin = A0; // select the input pin for the LDR
int sensorValue = 0; // variable to store the value coming from the sensor
int led = 9; // Output pin for LED
int buzzer = 12; // Output pin for Buzzer
void setup() {
// declare the ledPin and buzzer as an OUTPUT:
pinMode(led, OUTPUT);
pinMode(buzzer,OUTPUT);
Serial.begin(9600);
}
void loop()
{
Serial.println("Welcome to TechPonder Flame Sensor Tutorial");
sensorValue = analogRead(sensorPin);
Serial.println(sensorValue);
if (sensorValue < 100)
{
Serial.println("Fire Detected");
Serial.println("LED on");
digitalWrite(led,HIGH);
digitalWrite(buzzer,HIGH);
delay(1000);
}
digitalWrite(led,LOW);
digitalWrite(buzzer,LOW);
delay(sensorValue);
}
Results are displayed on the serial window.
When there is Flame the LED and Buzzer automatically ON and when there is no flame amount Arduino automatically turns off LED and Buzzer.
Here based on our room condition the threshold value we took was 100 for the Flame sensor.
When we place a Flame Near Flame Sensor Arduino automatically turns onthe LED and Buzzer. When we remove Flame from the flame sensor Arduino automatically Turns Off LED and buzeer.
Toestablish a good communication between human world and machine world, display units play an important role. And so they are an important part of embedded systems. Display units - big or small, work on the same basic principle. Besides complex display units like graphic displays and 3D dispays, one must know working with simple displays like 16x1 and 16x2 units. The 16x1 display unit will have 16 characters and are in one line. The 16x2 LCD will have 32 characters in total 16in 1st line and another 16 in 2nd line. Here one must understand that in each character there are 5x10=50 pixels so to display one character all 50 pixels must work together. But we need not to worry about that because there is another controller (HD44780) in the display unit which does the job of controlling the pixels. (you can see it in LCD unit, it is the black eye at the back ).
this tutorial we are going to interface a 16x2 LCD with ARDUINO UNO. Unlike normal development boards interfacing a LCD to a ARDUINO is quite easy. Here we don’t have to worry about data sending and receiving. We just have to define the pin numbers and it will be ready to display data on LCD.
Components Required
Hardware: ARDUINO UNO, power supply (5v), JHD_162ALCD(16x2LCD), 100uF capacitor.
Software: Arduino IDE (Arduino nightly).
Circuit Diagram and Explanation
In 16x2 LCD there are 16 pins over all if there is a back light, if there is no back light there will be 14 pins. One can power or leave the back light pins. Now in the 14 pins there are 8 data pins (7-14 or D0-D7), 2 power supply pins (1&2 or VSS&VDD or GND&+5v), 3rd pin for contrast control (VEE-controls how thick the characters should be shown), and 3 control pins (RS&RW&E).
In the circuit, you can observe I have only took two control pins, this gives the flexibility. The contrast bit and READ/WRITE are not often used so they can be shorted to ground. This puts LCD in highest contrast and read mode. We just need to control ENABLE and RS pins to send characters and data accordingly.The connections which are done for LCD are given below:
PIN1 or VSS to ground
PIN2 or VDD or VCC to +5v power
PIN3 or VEE to ground (gives maximum contrast best for a beginner)
PIN4 or RS (Register Selection) to PIN0 of ARDUINO UNO
PIN5 or RW (Read/Write) to ground (puts LCD in read mode eases the communication for user)
PIN6 or E (Enable) to PIN1 of ARDUINO UNO
PIN11 or D4 to PIN8 of ARDUINO UNO
PIN12 or D5 to PIN9 of ARDUINO UNO
PIN13 or D6 to PIN10 of ARDUINO UNO
PIN14 or D7 to PIN11 of ARDUINO UNO
The ARDUINO IDE allows the user to use LCD in 4 bit mode. This type of communication enables the user to decrease the pin usage on ARDUINO, unlike other the ARDUINO need not to be programmed separately for using it in 4 it mode because by default the ARDUINO is set up to communicate in 4 bit mode. In the circuit you can see we have used 4bit communication (D4-D7).
So from mere observation from above table we are connecting 6 pins of LCD to controller in which 4 pins are data pins and 2 pins for control
Code:/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
modified 7 Nov 2016
by Arturo Guadalupi
// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to constintrs=12,en=11,d4=5,d5=4,d6=3,d7=2; LiquidCrystallcd(rs,en,d4,d5,d6,d7);
voidsetup(){ // set up the LCD's number of columns and rows: lcd.begin(16,2); // Print a message to the LCD. lcd.print("burada bro's"); }
voidloop(){ // set the cursor to column 0, line 1 // (note: line 1 is the second row, since counting begins with 0): lcd.setCursor(0,1); // print the number of seconds since reset: lcd.print(millis()/1000); }
This video shows how to use KY-038 Sound Sensor using Arduino. It also shows how you can control LED by clap with the help of Arduino and Sound Sensor. We have shown only to control LED, but by using the same concept you can control any electronic device.
It is a machine that follows a line, either a black line on white surface or vise-versa. For Beginners it is usually their first robot to play with. In the following steps you will completely understand the concept of line follower.
Now we are going to build a line follower which will follow black line on a white surface, we will be using two IR sensor pair which will have an IR LED and Photo diode.
WORKING OF IR SENSOR:
Generally IR rays will be reflected by white surface while black surface will absorb IR rays.In the line follower that we are going to build, both the IR sensors will be on the white surface . IR rays will be emitted and reflected back which will be detected by the Photo diode, in this state the IR sensor will send a HIGH digital signal ("1"). similarly when the sensor is on a black surface IR rays will be emitted and will not be reflected back which will be absorbed by the black surface, in this state the IR sensor will send LOW digital signal ("0"). Thus with these digital values 1 and 0 we can easily identify the state of the sensors.
Component required
1) IC7805 Voltage Regulator - 1
2) L293D Motor Driver - 1
3) IR LED pair - 2
4) 300-500rpm DC Motor - 2
5) Battery 9v-12v - 1
6) Breadboard - 1
7) Chasis - 1
8) Castor wheel - 1
9) Wheels - 2
Give the connections as per the circuit given and place the whole setup on the chasis.
L293D:
The digital signal given to the INPUT 1,2,3 and 4 of L293D will be thrown back to the OUTPUT 1,2,3 and 4 respectively. The INPUT 2 and 3 of L293D is connected to ground which is LOW("0") and the signal from the IR sensors are connected to INPUT 1 and 4. Hence the value of OUTPUT 2 and 3 will be constantly LOW("0") while the value of OUTPUT 1 and 4 will be HIGH("1") when the IR sensor is on the white surface and will be LOW("0") when the sensor is on black surface.
that's it, now you can enjoy your own simple Line follower robot If u have any doubts feel free to ask
Wednesday, 18 April 2018
How to make bluBluetoo control home automation
Materials needed
Hc-05 module
Aurdino
Breadboard
Really and etc
Hello gyz in this tutorial i will show how to control home automation using
ARDUINO
RELLAY
BLUETOOTH MODUEL
In this tutorial i will show
- how to connect bluetooth moduel
- how to connect rellay to arduino and 220v ac And how to put them all together.
It is really easy to do the connection and please take care while handling 220v ac.
In the same way you can control your home automation's very easily
} //-----------------------------------------------------------------------// void loop() { 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 readdata += c; //build the string- "forward", "reverse", "left" and "right" } if (readdata.length() > 0) { Serial.println(readdata);