Back to Parent

Outcome


Outcome

I learned and practiced how to use inputs (button, switch, and potentiometer) and sensors (photoresistor and FSR). For the exercise of combining sensors and inputs, I made a connected sensor device that reminds me to pour the boiled water in the kettle to the thermos.  

Getting Inputs

Exercise 1

Combine a switch and potentiometer. The switch should turn on and off the light while the potentiometer will fade up and down the light (but only when it’s on).

I wired a button to the circuit created in the tutorial “using a potentiometer”. I started with reusing the code in that tutorial and defined a new pin that I would place a button on. I reorganized the code related to analog readings/values to the if (buttonState == LOW) condition. Following the 3 step-by-step tutorials is really helpful and it makes the practice exercise less daunting!

Show Advanced Options
Show Advanced Options

Using a Photoresistor

Exercise 1

Modify the program so that the LED shows the opposite. When there is little light, it will be bright and when there’s lots of light, it will be off.

I changed the PWM range from 255 to 0 in map( photoCellReading, 0, 4095, 255, 0 ). 

Show Advanced Options
Show Advanced Options

Exercise 2

Instead of fading your light, why not turn it on or off when the light reaches certain levels.

I set the threshold as 1000. If the light levels are below 1000, turn the LED on, otherwise turn it off.     

Show Advanced Options
Show Advanced Options

Practice Exercise: Combining Sensors and Inputs

User Scenario

I like hot drinks when I’m working at home. I have a thermos that helps keep boiled water warm for a longer time, which saves the waiting time whenever I want a cup of hot drink. However, I often forget to pour the boiled water into the thermos before it gets cold:( 

 I hope to design a connected sensor device that reminds me to pour the boiled water in the kettle to thermos.

Input

Force sensitive resistor(FSR): sense the weight of the electric kettle with water
Switch: turn the system on or off 

Output

LED: When the kettle is sensed with more than 0.5L water inside and the switch is on, turn LED on

Show Advanced Options
Show Advanced Options

Next Steps

It would be helpful to measure the pressure from the kettle with 0.5L water. Due to the size and shape of FSR, it was difficult for me to place the FSR under the center of the kettle base to measure the actual pressure. For this exercise, I set the threshold as 3000 for testing purpose.

I would like to use a temperature sensor to measure the water heat. For example, if the water temperature is more than 80 °C and the switch is on, turn the LED on.

Reflection

This week’s tutorials helped me become more familiar with using inputs and sensors. I also became more comfortable in wiring and coding. I found it challenging to create a circuit on the breadboard from scratch. For this exercise, I referred to Fritzing circuit diagram in tutorials as a starting point, then add a second component into the mix. This approach smoothed the wiring progress a lot.

If I were to do it again, I would use a temperature sensor that tells me about the water in the electric kettle is warm. Additionally, it would be great if the LED can be placed on my desk. Otherwise, this connected device would not help me a lot if the LED is set by the kettle on the kitchen counter.  

Drop files here or click to select

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