0% found this document useful (0 votes)
80 views

Final Report (Zain)

The document provides an overview of Arduino, including what it is, the Arduino board, Arduino software, and why Arduino is used. Some key points: - Arduino is an open-source hardware platform for building interactive objects and prototypes that can sense and control the physical world. - The Arduino board contains a microcontroller, inputs for sensors, and outputs to control lights, motors and other devices. - The Arduino software uses a programming language and environment to code what the Arduino board does. - Arduino is inexpensive, cross-platform, has a simple programming environment, and is open-source both for its hardware and software, making it accessible for educators,
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
80 views

Final Report (Zain)

The document provides an overview of Arduino, including what it is, the Arduino board, Arduino software, and why Arduino is used. Some key points: - Arduino is an open-source hardware platform for building interactive objects and prototypes that can sense and control the physical world. - The Arduino board contains a microcontroller, inputs for sensors, and outputs to control lights, motors and other devices. - The Arduino software uses a programming language and environment to code what the Arduino board does. - Arduino is inexpensive, cross-platform, has a simple programming environment, and is open-source both for its hardware and software, making it accessible for educators,
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 29

WHAT IS ARDUINO?

Arduino is an open-source hardware stage in light of simple to-utilize equipment and


programming. It's expected for anybody making intelligent tasks.
ARDUINO BOARD
Arduino faculties’ nature by getting inputs from numerous sensors, and influences its surroundings
by controlling lights, engines, and different actuators.
ARDUINO SOFTWARE
You can advise your Arduino what to do by composing code in the Arduino programming dialect
and utilizing the Arduino improvement environment.
Introduction
Arduino is a gadget for seeming admirably and great and control a more prominent measure of the
physical world than your desktop PC. It's an open-source physical enrolling stage in light of an
essential microcontroller board, and a change area for making programming for the board. Arduino
can be used to make instinctive articles, taking inputs from a blend of switches or sensors, and
controlling a blended pack of lights, motors, and other physical yields. Arduino endeavors can be
stay singular, or they can talk with programming running on your PC (e.g. Blast, Processing,
MaxMSP.) The plans to leave can be gathered by hand or acquired preassembled; the open-source
IDE can be downloaded for free.The Arduino programming lingo is a use of Wiring, a relative
physical figuring stage, which is in perspective of the Processing media programming
environment.
Why Arduino?
 There are various diverse microcontrollers and microcontroller stages available for
physical figuring. Parallax Basic Stamp, Netmedia's BX-24, Phidgets, MIT's Handyboard,
and various others offer practically identical convenience. These instruments take the
tangled purposes of enthusiasm of microcontroller programming and wrap it up in an easy
to-use pack. Arduino furthermore improves the procedure of working with
microcontrollers, yet it offers some inclination for educators, understudies, and charmed
amateurs over diverse structures:
 Inexpensive - Arduino sheets are moderately modest contrasted with other microcontroller
stages. The slightest lavish adaptation of the Arduino module can be gathered by hand, and
even the preassembled Arduino modules cost not exactly 0 $
 Cross-stage - The Arduino programming keeps running on Windows, Macintosh OSX, and
Linux working frameworks. Most microcontroller frameworks are restricted to Window
 Simple, clear programming environment - The Arduino programming environment is
anything but difficult to-use for apprentices, yet sufficiently adaptable for cutting edge
clients to exploit too. For educators, its advantageously in view of the Processing
programming environment, so understudies figuring out how to program in that
environment will be acquainted with the look and feel of Ardui
 Open source and extensible programming -The Arduino programming is distributed as
open source apparatuses, accessible for augmentation by experienced developers. The
dialect can be extended through C++ libraries, and individuals needing to comprehend the
specialized subtle elements can make the jump from Arduino to the AVR C programming
dialect on which its based. Essentially, you can include AVR-C code straightforwardly into
your Arduino programs in the event that you need to.
 Open source and extensible equipment - The Arduino is in light of Atmel's ATMEGA8
