Tag Archives: uno

Send data to Thinkspeak with ESP8266 by AT command

Published by:

In this experiment, by using AT commands we tried to connect our ESP8266 to Wi-fi, then send a data to Thingspeak.com website.

+ 

  • On Thingspeak website:

 

  • Read the 1st report and make the wiring as explained in that report.
  • Us following AT commands to connect to Thinkspeak
    • AT+CIPSTART=”TCP”,”api.thingspeak.com”,80
    • AT+CIPSEND=51
    • GET /update?key=YOUR_ API_Key&field1=YOUR_DATA_like_100 \r\n
    • AT+CIPCLOSE

Note:

AT+CIPSTART commands starts a TCP or UDP connection.

Parameters
– 0..7 – Connection number
– “TCP” or “UDP”
– Remote server IP address
– Remote server port
– remote domain name

AT+CIPSEND AT command is used to send the data over the TCP or UDP connection.

Usage:
AT+CIPSEND? = This returns the data length sent at a time

AT+CIPCLOSE AT command closes the TCP or UDP connection. It can be configured for slow close or quick close. When there are multi-IP connections, a connection number is also required.

 

 

Congratulations! You send data to Thinkspeak.

 

 

 

ARDUINO UNO Project 05: Mood Cue

Published by:

ARDUINO UNO Project 05: Mood Cue

Ingredients :

1- potentiometer       #1

2- capacitor 100µF    #2

3- Servo motor         #1

 

BUILD THE CIRCUIT

ARDUINO UNO Project 05: Mood Cue

 

 

Code:

#include <Servo.h>
Servo TestServo;
int const potPin=A0;
int potValue;
int angle;
void setup() {
TestServo.attach(9);
Serial.begin(9600);

}

void loop() {
potValue=analogRead(potPin);
Serial.print(“potValue: “);
Serial.print(potValue);
angle=map(potValue, 0,1023,0,179);
Serial.print(“,angle: “);
Serial.println(angle);
TestServo.write(angle);
delay(15);
}

ARDUINO UNO Project 03: Love-O-Meter

Published by:

Ingredients :

1- LED – RED                            # 3

2- Tempererature Sensor          #1

3- Wire

4- Resistor   220Ω                     #3

 

BUILD THE CIRCUIT

ARDUINO UNO Project 03 Love O Meter

ARDUINO UNO Project 03 Love O Meter

ARDUINO UNO Project 03 Love O Meter

 

Code:
const int SensorPin=A0;
const float baselineTemp=24.0;

void setup() {
for (int pinNum=3; pinNum<=5;pinNum++ ){
pinMode(pinNum, OUTPUT);
}
Serial.begin(9600);
}

void loop() {
int SensorValue=analogRead(SensorPin);
float voltage=(SensorValue/1024.0)*5.0;
float temperature=(voltage-.5)*100;

if(temperature<baselineTemp+2){
for (int pinNum=3; pinNum<=5;pinNum++ ){
digitalWrite(pinNum,LOW);}
} else if(temperature>= baselineTemp+2 && temperature<= baselineTemp+4 ){
digitalWrite(3, HIGH);
digitalWrite(4, LOW);
digitalWrite(5, LOW);
}else if(temperature> baselineTemp+4 && temperature<= baselineTemp+6 ){
digitalWrite(3, HIGH);
digitalWrite(4, HIGH);
digitalWrite(5, LOW);
}else if (temperature> baselineTemp+6 ){
for (int pinNum=3; pinNum<=5;pinNum++ ){
digitalWrite(pinNum,HIGH);}
}
Serial.print(“Base Line Temp: “);
Serial.print(baselineTemp);
Serial.print(” , Sensor Value: “);
Serial.print(SensorValue);
Serial.print(” , Volts: “);
Serial.print(voltage);
Serial.print(” , Temperature: “);
Serial.println(temperature);

delay(250);

}

 

ARDUINO UNO Project 02: Spaceship Interface

Published by:

Ingredients :

1- LED – RED                      # 2

2- LED – GREEN                 # 1

3- Switch                             #1

4- Wire

5- Resistor   220Ω              #3

6- Resistor   10KΩ              #1

BUILD THE CIRCUIT

ARDUINO UNO Project 02: Spaceship Interface

ARDUINO UNO Project 02: Spaceship Interface

ARDUINO UNO Project 02: Spaceship Interface

 

 

Code:

int KeyState=0;
void setup() {
// put your setup code here, to run once:
pinMode(2, INPUT);
pinMode(3, OUTPUT);
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
}

void loop() {
// put your main code here, to run repeatedly:
KeyState=digitalRead(2);
if (KeyState==0){
digitalWrite(3,HIGH);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
}else{
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);

delay(250);

digitalWrite(4,LOW);
digitalWrite(5,HIGH);

delay(250);

}

}