This is a simple Arduino sketch to take a room's temperature every minute and log it to SnowPlow snowplow using the [SnowPlow Arduino Tracker] snowplow-arduino-tracker.
To run this sketch, you will need the following hardware:
- An Arduino (I used an [Arduino Uno] arduino-uno)
- An Ethernet or WiFi shield for Arduino (I used an [Ethernet shield] ethernet-shield)
- An TMP36 tmp36 temperature sensor (mine came in the [Oomlout Starter Kit] oomlout-starter-kit)
In software terms, you will need:
- The sketch in this repository, [
tempTracker.ino
] sketch - The [SnowPlow Arduino Tracker] snowplow-arduino-tracker library
- A [SnowPlow event collector] snowplow-collectors (to receive events sent by the Arduino Tracker)
First, attach your Arduino Ethernet or WiFi shield onto your Arduino. Then wire your TMP36 into your Arduino Ethernet or WiFi shield like so:
Some notes on this setup:
- It's very important that you wire the TMP36 in the right way around, or else the TMP36 will malfunction and get very hot
- We use 3.3V (connecting ARef to the same) for a more precise temperature reading than 5V will give us
- This schematic was produced using Fritzing fritzing - the source file is
docs/arduino-schematic.fzz
Finally, connect your Arduino board to your computer via USB, and connect your Ethernet or WiFi shield to your network.
Once you have done this, your hardware configuration should look something like this:
You will need the [SnowPlow Arduino Tracker] snowplow-arduino-tracker library installed in the Arduino "libraries" folder on the computer connected to your Arduino.
To install this library, please check out the guide here: [Arduino Tracker Setup] tracker-setup-guide on the SnowPlow wiki.
If you are not already running SnowPlow, you can setup the CloudFront-based event collector, which is SnowPlow's simplest collector. Checkout the guide here: [Setting up the Cloudfront Collector] cf-collector-setup on the SnowPlow wiki.
Download the [tempTracker.ino
] sketch sketch in this GitHub repository to your computer.
Open it in your Arduino environment - when prompted, agree to create a folder called "tempTracker".
Now scroll down a little and edit these variables:
Specifically:
- Update
kMac
to the MAC address printed on your Arduino Ethernet or Wi-Fi shield - Update
kSnowplowCfSubdomain
to the CloudFront subdomain which your SnowPlow collector is hosted on - Update
kSnowplowUserId
to describe which room you will be monitoring for temperature - For testing purposes, you can change
kReadingFreq
to 5 to be able to check your temperature readings faster. Don't forget to change it back to 60 (or even 300 or higher) later
Done? Now you're ready to test!
Hit File > Upload to load the sketch onto your Arduino.
Now click Tools > Serial Monitor and after a few seconds you should start seeing the following:
Great - the sketch is working and sending temperature information to SnowPlow!
Nothing planned. Hopefully this project inspires you to try monitoring your own home/office/factory/shop using Arduino and SnowPlow!
Arduino Temperature Tracker is copyright 2013 Alexander Dean.
Licensed under the [Apache License, Version 2.0] license (the "License"); you may not use this software except in compliance with the License.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.