and ATMEGA168 microcontrollers. The arrangements for the modules are distributed
under a Creative Commons permit, so experienced circuit planners can make their own
particular adaptation of the module, developing it and enhancing it. Indeed, even
moderately unpracticed clients can construct the breadboard adaptation of the module with
a specific end goal to see how it functions and spare cost.
Overview
The Arduino Uno is a microcontroller board in light of the ATmega328 (datasheet). It has 14
advanced data/yield pins (of which 6 can be utilized as PWM yields), 6 simple inputs, a 16 MHz
artistic resonator, a USB association, a force jack, an ICSP header, and a reset catch. It contains
everything expected to backing the microcontroller; just interface it to a PC with a USB link or
force it with an AC-to-DC connector or battery to begin.
Summary

Microcontroller ATmega328

Operating Voltage 5V

Input Voltage (recommended) 7-12V

Input Voltage (limits) 6-20V

Digital I/O Pins 14 (of which 6 provide PWM output)

Analog Input Pins 6

DC Current per I/O Pin 40 mA

DC Current for 3.3V Pin 50 mA

Flash Memory 32 KB (ATmega328) of which 0.5 KB used by bootloader

SRAM 2 KB (ATmega328)

EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz

Length 68.6 mm

Width 53.4 mm

Weight 25 g

Serial

Used for correspondence between the Arduino board and a PC or diverse devices. All Arduino
sheets have no under one serial port (generally called a UART or USART): Serial. It passes on
cutting edge sticks 0 (RX) and 1 (TX) and what's more with the PC through USB. Accordingly,
if you use these limits, you can't similarly use sticks 0 and 1 for mechanized information or
yield.
You can use the Arduino environment's understood serial screen to talk with an Arduino board.
Click the serial screen get in the toolbar and select the same baud rate used as a piece of the
call to begin().

Firmata Library
The Firmata library completes the Firmata tradition for talking with programming on the host PC.
This grants you to create custom firmware without expecting to make your own specific tradition
and articles for the programming environment that you are using.

LABVIEW
The Firmata library finishes the Firmata custom for conversing with programming on the host PC.
This awards you to make custom firmware without hoping to make your own particular convention
and articles for the programming environment that you are utilizing.
Why LABVIEW
NI LabVIEW structure layout writing computer programs is at the point of convergence of the
National Instruments stage. Giving thorough mechanical assemblies that you need to develop any
estimation or control application in radically less time, LabVIEW is the ideal progression
environment for advancement, divulgence, and revived results. Join the power of LabVIEW
programming with specific, reconfigurable gear to vanquish the relentlessly extending versatile
quality included in passing on estimation and control structures on time and under spending
arrangement.

Application areas:
 LabVIEW is an adaptable programming environment that can help you effectively
assemble your remarkable application, whether you're taking basic estimations or
prototyping with FPGA innovation.
 Automating measurements and processing signal data
 Instrument control
 Automating test and validation systems
 Designing embedded control and monitoring systems
 Academic teaching
VISA:
The Virtual Instrument Software Architecture (VISA) is a standard for organizing, programming,
and researching instrumentation systems containing GPIB, VXI, PXI, Serial, Ethernet, and/or USB
interfaces. VISA gives the programming interface between the hardware and headway
circumstances, for instance, LabVIEW, LabWindows/CVI, and Measurement Studio for Microsoft
Visual Studio. NI-VISA is the National Instruments execution of the VISA I/O standard. NI-VISA
fuses programming libraries, keen utilities, for instance, NI I/O Trace and the VISA Interactive
Control, and configuration programs through Measurement & Automation Explorer for all your
change needs. NI-VISA is standard over the National Instruments item advertising. With NI-VISA,
you can feel beyond any doubt that your item headway won't get the opportunity to be obsolete as
your instrumentation interface hardware needs progress into what's to come.
Android (Operating System):
Android is a convenient working system (OS) in perspective of the Linux bit and in no time became
by Google. With a customer interface considering direct control, Android is formed basically for
touchscreen mobile phones, for instance, PDAs and tablet PCs, with specific customer interfaces
for TVs (Android TV), cars (Android Auto), and wrist watches (Android Wear). The OS uses
touch inputs that unreservedly identify with certifiable exercises, for example, swiping, tapping,
crushing, and inverse pressing to control on-screen things, and a virtual comfort. Despite being
basically proposed for touchscreen data, it has furthermore been used as a piece of preoccupation
solaces, automated cams, general PCs, and diverse equipment.
PUTTY:
PuTTY is a free and open-source terminal emulator, serial console and framework record trade
application. It reinforces a couple framework traditions, including SCP, SSH, Telnet, rlogin, and
unrefined connection affiliation. It can in like manner interface with a serial port (since structure
0.59). The name "PuTTY" has no definitive significance.

