Week 13 - More Sensors and DC Motor
Tuesday
Agenda
Artist of the Day
![image](https://user-images.githubusercontent.com/1598545/201956027-a0033407-8a2d-4167-91bc-a0a6dd38d518.png)
Amy Youngs
Temperature sensor
![image](https://user-images.githubusercontent.com/1598545/141343262-3c12cb66-e550-4696-81d9-30cc9c1ac033.png)
(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
![image](https://user-images.githubusercontent.com/1598545/201957013-f666732a-57be-410c-85c1-76aa5d606797.png)
See this file from the ELEGOO examples: l10 ultrasonic sensor.pdf
And this code: Lesson 10 Ultrasonic Sensor Module.zip
Bonus Artist: Garnet Hertz
DC Motor
![image](https://user-images.githubusercontent.com/1598545/201957155-f1e5e081-5967-4d14-8664-c4820943d348.png)
See this file from the ELEGOO examples: l21 dc motor.pdf
And this code: Lesson 21 DC Motors.zip
Homework
Starting thinking about a final project.
Office Hours
Wednesday 4-6pm.
Thursday
Agenda
Artist of the Day 2
![image](https://user-images.githubusercontent.com/1598545/202450393-95dcd465-afec-471d-b35c-89b1e6bf95fa.png)
Garnet Hertz
Relay
![image](https://user-images.githubusercontent.com/1598545/202452995-d084949b-fb19-455f-ac36-3a27b9632fcc.png)
See this file from the ELEGOO examples: l22 relay.pdf
And this code: Lesson 22 Relay.zip
Stepper Motor
![image](https://user-images.githubusercontent.com/1598545/202453114-ee4b9e7f-306f-411b-b49b-834e013e4514.png)
See this file from the ELEGOO examples: l23 stepper.pdf
And this code: Lesson 23 Stepper Motor.zip
Homework 2
Write a proposal for the final project. Due Tuesday morning 11/22 for one-on-one meetings. https://canvas.unl.edu/courses/137404/assignments/1370188
Reference
- Detailed HC-SR04 tutorial with LEDs and Arduino https://www.instructables.com/Simple-Arduino-and-HC-SR04-Example/