1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.
-
Upload
tabitha-griffith -
Category
Documents
-
view
219 -
download
0
Transcript of 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.
![Page 1: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/1.jpg)
1 of 20
Core Arduino Workshop
Chris Koehler and Brian SandersColorado Space Grant Consortium
![Page 2: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/2.jpg)
2 of 20
Part 3 – Arduino Road Trip
A. Temperature Sensor
2
![Page 3: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/3.jpg)
vArduino Uno
Temperature Sensor:
PC/MacMonitor LEDs
Pot/Other
Infrared
Temp
3
![Page 4: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/4.jpg)
4
- The potentiometer is an analog sensor
- Almost all analog sensors work and are connected in the same way
- Let’s use hook up one more
- To do so will require another breadboard, with nicer features
Temperature Sensor:
![Page 5: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/5.jpg)
5
Temperature sensor is theTMP36 - Temperature Sensor
Temperature Sensor:
![Page 6: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/6.jpg)
6
- This breadboard has power and ground rails- Individual points on rails (rows) are connected- One rail, and its points, are independent of other rails
Temperature Sensor:
![Page 7: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/7.jpg)
7
- Also has numbers and letters to coordinate builds
Temperature Sensor:
![Page 8: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/8.jpg)
8
- Place in new breadboard exactly as shown
Temperature Sensor:
![Page 9: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/9.jpg)
9
- 5V (pin 1) = E3- Data (pin 2) = E2- GND (pin 3) = E1
Note orientation of sensor package
Temperature Sensor:
5 V
Data GND
![Page 10: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/10.jpg)
10
- Connect 5V from Arduino to “+” power rail
- Connect GND from Arduino to “-” rail
Temperature Sensor:
![Page 11: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/11.jpg)
11
- Connect 5V from Arduino to “+” power rail
- Connect GND from Arduino to “-” rail
Temperature Sensor:
![Page 12: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/12.jpg)
12
- Now all pins on “+” rail are connected to 5 Volts
- All “-” are connected to GND
Temperature Sensor:
![Page 13: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/13.jpg)
13
- Connect 5V and GND from rails to sensor
5V to A3
GND to A1
Temperature Sensor:
![Page 14: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/14.jpg)
14
- Connect A0 from Arduino to A2 on Bread-board
Temperature Sensor:
![Page 15: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/15.jpg)
15
- What do we need to change in the Sketch?
Temperature Sensor:
![Page 16: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/16.jpg)
16
- Nothing! But the Temp Sensor Voltage commands all LEDs off
- Build and Upload the code and look at serial monitor
- Should see ~0.73 Volts, which is well below our first LED turn on value of 1.25 Volts in the current IR sensor Sketch
Temperature Sensor:
![Page 17: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/17.jpg)
17
- To understand and set the proper range, let’s consult the data sheet for the sensor
- 10 mV/C (0.010V/C)
Temperature Sensor:
![Page 18: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/18.jpg)
18
- Data sheet also says there is an offset
- For TMP36,Offset = 0.5 Volts
Temperature Sensor:
![Page 19: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/19.jpg)
19
- So to understand the data, we need to do some math to convert voltage to C and set our ranges
Using what we are seeing from our serial monitor, 0.73 Volts, we would get…
Temperature Sensor:
![Page 20: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/20.jpg)
20
- Change the Sketch to do the math and change LED turn on ranges to temperatures of 21, 22, 23, and 24 C.
- Will need a new variable (float)
Temperature Sensor:
![Page 21: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/21.jpg)
21
- New variable, tempC (float)
- Add your math
- Modify your print statements
Temperature Sensor:
![Page 22: 1 of 20 Core Arduino Workshop Chris Koehler and Brian Sanders Colorado Space Grant Consortium.](https://reader036.fdocuments.net/reader036/viewer/2022062518/56649ebc5503460f94bc5cc0/html5/thumbnails/22.jpg)
22
- Adjust your range settings for the LEDs
- Build and Upload
- Test by touching your temp sensor
- Challenge while you wait… Convert to Fahrenheit
Temperature Sensor:
PLEASE SAVE YOUR
SKETCH FILE