Programs used in Project:


(1) Communicating serially (Tx and Rx) using PuTTY and LABVIEW
//mbyte byteRead;
#include <Firmata.h>
byte previousPIN[TOTAL_PORTS];
byte previousPORT[TOTAL_PORTS];
void outputPort(byte portNumber, byte portValue)
{
if (previousPIN[portNumber] != portValue) {
Firmata.sendDigitalPort(portNumber, portValue);
previousPIN[portNumber] = portValue;
}
}
void setPinModeCallback(byte pin, int mode) {
if (IS_PIN_DIGITAL(pin)) {
pinMode(PIN_TO_DIGITAL(pin), mode);
}
}
void digitalWriteCallback(byte port, int value)
{
byte i;
byte currentPinValue, previousPinValue;
if (port < TOTAL_PORTS && value != previousPORT[port]) {
for (i = 0; i < 8; i++) {
currentPinValue = (byte) value & (1 << i);
previousPinValue = previousPORT[port] & (1 << i);
if (currentPinValue != previousPinValue) {
digitalWrite(i + (port * 8), currentPinValue);
}
}
previousPORT[port] = value;
}
}
void setup()
{
Firmata.setFirmwareVersion(0, 1);
Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);
Firmata.attach(SET_PIN_MODE, setPinModeCallback);
Firmata.begin(10);
pinMode(4,OUTPUT);
Serial.begin(9600);
}
void loop()
{
if (Serial.available()) {
char b = Serial.read();
Serial.print(b);
}
}

(2) Ultrasonic sensor program:


const int trigPin = 8;
const int echoPin = 9;
void setup() {
Serial.begin(9600);
}
void loop()
{
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2);
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
pinMode(echoPin, INPUT);
duration = pulseIn(echoPin, HIGH);
inches = microsecondsToInches(duration);
cm = microsecondsToCentimeters(duration);
if (Serial.available()) {
char b = Serial.read();
Serial.print(b);
}
Serial.print(inches);
Serial.print("in, ");
Serial.print(cm);
Serial.print("cm");
Serial.println();
delay(100);
}
long microsecondsToInches(long microseconds)
{
return microseconds / 74 / 2;
}
long microsecondsToCentimeters(long microseconds)
{
return microseconds / 29 / 2;
}

(3) Program for playing music using Arduino Tone Library:


