In this tutorial we will take a look at how you can send multiple sensor readings from an Arduino board via Bluetooth to an Android device by building a simple app in MIT App Inventor 2..
Check us out on Facebook!
Links:
learning Arduino for beginners EP#21 DHT11 and DHT22 temp and humidity sensor
Why code you copy from a website does not work in your arduino IDE
Schematic:
MIT APP Inventor 2 blocks:
ARDUINO Code:
#include <SimpleDHT.h>
int pinDHT11 = 6;
SimpleDHT11 dht11;
int lvl;
void setup() {
Serial.begin(9600);
}
void loop() {
byte temperature = 0;
byte humidity = 0;
dht11.read(pinDHT11, &temperature, &humidity, NULL);
Serial.print((int)temperature);
Serial.print(” C”);
Serial.print(“|”);
Serial.print((int)humidity);
Serial.println(” %”);
delay(5000);
}