Back to Parent

Outcome


Goal:

The goal of this project was to create a prototype that would simulate the behavior of the type of circuit that when embedded in a car windshield or roof could alert the user that ice or snow had accumulated. 

Process Documentation:

The first thing I did for this project was look at the code that would be needed to create this type of circuit. I used the code found provided by daraghbyrne on his GitHub for our class as the building blocks for this project. I started by copying the code that would be needed for to get data from the force sensor and the temperature sensor  (in 4. Basics of Sensors there is code for each of the sensors listed in the BOM below). I updated the code so that the temperature sensor would be communicating with A1 and the force would be communicating with A0. Then from the force sensor code, I also pulled the code necessary to output to an LED that is connected to D0 and for that LED's brightness to vary with the output from the force sensor. I then added my own if statement to the void loop that imitated conditions as if there were snow or ice on the car and only when those conditions were true, would the LED light up. I set the temperature threshold to be freezing and the force threshold to be light pressure. The correct force reading would really need to be calibrated based on real world application, but this was sufficient for demonstration. Below is the if statement that I added to the code:

Show Advanced Options

Note that the complete code can be found at the bottom of this documentation

Then I got the following components together in order to build the circuit:

Bom
Show Advanced Options

With these components in hand I built the circuit seen in the diagram below:

Snow sensor bread board
Show Advanced Options

With this complete, I began to test my code by setting the temperature threshold to be above room temperature, so that by pressing on the force sensor it was clear that the code was working. The LED was turning under the proper conditions but I realized that it was failing to turn off in the pressure sensor dropped below the minimum. I realized that this meant an else clause was needed for my if statement, so that if the snow or ice melted then the light would turn off. I added the code below: 

Show Advanced Options

Below are some photos of the breadboard with the LED at different levels of brightness, screenshots of the cloud variable outputs and the code.

Documentation1
Show Advanced Options
Documentation2.thumb
Show Advanced Options
Show Advanced Options
Drop files here or click to select

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