Week 13 - More Sensors and Serial Communication
Agenda
- Biomimicry Checkin
- Sensors and Serial Communication
- Discuss Final Project and Exhibition
Temperature sensor

(image from Adafruit)
- The TMP 36GZ is a temperature sensor.
- This is an active sensor, meaning we provide power to ground and 5V, and it outputs a voltage proportional to temperature.
- Looking at the datasheet, we see it is 10mV/degree Celsius. That means we can use the output voltage (read by analog in) to figure out what the temperature is.
- To convert from AnalogRead value to milli-volts: Voltage at pin in milliVolts = (reading from ADC) * (5000/1024)
- To convert from milliVolts to degree celsius: Centigrade temperature = [(analog voltage in mV) - 500] / 10
- Activity:
- Use AnalogReadSerial to figure out what the current temperature in the room is in Celsius.
- Modify your code to convert Celsius to fahrenheit.
- Explore the dynamic behavior: how quickly does it change in response to breathing on it? In response to touching it? Can you get the temperature to go up, or go down?
Ultrasonic Rangefinder

from https://create.arduino.cc/projecthub/abdularbi17/ultrasonic-sensor-hc-sr04-with-arduino-tutorial-327ff6
Homework
Office Hours
- Immediately after class.
- or, contact me online
Reference
- Detailed HC-SR04 tutorial with LEDs and Arduino https://www.instructables.com/Simple-Arduino-and-HC-SR04-Example/