Introduction: Arduino Attic Environmental Monitor
I have been considering adding additional insulation to the attic and needed a way to track the temperatures. Since I have been teaching myself basic electronics and Arduino programming, this seemed like a good opportunity to test my skills with a practical project. I wanted a remote temperature and humidity logger that would run unattended in the attic for several days at a time on battery power.
I did this as a learning project, using (mainly) parts on-hand; it works great, but don't expect a beautiful finished product, I went for functional not beautiful....I'll try my hand at 3D printing down the road.
Step 1: Parts
Here are the parts I used for this project:
- Arduino Uno
- 9V battery connector
- 9V battery
- DHT22 digital temperature & humidity sensor
- SD card breakout board
- Unused SD card
- Breadboard
- Breadboard jumper wires
Step 2: Connecting It All
This part of the instructions may vary depending on which exact parts/models you use, but here was my configuration:
I connected the Arduino 5V and Ground pins to the breadboard + and - strips, respectively.
I plugged in the DHT22 into the breadboard, connecting the VCC pin to the breadboard + and the GRD pin to the breadboard - pins; and connecting the DTA pin to the Arduino D2 socket.
I connected the SD card reader to the Arduino as follows (per the spec sheet):
- CS to Arduino D10
- DI to Arduino D11
- DO to Arduino D12
- CLK oto Arduino D13
- G to breadboard -
- + to breadboard +
Step 3: Arduino Sketch
I then wrote a basic Arduino sketch to check the temperature and humidity and record the results.
The logic was as follows:
- If the temperature changes by more than 1 degree since it was last logged, log the new values
- If the humidity changes by more than 1% since it was last logged, log the new values
- Record the current values every 5 minutes; this is configurable through the MIN_LOG_PERIOD value
The log filename is created dynamically with sequential numbers, so it will not overwrite previous results if you restart the Arduino.
I wrote a function logIt(...) to handle the actual logging of the data to the SD card (and the Serial Monitor depending on the USE_SERIAL_MONITOR value); this makes it easy to modify to add/remove parameters if I want to add additional sensors.
Attachments
Step 4: Run It & Record Values
I set the unit in a small, open cardboard box and placed in the attic and let it run for over 24 hours. Sample output can be seen in the attached image.
Since I saved the file as a CSV, I was able to quickly open in Microsoft Excel and generate a chart.
Step 5: Future Enhancements
While logging the values with a sequential "event ID" is helpful, and actual date & time would be better; I have ordered an inexpensive real time clock (RTC) and will be incorporating that into the next version.
5 Comments
Question 3 years ago on Introduction
we are building a new home, and I think I would like to build a combination attic & whole house fan. I will need temp & humidity sensors, plus indoor and outdoor sensors, as inputs for this system. I've seen the DHT11 and 22 as popular sensors, but I wonder about it being in this environment (dusty, humid, very cold, very hot) long-term. I think I would like to just have a more rugged sensor in the attic, with the electronics down in the house. I will have a standard fan and a damper (to switch between attic air and the ductwork down to the home interior) to control. What would you recommend for this setup?
I am in the commercial fire alarm and security industry, so I have some very ambitious plans there, but HVAC is a bit out of my expertise.
9 years ago on Introduction
This is as good a reason to use an Arduino as any, I like that you put it to a home-automation sort of use....nice 'ible!
9 years ago on Introduction
Nice work! Also could be interesting to have: send data via bluetooth to a remote monitoring station (e.g., PC).
9 years ago on Introduction
great idea. good luck
9 years ago
Nice work. Good luck with your improvements