#define NOTE_B0 31
#define NOTE_C1 33
#define NOTE_CS1 35
#define NOTE_D1 37
#define NOTE_DS1 39
#define NOTE_E1 41
#define NOTE_F1 44
#define NOTE_FS1 46
#define NOTE_G1 49
#define NOTE_GS1 52
#define NOTE_A1 55
#define NOTE_AS1 58
#define NOTE_B1 62
#define NOTE_C2 65
#define NOTE_CS2 69
#define NOTE_D2 73
#define NOTE_DS2 78
#define NOTE_E2 82
#define NOTE_F2 87
#define NOTE_FS2 93
#define NOTE_G2 98
#define NOTE_GS2 104
#define NOTE_A2 110
#define NOTE_AS2 117
#define NOTE_B2 123
#define NOTE_C3 131
#define NOTE_CS3 139
#define NOTE_D3 147
#define NOTE_DS3 156
#define NOTE_E3 165
#define NOTE_F3 175
#define NOTE_FS3 185
#define NOTE_G3 196
#define NOTE_GS3 208
#define NOTE_A3 220
#define NOTE_AS3 233
#define NOTE_B3 247
#define NOTE_C4 262
#define NOTE_CS4 277
#define NOTE_D4 294
#define NOTE_DS4 311
#define NOTE_E4 330
#define NOTE_F4 349
#define NOTE_FS4 370
#define NOTE_G4 392
#define NOTE_GS4 415
#define NOTE_A4 440
#define NOTE_AS4 466
#define NOTE_B4 494
#define NOTE_C5 523
#define NOTE_CS5 554
#define NOTE_D5 587
#define NOTE_DS5 622
#define NOTE_E5 659
#define NOTE_F5 698
#define NOTE_FS5 740
#define NOTE_G5 784
#define NOTE_GS5 831
#define NOTE_A5 880
#define NOTE_AS5 932
#define NOTE_B5 988
#define NOTE_C6 1047
#define NOTE_CS6 1109
#define NOTE_D6 1175
#define NOTE_DS6 1245
#define NOTE_E6 1319
#define NOTE_F6 1397
#define NOTE_FS6 1480
#define NOTE_G6 1568
#define NOTE_GS6 1661
#define NOTE_A6 1760
#define NOTE_AS6 1865
#define NOTE_B6 1976
#define NOTE_C7 2093
#define NOTE_CS7 2217
#define NOTE_D7 2349
#define NOTE_DS7 2489
#define NOTE_E7 2637
#define NOTE_F7 2794
#define NOTE_FS7 2960
#define NOTE_G7 3136
#define NOTE_GS7 3322
#define NOTE_A7 3520
#define NOTE_AS7 3729
#define NOTE_B7 3951
#define NOTE_C8 4186
#define NOTE_CS8 4435
#define NOTE_D8 4699
#define NOTE_DS8 4978
void GameOfThrones();
int speakerPin=4;
#include <Firmata.h>
byte previousPIN[TOTAL_PORTS]; // PIN means PORT for input
byte previousPORT[TOTAL_PORTS];
void outputPort(byte portNumber, byte portValue)
{
if (previousPIN[portNumber] != portValue) {
Firmata.sendDigitalPort(portNumber, portValue);
previousPIN[portNumber] = portValue;
}
}
void setPinModeCallback(byte pin, int mode) {
if (IS_PIN_DIGITAL(pin)) {
pinMode(PIN_TO_DIGITAL(pin), mode);
}
}
void digitalWriteCallback(byte port, int value)
{
byte i;
byte currentPinValue, previousPinValue;
if (port < TOTAL_PORTS && value != previousPORT[port]) {
for (i = 0; i < 8; i++) {
currentPinValue = (byte) value & (1 << i);
previousPinValue = previousPORT[port] & (1 << i);
if (currentPinValue != previousPinValue) {
digitalWrite(i + (port * 8), currentPinValue);
}
}
previousPORT[port] = value;
}
}
void setup()
{
Firmata.setFirmwareVersion(0, 1);
Firmata.attach(DIGITAL_MESSAGE, digitalWriteCallback);
Firmata.attach(SET_PIN_MODE, setPinModeCallback);
Firmata.begin(9600);
pinMode(4,OUTPUT);
}
void loop(){
char ser = Serial.read();
switch (ser) {
case '0':
tone(4, 440, 1000);
delay(100);
tone(4, 993, 100);
delay(100);
tone(4, 300, 1000);
delay(100);
tone(4, 1100, 100);
delay(100);
break;
case '1':
GameOfThrones();
tone(4, 993, 100);
delay(100);
tone(4, 600, 1000);
delay(100);
delay(100);
break;
case '2':
tone(4, 3000, 1000); // Play tone for 1 second
delay(100);
tone(4, 300, 1000);
delay(100);
break;
}
}
void GameOfThrones()
{
for(int i=0; i<4; i++)
{
tone(speakerPin, NOTE_G4);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_DS4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(250);
noTone(speakerPin);
}
for(int i=0; i<4; i++)
{
tone(speakerPin, NOTE_G4);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_E4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(250);
noTone(speakerPin);
}
tone(speakerPin, NOTE_G4);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(500);
tone(speakerPin, NOTE_DS4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(500);
noTone(speakerPin);
for(int i=0; i<3; i++)
{
tone(speakerPin, NOTE_G3);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_AS3);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(500);
noTone(speakerPin);
}//
tone(speakerPin, NOTE_G3);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_AS3);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_AS3);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_DS4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_AS3);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_DS4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(500);
noTone(speakerPin);
for(int i=0; i<3; i++)
{
tone(speakerPin, NOTE_GS3);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_AS3);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_F3);
delay(500);
noTone(speakerPin);
}
tone(speakerPin, NOTE_G4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_DS4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_G4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(1000);
noTone(speakerPin);
tone(speakerPin, NOTE_DS4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_F4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(500);
noTone(speakerPin);
for(int i=0; i<4; i++)
{
tone(speakerPin, NOTE_G3);
delay(500);
noTone(speakerPin);
tone(speakerPin, NOTE_AS3);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_C4);
delay(250);
noTone(speakerPin);
tone(speakerPin, NOTE_D4);
delay(500);
noTone(speakerPin);
}
}

