For our school project, we were tasked with integrating an arduino into an automated system. We chose to make an indoor climate sensor, which can sense temperature, humidity and the decibel level indoors.
We drilled a couple of holes in the cabinet, and with glue and tape, secured the components from the backside. The LCD screen was glued on, on the front, as was the LED strip. We placed the cabinet on a piece of wood, for stabilization, and mounted another piece of woods lengthwise on the back, for further stabilization and a platform for the Arduino, breadboard and the external powersource.
We have placed QR codes on the cabinet, for instant access to this site, using a mobile phone and a QR scanner.
Step 1: Things You Need to Make This Project
1: The shell of the climate sensor, was made by an old computer cabinet
2: For humidity and temperature: 1 humidity/temperature sensor and 2 RGB LED pins
3: For VU meter: 1 microphone and 1 WS2812B 8-chip LED STRIP
4: 1 LCD screen and 1 potentiometer for screen resolution
5: 1 Arduino Mega 2560, 1 breadboard, 12V external power source, wires and resistores
Step 2: Fritzing
We used the program Fritzing to illustrate how the components are wired. A great program for wiring schematic use. Here you can see in which pins you must wire the components,
Step 3: The Code
The code was written in the free Arduino program, and for all intents and purposes, we have no moving parts, so its being driven by the arduino and the program.
The first part is where we define which pins are used and which Libraries we use
//RBG Setting the pins for the RBG-leds that are used to visualise Temperature and Humidity
int redPintemp = 47;
int greenPintemp = 45;
int bluePintemp = 46;
int redPinHumi = 53;
int greenPinHumi = 51;
int bluePinHumi = 21;
//Sensor For reading Temperature and Humidity.
#include - < dht.h >
#define DHT11_PIN A0
// LCD The display where Temperature and Humidity can med seen
#include < LiquidCrystal.h >
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2; LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
//LED strip To visualise sound level
#include < Adafruit_NeoPixel.h >
#include < math.h >
#define N_PIXELS 8 // Number of pixels in strand
#define MIC_PIN A9 // Microphone is attached to this analog pin
#define LED_PIN 6 // NeoPixel LED strand is connected to this pin
#define SAMPLE_WINDOW 10 // Sample window for average level
#define PEAK_HANG 24 //Time of pause before peak dot falls
#define PEAK_FALL 4 //Rate of falling peak dot
#define INPUT_FLOOR 10 //Lower range of analogRead input
#define INPUT_CEILING 300 //Max range of analogRead input, the lower the value the more sensitive (1023 = max)
byte peak = 16; // Peak level of column; used for falling dots unsigned int sample;
byte dotCount = 0; //Frame counter for peak dot
byte dotHangCount = 0; //Frame counter for holding peak dot
Adafruit_NeoPixel strip = Adafruit_NeoPixel(N_PIXELS, LED_PIN, NEO_GRB + NEO_KHZ800);
The complete code is available as download both as .ino for arduino and as .docx file
Step 4: Video and Pics
Step 5: Build Away!
Reflecting on the project and our teamwork, we work well together at the school and socially. The project has the parts in it that we planned for, and with room for further improvements. The code works, but is not perfect. We can´t quite understand where to implement a snippet of a code, so that our LED strip/VU meter can work perfectly, without getting interference from the delay from the LCD screen, as it has to be delayed for 2 seconds to properly read the informations its getting from the temp/humidity sensor. This causes the LED strip to not function perfectly, as it needs no delay, but we dont know where to implement the solution in the code. That is our big regret for now, but we are open for suggestions, and we will try ourselves to further improve on the coding. If we had more time, as this project was timebased, and a better understanding of the coding part, we could, and now will, improve upon the coding.
Now that you have finished all the steps coming to this one, you are ready to explore more features and awesome stuff for the indoor-climate-device. One way to improve this device could be to make a function that would trigger a fan if the temperature or humidity went below or over a certain threshold. So if it was too cold it could increase the heat in the room in someway and if it was too warm lower it. Also if the humidity was too high it could open the windows to lower it or atleast suggest it. The microphone could be upgraded into a bluetooth-module on your smartphone or other device. This way you could keep track of the level of decibel currently in the room. And also this could be upgraded into a function where the volume would be either increased or lowered if too high.
Now build away and get inspired by our thoughts or make your own ideas come to life.
Thank you for visiting our page and thank you if you tried to build it!