Automatic Climate Control system- Arduino
By Shaun Wallace & Jed Hennessy
Design Brief:
This project allows students to explore their interest by creating a sub-system that will eventually
integrate into a larger System as the Group Project. Students will need to demonstrate the independent
functionality as well as how the sub-systems integrate into a functional System. Student will be required
to conduct a presentation of their project where they will demonstrate their project and answer the
assessor’s questions.
Students are to develop an Arduino based system that interacts with the real world. This system can either
run independently or be connected to a PC.
Group Design Brief:
Group Design Brief:
We are a small industrial design/engineering firm which has been requested to create an
‘Automatic Climate Control’ system which will suit the customers new proposed housing
development. Using the technologies and resources available to us as an upcoming small
design firm we have decided to use the ‘Arduino’ coding system to code and create the
requested proposal.
The developmental project will require us as a company to create a temperature and humidity system which will act as the main driving system. This main system will then be paired with two subsequent subsystems that will control both the heating and cooling elements. This will then create a whole unit which is able to read a rooms ambient temperature and either heat or cool that particular room to the designated temperature required.
The success of this system will be showcased inside a 3D model of a simplistic small apartment building. The apartment will consist a temperature sensor which will engage either a fan or a RED LED (heating substitute) depending on the ambient temperature being read inside the room. The ’Automatic Climate Control’ system will be a combination of multiple subsystems, wired and connected together to achieve the desired outcome. This system could then be multiplied however many times required to achieve the desired outcome for the housing development
The developmental project will require us as a company to create a temperature and humidity system which will act as the main driving system. This main system will then be paired with two subsequent subsystems that will control both the heating and cooling elements. This will then create a whole unit which is able to read a rooms ambient temperature and either heat or cool that particular room to the designated temperature required.
The success of this system will be showcased inside a 3D model of a simplistic small apartment building. The apartment will consist a temperature sensor which will engage either a fan or a RED LED (heating substitute) depending on the ambient temperature being read inside the room. The ’Automatic Climate Control’ system will be a combination of multiple subsystems, wired and connected together to achieve the desired outcome. This system could then be multiplied however many times required to achieve the desired outcome for the housing development
Parts required:
- Arduino Uno R3 Microcontroller x1
- Relay Module x2
- Small DC motor x1
- DS18b20 Temperature sensor x1
- LED light (Red) x1
- Male to Male leads x12
- Male to Female leads x6
- 10k Resistor x1
- Breadboards x2
- USB 2.0 Cable
Tools Required
- 3D Printer
- Soldering Iron (Optional)
3D printing:
Our original concept for this project was to make a model of a small two-room home. We were intending to have individual climate control for each room but decided to scale this back later in the project. We used Autodesk Fusion360 CAD software to design the small house. Once we designed a house that would suit our application, the CAD file was exported as a STL file and transferred to a 3D printer. The 3D printer used was a Makerbot Replicator 2. The print time was roughly 12hours so that had to be factored into our time management for the overall project. The final house had some warping on the base due to the Makerbot not having a heated print bed. In addition to the house itself, we decided that we would also design and 3D print a fan blade and fan housing to integrate into the house.
Code
#include <OneWire.h>
#include <DallasTemperature.h>
#define ONE_WIRE_BUS 2
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
int Relay1_pin = 3;
int Relay2_pin = 4;
float Celcius=0;
float Fahrenheit=0;
void setup(void){
Serial.begin(9600);
pinMode(Relay1_pin, OUTPUT);
digitalWrite(Relay1_pin, HIGH);
pinMode(Relay2_pin, OUTPUT);
digitalWrite(Relay2_pin, HIGH);
sensors.begin();
}
void loop(void)
{
sensors.requestTemperatures();
Celcius=sensors.getTempCByIndex(0);
Fahrenheit=sensors.toFahrenheit(Celcius);
Serial.print(" C ");
Serial.print(Celcius);
Serial.print(" F ");
Serial.println(Fahrenheit);
if (Celcius <24)
digitalWrite(3,HIGH);
else
digitalWrite(3,LOW);
if (Celcius >22)
digitalWrite(4,HIGH);
else
digitalWrite(4,LOW);
delay(700);
}
Circuit Diagram
Step By Step Guide
Step 1:
Once all components are available, the first step is to connect the temperature sensor (DS18b20) to the Arduino. The sensor should be placed into the breadboard at the very top of the vertical runs, allowing plenty of room for the male to male pins to be plugged into the breadboard bellow it.
The cable intended for data needs to be inserted below the right pin (marked with 'S'), Power is plugged in below the middle pin and the ground cable is plugged in below the left most pin. Power and ground cables are then plugged into the horizontal runs at the bottom of the breadboard. The data cable is plugged into the corresponding analog plug on the Arduino (This needs to be stipulated within the code uploaded later). Finally, a 10k resistor is added in between the sensor and the cables. The resistor is inserted into the breadboard across the data and power cables.
Step 2:
Once the temperature sensor is connected to the Arduino, the next step is to connect the Arduino to the relays. On the input side of the relay, the VCC pin needs to run to power on the breadboard. The ln1 pin on each relay needs to run to their corresponding analog pin on the Arduino (each relay will need to run to a separate pin that will be stipulated in the code). Finally, the Gnd pin needs to run to ground on the breadboard.
Anaolg pin 3 is run to the relay controlling the DC motor in this example. On the relay output side, the central pin is power and runs back to power on the breadboard. The right output pin, runs to the positive on the DC motor. A ground is required to be run from negative on the DC motor, to ground on the breadboard.
All steps are repeated for the second relay (LED). The data pin running from relay input is run to analog pin 4 in this example. The relay output pins run to the positive and negative legs of the LED in the same manor as the DC motor. (Central pin running to power on breadboard, right output pin running to positive leg and ground from breadboard running to negative leg).
Anaolg pin 3 is run to the relay controlling the DC motor in this example. On the relay output side, the central pin is power and runs back to power on the breadboard. The right output pin, runs to the positive on the DC motor. A ground is required to be run from negative on the DC motor, to ground on the breadboard.
All steps are repeated for the second relay (LED). The data pin running from relay input is run to analog pin 4 in this example. The relay output pins run to the positive and negative legs of the LED in the same manor as the DC motor. (Central pin running to power on breadboard, right output pin running to positive leg and ground from breadboard running to negative leg).
Step 3:
With all components wired up, the next step is to upload the code to the Arduino. Software is required to upload the code to the Arduino (Arduino IDE) and is downloadable from www.arduino.cc/en/Main/Software. With the software installed and open, click the 'Tools' tab at the top of the screen and ensure that the board selected is "Arduino/Genuino Uno". Also in the 'Tools' drop down menu, check that the correct port is being used for the USB connecting the PC to the Arduino e.g "COM3".
Next, ensure that the required library files are installed otherwise the code will not compile and upload to the Arduino correctly. Go to the 'Sketch' tab at the top and then select Include Library>Manage Libraries... In the search bar, look for DS18b20 and install all corresponding libraries.
Copy the code above and paste into the code window in IDE. Once pasted, compile and upload to Arduino.
With all components wired up, the next step is to upload the code to the Arduino. Software is required to upload the code to the Arduino (Arduino IDE) and is downloadable from www.arduino.cc/en/Main/Software. With the software installed and open, click the 'Tools' tab at the top of the screen and ensure that the board selected is "Arduino/Genuino Uno". Also in the 'Tools' drop down menu, check that the correct port is being used for the USB connecting the PC to the Arduino e.g "COM3".
Next, ensure that the required library files are installed otherwise the code will not compile and upload to the Arduino correctly. Go to the 'Sketch' tab at the top and then select Include Library>Manage Libraries... In the search bar, look for DS18b20 and install all corresponding libraries.
Copy the code above and paste into the code window in IDE. Once pasted, compile and upload to Arduino.
Code In Arduino IDE Software:
Data being received and displayed in Serial Monitor:
Final, Functional System:
Troubleshooting:
If having problems uploading code to the Arduino, check that all required libraries are installed.
If experiencing issues with hardware components, individual components may be checked by connecting them directly to 5v power (DC Motor, LED, Relay etc). It may be wise to check all wiring and ensure that all cables are plugged in correctly and making contact. When troubleshooting, it is advised to check components one by one to ensure that you are not making mistakes and creating other issues.
Future Development:
Arduino allows for our system to be modular and offers flexibility to add or remove sub-systems for future development as requirements are needed to be met. Future development for the systems that we have developed could include but are not limited to:
If having problems uploading code to the Arduino, check that all required libraries are installed.
If experiencing issues with hardware components, individual components may be checked by connecting them directly to 5v power (DC Motor, LED, Relay etc). It may be wise to check all wiring and ensure that all cables are plugged in correctly and making contact. When troubleshooting, it is advised to check components one by one to ensure that you are not making mistakes and creating other issues.
Future Development:
Arduino allows for our system to be modular and offers flexibility to add or remove sub-systems for future development as requirements are needed to be met. Future development for the systems that we have developed could include but are not limited to:
- Re-implementation of a 12x6 LCD screen to display real-time temperature data in both Celsius and Fahrenheit.
- Use of a DHT11 or similar sensor to allow reading of humidity data. As well as the temperature data.
- Integration of a DHT11 and 12x6 LCD to display Temperature and humidity information in real-time.
- Expanded scope for implementation of more sensors for larger applications (individual sensors for individual climate control in individual rooms).
- Personalised temperature parameters for individual climate control applications.
Challenges and Reflection:
As mentioned above, we originally planned on creating an individual two- room heating and cooling system. Due to issues we encountered, we decided to scale the project back to one room. Early in the project, we were having issues running a rudimentery sub-system that would read temperature and humidity and display it on an LCD screen. After some troubleshooting, we were able to get this subsystem functioning correctly, but this was shortlived. Information stopped displaying on the LCD for no understandable reason and we were unable to remedy it.
After trying to fix the issues we were having with the DHT11 and 12x6 LCD, we decided to change over to the DS18b20 temperature sensor and jettison the 12x6 LCD altogether. This proved to be the right decision as the project progressed quickly and easily after making these changes. We made the decision to monitor the information that the DS18b20 was reading via the Serial Monitor as opposed to running the 12x6 LCD display.
We found some base code that helped with our system but were required to re-write large portions of it and add to it to suit our desired application.
Running DHT11 and 12x6 LCD screen both originally built into system and functioning correctly but some issues encountered. Continued to attempt to implement 12x6 into system after making decision to switch from DHT11 to DS18b20 temperature sensor. More issues encountered with use of LCD, test system without LCD running serial monitor instead, results improved. Base code found online, didn't work, re-written to suit application. Relay sub-system integrated, Relay code integration and trouble shooting, success. Final build of presentable prototype. Project completion.
No comments:
Post a Comment