(4)Automation code using Arduino:


void setup() {
Serial.begin(9600);
pinMode(11, OUTPUT);
pinMode(12, OUTPUT);
pinMode(13, OUTPUT);
}
char rx_byte = 0;
void loop() {
if (Serial.available() > 0) {
rx_byte = Serial.read();
switch (rx_byte) {
case '1':
digitalWrite(11, HIGH);
Serial.println("RED LED is ON");
break;
case '2':
digitalWrite(11, LOW);
Serial.println("RED LED is OFF");
break;
case '3':
digitalWrite(12, HIGH);
Serial.println("GREEN LED is ON");
break;
case '4':
digitalWrite(12, LOW);
Serial.println("GREEN LED is OFF");
break;
case '5':
digitalWrite(13, HIGH);
Serial.println("WHITE LED is ON");
break;
case '6':
digitalWrite(13, LOW);
Serial.println("WHITE LED is OFF");
break;
default:
Serial.println("Invalid option");
break;
}
}
}

(5) SD card excess using arduino for sending files serially:


#include <SPI.h>
#include <SD.h>
const int chipSelect = 4;
void setup()
{
Serial.begin(9600);
Serial.print("Initializing SD card...");
pinMode(10, OUTPUT);
if (!SD.begin(chipSelect)) {
Serial.println("Card failed, or not present");
return;
}
Serial.println("card initialized.");
}
char rx_byte = 0;
void loop()
{
if (Serial.available() > 0) {
rx_byte = Serial.read();

File dataFile = SD.open("datalog.txt");


File yesFile = SD.open("yes.txt");
File testFile = SD.open("test.txt");
switch (rx_byte) {
case '1':
if (dataFile) {
while (dataFile.available()) {
Serial.write(dataFile.read());
}
dataFile.close();
}
else {
Serial.println("datalog.txt");
}
break;
case '2':
if (yesFile) {
while (yesFile.available()) {
Serial.write(yesFile.read());
}
yesFile.close();
}
else {
Serial.println("yes.txt");
}
break;
case '3':
if (testFile) {
while (testFile.available()) {
Serial.write(testFile.read());
}
testFile.close();
}
else {
Serial.println("test.txt");
}
break;
default:
Serial.println("Invalid option");
break;
}
}
}

(6) Arduino Code for Android application:


