In this example we use the DHT22 (or AM2302) humidity/temperature sensor and the Arduino UNO board to read data and print it out to the serial monitor. The DHT22 is better than the DHT11 because it has a wider range of …
Code
-
-
In a previous example we connected a SHT21 temperature and humidity sensor to an Arduino – http://www.arduinolearning.com/code/sht21-humidity-and-temperature-sensor-example.php. This was a bit basic as the data was sent via the serial port, so lets add an LCD to display the temperature and …
-
I recently acquired a BMP180 barometric pressure sensor and was pleased to see that it used the BMP085 library from Adafruit, what I was interested in was how accurate the altitude reading was. This is a picture of the breakout …
-
Previously we showed an example of the fan module here http://www.arduinolearning.com/learning/basics/arduino-and-l9110-fan-module-example.php . This used digital I/O but of course you can send an analog value using a pin that supports PWM. I found out if the number was under 75 the fan …
-
The MQ-2 gas sensor module is suitable for detecting LPG, i-butane, propane, methane ,alcohol, Hydrogen, smoke. Code In this example we simply connect the AOUT to Analog pin 0 and read in the value and output this via the serial monitor …
-
Another example for the Arduino Esplora, we will read the value from the slider and play a tone based on that from the buzzer. You can see the location of these parts in the picture of the Esplora underneath This …
-
This example will display the temperature on an LCD connected to an Arduino Esplora Code [cpp] #include <Esplora.h> #include <TFT.h> #include <SPI.h> char tempCelsius[3]; char tempFahrenheit[3]; void setup() { //setup the LCD EsploraTFT.begin(); EsploraTFT.background(0,0,0); EsploraTFT.stroke(255,255,255); EsploraTFT.setTextSize(2); EsploraTFT.text(“Celsius”,0,0); EsploraTFT.text(“Fahrenheit”,0,60); } void …
-
In this example we will show a basic stepper motor example, we use a driver board that can be bought on many sites which basically comprises of a ULN2003 IC and a few other components, you can use either 5v …