Back to Parent

Outcome


Intention

In this project, we would like to build the connection between information, or data, and actuation. We will use the actuators we studied in this course to create an ambient alert or alarm.

Approach and Process

There are tons of data sources. In this project, we can respond to a stock price change, an hourly outside temperature, or email notifications. Also, there are enormous ways to achieve data. In the previous lab, we learned how to use IFTTT to achieve data from Google Calendar. By exploring IFTTT, we can find many accessible data sources to trigger our Particle functions by using IFTTT API.

However, I decided to generate the data myself. I choose the fan as my actuator, so I started my design with a temperature sensor - I tried to read the temperature in my room and trigger the fan by a set point. However, the temperature sensor TMP36 I have is not stable, so I decide to use the ultrasound sensor for another temperature-related situation - to see if there is anything blocking the vent of my Macbook so that it gets overheated.

The diagram is as follows:

The ultrasound sensor HC-SR04 will be placed next to the vent of the Macbook, and so is the brushless DC fan. They will need an external 5V power source. When the HC-SR04 gets small readings, that means there are some objects in front of it and therefore the vent is blocked. Then the DC fan will be triggered and start to run to vent the heat and alert the user to move stuff away.

Please note that the diagram of DC fan is different from the tutorial - I tested the sample diagram of the solenoid on the course website, but it does not work for DC fan. So I searched the internet and found this post (https://www.instructables.com/Arduino-Fan-Controller/). Then I connect the transistor as follows:

Fan Ground - Collector

Digital Control pin - Base

Common Ground - Emitter

The circuit worked after this

Untitled sketch 6 bb.thumb
Show Advanced Options

Code

The code is shown as follows. I modified the loop to fit in the ultrasound sensor. Also, I simplified the doSolenoid function - the fan will just be turned on for 5 seconds instead of doing a loop for 0.5 second on/off five times.

Show Advanced Options

Reflection

The demonstration video is shown below. Through this project, I learned how to use diode and transistor to safely control an actuator and know different types of actuators.

Show Advanced Options
Drop files here or click to select

You can upload files of up to 20MB using this form.