#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int msDeley = 50;
int sensorValue = 0;
int ambientLight = 0;
const boolean debug = true;
const int signalLenHigh = 80;
const int signalLenLow = 40;
int signalStateLast = 0;
int signalStateCurrent = 0;
long int signalLastTime = 0;
long int signalLen = 0;
String inByte = "";
String recieved = "";
String lcdLine = "";
void setup() {
Serial.begin(115200);
lcd.begin(16, 2);
pinMode(A5, INPUT);
pinMode(A4, OUTPUT);
ambientLight = analogRead(A5);
for(int i=0; i<10; i++){
ambientLight = (ambientLight*0.9) + (analogRead(A5)*0.1);
delay(100);
}
ambientLight = max(500, ambientLight);
lcdLine = "Ok H:";
lcdLine += signalLenHigh;
lcdLine += " L:";
lcdLine += signalLenLow;
lcd.print(lcdLine);
Serial.println(lcdLine);
lcd.setCursor(0, 1);
lcdLine = "Ambient: ";
lcdLine += ambientLight;
lcd.print(lcdLine);
Serial.println(lcdLine);
}
char getBinChar(){
if(signalStateLast == 1){
return '-';
}
if(signalLen >= signalLenLow * 0.3 && signalLen <= signalLenLow * 1.5){
monitorSignalLen(signalLen , '0');
return '0';
}else if(signalLen >= signalLenHigh * 0.8 && signalLen <= signalLenHigh * 2){
monitorSignalLen(signalLen , '1');
return '1';
}else if(signalLen > signalLenHigh*3) {
monitorSignalLen(signalLen , '-');
recieved = "";
inByte = "";
return '-';
}else{
return '-';
}
}
void monitorSignalLen(long sig, char c){
if(debug){
Serial.print("plot:");
Serial.print(sig);
Serial.print(":");
Serial.println(c);
}
}
void loop() {
sensorValue = analogRead(A5);
if(sensorValue >= ambientLight ){
signalStateCurrent = 1;
}else{
signalStateCurrent = 0;
}
if(signalStateCurrent == signalStateLast){
signalLen = millis() - signalLastTime;
}else{
signalLen = millis() - signalLastTime;
char cBit = getBinChar();
if(cBit != '-'){
digitalWrite(A4, 1);
inByte += cBit;
lcd.clear();
lcd.setCursor(0, 1);
lcd.print(inByte);
}else{
digitalWrite(A4, 0);
}
signalLastTime = millis();
signalStateLast = signalStateCurrent;
}
if(inByte.length() == 8){
const char * c = inByte.c_str();
recieved += (char) strtol(c, NULL, 2);
Serial.println(recieved);
lcd.setCursor(0, 0);
lcd.clear();
lcd.print(recieved);
inByte = "";
}
}
(7) Android Application Code:
Due to extensive coding techniques the application and the source code can be found at the link
given below.
LABVIEW GUI :

Application of Visible Light Communication:

There are many applications for VLC and here are some top applications areas.

1. SMART LIGHTING

Smart buildings require smart lighting. Smart lighting with VLC provides the infrastructure for
illumination, control and communications and will greatly reduce wiring and energy consumption
within a building.

2. MOBILE CONNECTIVITY

By pointing a visible light at another device you can create a very high speed data link with inherent
security. This overcomes the problems of having to pair or connect and provides a much higher
data rate than Bluetooth or WiFi.
3. HAZARDOUS ENVIRONMENTS
Communicating in areas where there is risk of explosions can be a problem (e.g. in mines, petro-
chemical plants, oil rigs etc.) . VLC is inherently safe and provides both safe illumination and
communications.

4. VEHICLE & TRANSPORTATION


Many cars already LED lamps. Traffic signage, traffic lights, and street lamps are adopting the
LED technology so there are massive applications opportunities here.

5. DEFENCE & SECURITY


The ability to send data quickly and in a secure way is the key to many applications. The fact that
the visible light cannot be detected on the other side of a wall had great security advantages.

6. HOSPITALS & HEALTHCARE


There are advantages for using VLC in hospitals and in healthcare. Mobile phones and WiFi’s are
undesirable in certain parts of hospitals, especially around MRI scanners and in operating theatres.

7. WiFi SPECTRUM RELIEF


WiFi’s have got faster over but cannot keep up with demand for wireless data. VLC can provide
data rates greatly in excess of current WiFi and this can be done at low cost since the RF
components and antenna system have been eliminated.

8. AVIATION
Radio is undesirable in passenger compartments of aircraft. LEDs are already used for illumination
and can also be used instead of wires to provide media services to passengers. This reduces the
aircraft construction costs and its weight.

9. UNDERWATER COMMUNICATIONS
RF does not work underwater but visible light can support high speed data transmission over short
distances in this environment. This could enable divers and underwater vehicles to talk to each
other.
10. LOCATION BASED SERVICES
Each visible light information source can be uniquely identified, so the location of any VLC device
can be identified quickly and accurately.

You might also like