Professional Documents
Culture Documents
MBCET, Trivandrum
3-4 Feb 2018
About Us
• Neo Green Labs : Research & Development
• Applications
• Challenges
Wearable Device
(UC, Sensors,
Smart Phone Battery,
APP connectivity)
Our Demo Band: Body Temperature
Monitor
Wearable Body
Temperature
Smart Phone Monitor
APP
Our Microcontroller
• ESP12f
ESP8266
ESP8266
• Espressif , China
• Famous – 2013
• Why ESP8266?
– Cost
• PCB Antenna
• Peripherals …
• 16 pin Device
• 9 GPIO
• ADC
• Reset
• Enable (Ch-PD
• 3.3V
How do you start?
Let’s Start!
– Hardware Circuit
• Power Supply
Power Supply
U1 VCC
J3 U2
LM7805
1 1 3 3 2
2 VI VO VIN VOUT
GND
ADJ
3 C1 C2 C3
100uF 10uF 0.1uF R1
LM317
390R
Adapter 12V
2
1
R2
C4 680R
1uF
Let’s Start!
– Hardware Circuit
• Power Supply
• Communication
Communication
Let’s Start!
– Hardware Circuit
• Power Supply
• Communication
• Driver Installation
Let’s Start!
– Hardware Circuit
• Power Supply
• Communication
• Driver Installation
– Software Installation
• Installing Arduino Software
Let’s Start!
– Hardware Circuit
• Power Supply
• Communication
• Driver Installation
– Software Installation
• Installing Arduino Software
• Applications
– Reading a Digital Sensor or switches
pinMode(<pin>,<I/O>);
Eg: pinMode(13,OUTPUT);
digitalWrite(<pin>,<H/L>);
Eg: digitalWrite(13,HIGH);
void setup()
{
pinMode(13,OUTPUT);
}
void loop()
{
digitalWrite(13,HIGH);
}
Uploading /Flashing
• GPIO15 should be LOW
• And upload
Blink the LED Connected to GPIO13
Functions
delay(<milliseconds>);
Eg: delay(1000);
void setup()
{
pinMode(13,OUTPUT);
}
void loop()
{
digitalWrite(13,HIGH);
delay(1000);
digitalWrite(13,LOW);
delay(1000);
}
Control LED connected to GPIO13 using
and external switch connected to GPIO4
Functions
digitalRead(<pin>);
pinMode(13,OUTPUT);
pinMode(14,INPUT);
void loop()
char sta=digitalRead(14);
if(sta==1)
digitalWrite(13,HIGH);
else
digitalWrite(13,LOW);
}
}
void setup()
Serial.begin(9600);
pinMode(5,INPUT);
void loop()
char sta=digitalRead(5);
if(sta==1)
Serial.println(“pin 5 is high”);
else
Serial.println(“pin 5 is low”); }
}
Serial Communication (UART)
Functions
Serial.begin(<baudrate>);
Serial.println(<>);
Write a program to send hello
continuously to your computer
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.println(“hello, I am esp12”);
}
Make GPIO5 as input
Send the status of GPIO5 to the computer
and view in your serial monitor
Analog to Digital Converter
Functions
analogRead(<pin>);
void setup()
{
Serial.begin(115200);
WiFi.mode(WIFI_AP);
WiFi.softAP(“RIT”, “12345678”);
Serial.println(WiFi.softAPIP());
wearable.begin();
}
How do you find the details of
client?
• WiFiClient <client name>;
• <clientname>=<Servername>.available()
• <clientname>.remoteIP();`
• if (request.indexOf(“hello") != -1)
while(client1.available() ==0 && client1.connected()==1)
{
delay(10);
}
String request = client1.readStringUntil('\r');
Serial.println(request);
if (request.indexOf(“temp”) != -1)
{
client1.println(“request received”);
}
client1.flush();
Read the temperature and send it to
your mobile
while(client1.available() ==0 && client1.connected()==1)
{
delay(10);
}
String request = client1.readStringUntil('\r');
Serial.println(request);
if (request.indexOf(“temp”) != -1)
{
// read temperature here
}
client1.flush();
App Development
• Using MIT AppInventor
Thank You
Thomas Sabu
www.ngltraining.in
thomas@neogreenlabs.com
9495242563