The projects which are using various Arduino boards,various sensors, shields and computer programming languages like processing,visual c#,java and android apps
I developed an Android application its name is Arduino Lamp Controller by which you can control Lamps with Arduino and Bluetooth Device wirelessly. Hardware Required
Here, We are going test the Arduino by using a program its name is "Arduino blinking". we are testing Arduino by blinking its L1 SMD led which is corresponding to pin 13.
Procedure
Just connect Arduino with your pc or laptop and upload following program.
Program
/* This program is to test the Arduino*/ const int led=13;
void setup() {
// put your setup code here, to run once: pinMode(led,OUTPUT); //declaring pin 13 as Output }
void loop() {
// put your main code here, to run repeatedly: digitalWrite(led,HIGH); // led blink delay(1000); //make delay for one second
// led off time digitalWrite(led,LOW); //led will got off delay(1000); // delay for one second
} Video
2. Arduino blinking an external LED
Here, I am going to blink an external led and practicing the function digitalWrite(). we reacquired one led has rating of 5V and 220 ohm resistance which is connecting to reduce the current flowing through the led. An arduino pin carry only 20 ma current.
Connect pin 13 to anode of led (Anode of led is the longest pin), connect 220 ohm resistance with cathode. one end of resistance connect to ground
Video
Program
/* This program is to blink an led with an Arduino*/ const int led=13;//led connect with this pin
void setup() {
// put your setup code here, to run once: pinMode(led,OUTPUT); //declaring pin 13 as Output }
void loop() {
// put your main code here, to run repeatedly: digitalWrite(led,HIGH); // led blink delay(1000); //make delay for one second
// led off time digitalWrite(led,LOW); //led will got off delay(1000); // delay for one second
I am going to control 3 LEDs by using a mobile phone which is running in Android OS. Here, i am using android phone as remote to control led. I can switch on and switch off light and control the brightness of one led also. I made android app by MIT app inventor. You can download android app by searching "light" in MIT app inventor gallery after log on to this site or you can download by link https://drive.google.com/file/d/0B_w5O5-1CXjJU3hCcHoyempBREk/view?usp=sharing.
For installing this app, don't forget to enable phone to install app from Unknown sources. For this go to Settings~Security~Unknown sources and enable Allow installation of apps from unknown sources
Circuit Diagram
HC06 Connection
Connect Vcc of HC06 to +5v of Arduino.
Connect Gnd of HC06 to Gnd of Arduino.
Connect Tx of HC06 to pin 10 of arduino.
Connect Rx of HC06 to pin 11 of arduino.
Video
Arduino Script
#include <SoftwareSerial.h> SoftwareSerial Bt(10,11);//Rx of HC06 to 11 & Tx to 10 int val; // recieving value as intiger from HC06 bluetooth device void setup() { Bt.begin(9600); pinMode(7,OUTPUT);//pin 7,8 & 9 as output pinMode(8,OUTPUT); pinMode(9,OUTPUT);//pin 9 is also using as PWM output to //controll brightness } void loop() { if(Bt.available()>0) { val=Bt.read(); } if(val>100) { switch(val) { case 101: { digitalWrite(7,1); break; } case 102: { digitalWrite(7,0); break; } case 103: { digitalWrite(8,1); break; } case 104: { digitalWrite(8,0); break; } case 105: { digitalWrite(9,1); break; } case 106: { digitalWrite(9,0); break; } case 107: { digitalWrite(7,1); digitalWrite(8,1); digitalWrite(9,1); break; } case 108: { digitalWrite(7,0); digitalWrite(8,0); digitalWrite(9,0); break; } } } else { //maping value to 0 to 255 from 0 to 255 int mod_val=map(val,0,100,0,255); analogWrite(9,mod_val); }
In this project, I am going to make one Light meter by using light depended resistor (LDR) and showing Arduino to Arduino I2C communication through wire library. For light measurement display, I am using Nokia 5110 LCD display and library is using for that one is pcd8544 library, you can download it from internet by searching in google.
Connection Diagram
Program
1. Program for Master Arduino.
// Wire Master Writer
#include <Wire.h>
float light;
int x;
void setup()
{
Wire.begin();
Serial.begin(9600);
// join i2c bus (address optional for master)
}
void loop()
{
// connect LDR to analog A0 input by using 10 k ohm resistance as pull up resistor as shown in
// connection digram.
light=analogRead(A0);
x=map(light,0,1024,0,255);
Serial.println(x);
Wire.beginTransmission(8); // transmit to device #8
Wire.write("light intensity"); // sends five bytes
Wire.write(x); // sends one byte
Wire.endTransmission(); // stop transmitting
delay(500);
}
2. Program for Slave Arduino.
// Wire Slave Receiver
#include <Wire.h>
// Using wire library it is inbuilt in arduino IDE
#include <PCD8544.h>
// Library for nokia 5110 display. download it from internet
// Nokia 5110 lcd connection
// Nokia 5110 lcd is working wit 3.3 VDC so need to reduce +5v of arduino to 3.3V
// connect 10 k ohm resistance with every connection except vcc, Gnd and BL
// RST connect to 10 k-Ohm resistance series and pin no 6 of Arduino
// CE connect to 10 k-Ohm resistance series and pin no 7 of Arduino
// DC connect to 10 k-Ohm resistance series and pin no 5 of arduino
// Din connect to 10 k-Ohm resistance series and pin no 4 of arduino
// Clk connect to 10 k-Ohm resistance series and pin no 3 of arduino
this post is aims to sense and display Humidity and Temperature by using Arduino uno, Nokia 5110 LCD display and DHT22 Humidity sensor. These Hardwares are available in online markets like ebay,amazon and Ali Express.
Following video showing this project
PROGRAM
//To get DHT22 library go to menu option of IDE Sketch~Include library~Manage libraries and then //search like DHT sensor library. Then download DHT sensor library to your IDE.
//To get nokia lcd 5110 library download PCD8544 lcd library same lake above.
#include <PCD8544.h>
#include "DHT.h"
#define DHTPIN 8
// Connect pin 2 of the sensor to arduino pin 8
#define DHTTYPE DHT22
DHT dht(DHTPIN, DHTTYPE);
// DHT22 connection
// Connect pin 1 (on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
// to 3.3V instead of 5V!
// Connect pin 2 of the sensor to arduino pin 8
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
// Nokia 5110 lcd connection
// Nokia 5110 lcd is working wit 3.3 VDC so need to reduce +5v of arduino to 3.3V
// connect 10 k ohm resistance with every connection except vcc, Gnd and BL
// RST connect to 10 k-Ohm resistance series and pin no 6 of Arduino
// CE connect to 10 k-Ohm resistance series and pin no 7 of Arduino
// DC connect to 10 k-Ohm resistance series and pin no 5 of arduino
// Din connect to 10 k-Ohm resistance series and pin no 4 of arduino
// Clk connect to 10 k-Ohm resistance series and pin no 3 of arduino