Tag Archives: tutorial

Building a Yún-powered weather station

The Arduino Yún – designed in collaboration with Dog Hunter – is based on Atmel’s popular ATMega32u4 microcontroller (MCU) and also features the Atheros AR9331, an SoC running Linino, a customized version of OpenWRT. The Yún is somewhat unique in the Arduino lineup, as it boasts a lightweight Linux distribution to complement the traditional microcontroller (MCU) interface.

The Atmel-powered Yún – which hit the streets late last year – has been used in a wide variety of Maker projects that we’ve recently covered on Bits & Pieces, including an electricity monitor, mesh extender platform, Foursquare soap bubble machine, a Gmail (alert) lamp, water heater regulator and Evil Alarm System.

Today, we’re going to be taking a look at how Marc-Olivier Schwartz built a cloud-connected weather station with the Yún. Aside from the Atmel-based board, key hardware specs include:

  • DHT11 (or DHT22) sensor and 4.7K resistor (for humidity)
BMP085 sensor on a simple breakout board/Adafruit BMP180 sensor board (for pressure and temperature)
  • Photocell with a 10K Ohm resistor (light level)
  • Breadboard + assorted male-male jumper wires

On the software side, Schwartz used the Arduino IDE, Temboo, DHT library, the BMP085/BMP180 library, unified sensor library and a Google Docs account for the collected data to be analyzed and stored.

“The hardware connections for this project are actually quite simple: we have to connect the DHT11 sensor and then the part responsible for the light level measurement with the photocell. First, connect the Arduino Yun +5V pin to the red rail on the breadboard and the ground pin to the blue rail,” Schwartz explained in a detailed Adafruit tutorial.

“Then, connect pin number 1 of the DHT11 sensor to the red rail on the breadboard and pin number 4 the blue rail. Also connect pin number 2 to pin number 8 of the Arduino Yún. To finish up with the DHT11 sensor, connect the 4.7k Ohm between pin number 1 and 2 of the sensor.”

Next up is the photocell.

“First place the cell in series with the 10k Ohm resistor on the breadboard. Then, connect the other end of the photocell to the red rail on the breadboard and the other end of the resistor to the ground. Finally, connect the common pin to the Arduino Yún’s analog pin A0,” Schwartz continued.

“For the BMP085 or BMP180 sensor, connect the VIN pin to the +5V, GND to Ground, SCL to Arduino Yún pin number 3 and SDA pin to Arduino Yún pin number 2.”

According to Schwartz, multiple Yún boards can be used in various parts of a single residence.

“You can also customize the email alert part: you can build more complex alerts based on the measured data, or set the project to email you the sensor data at a regular time interval,” he added.

Interested in learning more? You can check out Schwartz’s full Adafruit tutorial here.

Adafruit monitors temp and humidity with Atmel MCU

Adafruit’s Mike Barela has designed a temperature and humidity monitor built around the Atmel-powered (ATtiny85) Trinket. As Barela notes, monitoring sensors are a very common feature in current-gen Internet of Things (IoT) projects.

“While the Trinket does not have a serial monitor built in, it [does] talk over various protocols including software serial, I2C (two wire) and SPI,” Barela explained. “This project can be placed in a very small enclosure and used anywhere environmental monitoring is needed. [Plus], the code and concepts may be used in a number of your own projects.”

Aside from the Atmel-powered Trinket, key components include:

  • RGB backlight negative/positive LCD 16×2 + extras
  • Standard LCD 16×2 + extras
  • i2c / SPI character LCD backpack
  • DHT22 temperature-humidity sensor + extras/DHT11 basic temperature-humidity sensor
  • Breadboarding wire bundle
  • Half-size breadboard

In terms of software libraries, Barela’s project uses TinyWireM (a Trinket-compatible alternative to the Arduino Wire), TinyLiquidCrystal and TinyDHT. Meanwhile, Adafruit’s I2C / SPI character LCD backpack allows Makers to easily control the display by sending data over the two wire I2C interface.

“Standard LCDs require a large number of digital pins, [so] use of the I2C backpack reduces the pins needed considerably,” said Barela. “This project features a 16×2 display, displaying temperature and humidity without using a great deal of memory, which is important on a small microcontroller like the Trinket.”

According to Barela, the I2C backpack may be assembled and placed on the back of the display.

“The color displays have a couple of extra connectors – pins 16, 17, and 18 control the three color backlights. If you connect pin 16, the I2C will control the red light,” he continued. “You can choose to put a jumper from one of the backlight pins to backpack pin 16 to choose a different color or connect the pins high to keep them on all the time. Making the pin choice before soldering on the backpack allows you the most flexibility in choosing your backlight color, or you can just go with a ‘classic’ blue & white 16×2 LCD.”

Interested in learning more about Adafruit’s temperature and humidity monitor built around the Atmel-powered Trinket? You can check out Mike Barela’s detailed tutorial here.