Have you ever had trouble failing asleep because it was too hot, or having trouble waking up in the morning because it was cold and your fan from last night was still on?
Well, if your answer is yes to any of those, then I think we have a solution for you.
A fan that can turn itself on and off depend on the room temperature and also a heater pad that will turn on when the temperature is too low. All of those combine will create a better sleeping experiment.
In this project, we use the reading from a BME 280 Temperature sensor to control the two outlets that attached and control by 2 Particle Photons. All of the temperature data is collected and published in graph form through ThingSpeak website. The communication between particles are done by IFTTT Applets.
How does it work?Bellow is a simple flow chart shows basic logic and idea behind the project.
Thingspeak.com is a IoT service website that can collect and analyze the data publish from a Particle Photon.
In this project, I have used Thingspeak to receive data from my BME 280 sensor and create a real time graph of the room condition. The link above with direct you to my public Thingspeak channel of my current room condition.
The IFTTT website is a very neat and useful site that help you create a trigger condition to control many things. However, there is a delay time between send and receiving signal. I decide to use IFTTT because the thing we deal with here is temperature. Certainly, a immediate feedback is not really needed. Below is my IFTTT Applets setup for this project:
Below is the video shows the system in action. For the sake of time, we have to change the activation temperature to 75 degrees and 80 degrees Fahrenheit.
ReplicateNow that you have seen what it can do, this section will cover, in as much detail, how to replicate or even improve this project!
1. Basic setup for the Particle Photon (Estimated time 30' to 1 hour)
If you haven't already set up your Particle, the Particle website has a great starter guide for connecting the photons and more information about how to use it.
https://docs.particle.io/guide/getting-started/intro/photon/
2. The Code (about 1 hour and 30')
There are two different codes we used for this project. One for the BME 280 and the code to control the relays. There is also a great example project that shows how to connect the BME 280 and export the data to Thingspeak from John R McAlpine V Mac.
We have modified the code for the purpose of this project and you can find the modified code down below (feel free to use and change it as needed).
3. Electrical circuit (about 45 minutes)
Assume that you have all of the components ready, this shouldn't take longer than 45 minutes. The diagrams for both circuits can be found down below in the Diagrams section.
4. Test it! (about 30 fun minutes)
Comments