Download presentation
Presentation is loading. Please wait.
Published byElla Freeman Modified over 9 years ago
1
1 - Now let’s modify our sketch to add an analog input - Let’s use the potentiometer from HW #4 Arduino Overview:
2
2 - Connect the Red wire to +5V, Black to GND, and White to A0 Arduino Overview:
3
3 - Leave the LED connected to pin 9 but it won’t blink Arduino Overview:
4
4 - Potentiometer is acting like an analog sensor - We can now hook up any analog sensor and see its value (at least through serial) - What other sensors can we hook up? - Let’s add some… - But first let’s add the Protoshield Arduino Overview:
5
5 - Take out the Protoshield your team built in HW#4 Arduino Overview:
6
6 - Carefully connect it with your unpowered Uno Arduino Overview:
7
7 - Carefully connect it with your unpowered Uno Arduino Overview:
8
8 - Carefully connect it with your unpowered Uno Arduino Overview:
9
9 - Carefully connect it with your unpowered Uno Arduino Overview:
10
10 - Reconnect Uno to laptop and verify all is working - Activate Serial Monitor Arduino Overview:
11
11 - Disconnect LED Breadboard and connect wire from pin 9 to JC3 on ProtoShield - Activate Serial Monitor Arduino Overview:
12
12 - Carefully move wire to JC3 to JC2… Arduino Overview:
13
13 - Add the Temperature Sensor to the Breadboard Arduino Overview:
14
14 - Connect Pin 1 to 5V Arduino Overview:
15
15 - Connect Pin 3 to GND Arduino Overview:
16
16 - Connect Pin 2 to A5 Arduino Overview:
17
17 - Modify your sketch to add the following variable Arduino Overview:
18
18 - Modify your sketch to add the following lines in loop Arduino Overview:
19
19 - Compile and Upload - Activate Serial Monitor - Test by putting your finger on the sensor - Do you see a change? Arduino Overview:
20
20 - Convert to Voltage and display on Serial Monitor Arduino Overview:
21
21 - Should see this… Arduino Overview:
22
22 - Use spec sheet to convert to degrees C - 10 mV/C - Look for offset Arduino Overview:
23
23 - 0.5 V offset Arduino Overview:
24
24 - Modify your sketch Arduino Overview:
25
25 - Should see this… Arduino Overview:
26
26 - Data make sense? - How would you calibrate this sensor? Arduino Overview:
27
27 - Add the Humidity Sensor to the Breadboard Arduino Overview:
28
28 - Connect 5 V from Temp Sensor Arduino Overview:
29
29 - Connect GND from Temp Sensor Arduino Overview:
30
30 - Connect Out to A4 Arduino Overview:
31
31 - Modify Sketch Arduino Overview:
32
32 - Should get… Arduino Overview:
33
33 - Convert to voltage and understandable units from data sheet - Algebra Arduino Overview:
34
34 - Modify Sketch Arduino Overview:
35
35 - Should get… Arduino Overview:
36
36 - Data make sense? - How would you calibrate this sensor? Arduino Overview:
37
37 - Add the Accelerometer to the Breadboard Arduino Overview:
38
38 - Connect 3.3V to Vcc from UNO Arduino Overview:
39
39 - Connect GND to GND from Humidity Sensor Arduino Overview:
40
40 - Connect ZOUT to A3 on UNO Arduino Overview:
41
41 - Connect YOUT to A2 on UNO Arduino Overview:
42
42 - Connect XOUT to A1 on UNO Arduino Overview:
43
43 - Accelerometer has a few other settings we need address from the Data Sheet Arduino Overview:
44
44 - Sleep…Connect 3.3V from Accel Vcc to SLP Arduino Overview:
45
45 - Range…Connect 3.3V from Accel Vcc to GSEL Arduino Overview:
46
46 - Modify Sketch as follows Arduino Overview:
47
47 - Modify Sketch as follows Arduino Overview:
48
48 - Should get… Arduino Overview:
49
49 - Convert to voltage and understandable units from data sheet - Algebra Arduino Overview:
50
50 - Convert to Voltage = accelX * (5.0/1024) - Subtract offset and convert to Gs Gs = (voltage – 1.65) / (0.206) Arduino Overview:
51
51 Arduino Overview: - Modify Sketch as follows
52
52 Arduino Overview: - Modify Sketch as follows
53
53 Arduino Overview: - Should get…
54
54 Arduino Overview: - Hold X flat, should see 0 G
55
55 Arduino Overview: - Hold X arrow pointing up, should see 1.0 G
56
56 Arduino Overview: - Hold X arrow pointing down, should see - 1.0 G
57
57 Arduino Overview: - Repeat with Y and Z axes - May need to tape breadboard down - Do you need to Calibrate? - How would you do it?
58
58 - Add the Pressure Sensor to the Breadboard - Notice orientation Arduino Overview:
59
59 - Add the Pressure Sensor to the Breadboard - Notice orientation Arduino Overview:
60
60 - Connect Pin 2 to 5.0 Volts from your Humidity Sensor Arduino Overview:
61
61 - Connect Pin 4 to GND from your Humidity Sensor Arduino Overview:
62
62 - Connect Pin 3 to A0 on your UNO Arduino Overview:
63
63 - Modify your sketch… Arduino Overview:
64
64 - Modify your sketch… Arduino Overview:
65
65 - Compile and upload. Should see… Arduino Overview:
66
66 - Use ¼ sprinkler tubing to suck on pressure sensor - Do not blow as limit of this sensor is 15 psi Arduino Overview:
67
67 - Convert to voltage pV=A0*(5.0/1024) - Use spec sheet to solve for psi (Algebra) Pmax = 15 psi Pmin = 0 Vsupply = 5.0 V Output(V) = pV Arduino Overview:
68
68 - Solve for Pressure(applied) = Pa Pa = psi= (pV – (.1 * 5.0)) / (.8*5.0) / (15-0) psi= (pV –.5) / (.4 / 15) Arduino Overview:
69
69 - Modify your sketch… Arduino Overview:
70
70 - Modify your sketch…Suggest commenting out your accel and other sensor Serial.print statements Arduino Overview:
71
71 - Should see this… - Suck to zero? Arduino Overview:
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.