Skip to content

Commit 39900a2

Browse files
tutorials/sensors: elaborate (#133)
1 parent 44d60dd commit 39900a2

File tree

1 file changed

+97
-10
lines changed

1 file changed

+97
-10
lines changed

tutorials/sensors.md

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,103 @@
11
Sensors
22
=======
3+
### What are Sensors?
4+
5+
6+
Sensors are devices that detect changes in the physical environment and convert them into electrical signals. They act as the "senses" of electronic systems, allowing devices to interact with the world around them. In the context of the Pocket Science Lab (PSLab), sensors enable users to measure and analyze various physical phenomena, turning the PSLab into a versatile scientific instrument.
7+
8+
9+
### Analog vs Digital Sensors
10+
11+
12+
Sensors can be broadly categorized into two types: analog and digital.
13+
14+
15+
#### Analog Sensors
16+
17+
18+
Analog sensors produce a continuous output signal that is proportional to the measured quantity.
19+
20+
21+
Key characteristics:
22+
- Output is a continuous range of values
23+
- Can detect small changes in the input
24+
- Often require analog-to-digital conversion for use with digital systems
25+
- Examples: thermistors, photoresistors, potentiometers
26+
27+
28+
#### Digital Sensors
29+
30+
31+
Digital sensors produce discrete digital output signals, typically in binary form (0s and 1s).
32+
33+
34+
Key characteristics:
35+
- Output is discrete values, often binary
36+
- More resistant to noise compared to analog sensors
37+
- Can be easily interfaced with digital systems
38+
- Examples: digital temperature sensors, infrared motion sensors, digital accelerometers
39+
40+
41+
## Experimenting with Sensors on PSLab
42+
### Analog Sensor Experiments with the Generic Sensor Instrument
43+
44+
45+
The PSLab provides a way to interface with analog sensors. This can be through a Generic Sensor instrument or specific analog input pins.
46+
47+
48+
#### Experiment: Motion Sensor to Control Audio
49+
50+
51+
This experiment demonstrates how an analog motion sensor can potentially be used to trigger audio output.
52+
53+
54+
Materials :
55+
- PSLab device
56+
- Analog motion sensor (e.g., PIR sensor)
57+
- Audio output device compatible with PSLab
58+
- Necessary connecting wires
59+
60+
61+
Procedure :
62+
1. Connect the motion sensor to an analog input on the PSLab.
63+
2. Set up the audio output device with the PSLab.
64+
3. Use the PSLab software to read the analog input from the motion sensor.
65+
4. Create a script that activates the audio output when the sensor reading exceeds a certain threshold.
66+
5. Test the setup by moving in front of the sensor.
67+
68+
69+
This experiment demonstrates how analog sensors can be used to trigger actions based on environmental changes.
70+
71+
72+
### Digital Sensor Experiments with the Generic Sensor Instrument
73+
74+
75+
Many modern sensors use digital communication protocols. The PSLab supports interfacing with digital sensors, through specific digital input/output pins or communication interfaces like I2C.
76+
77+
78+
#### Experiment: Temperature and Humidity Measurement
79+
80+
81+
This experiment outlines how a digital temperature and humidity sensor might be used with the PSLab.
82+
83+
84+
Materials :
85+
- PSLab device
86+
- Digital temperature and humidity sensor (e.g., DHT11 or DHT22)
87+
- Necessary connecting wires
88+
89+
90+
Procedure :
91+
1. Connect the digital sensor to the appropriate pins on the PSLab (likely power, ground, and a digital data pin).
92+
2. Use the PSLab software to initialize communication with the sensor.
93+
3. Create a script to read temperature and humidity data at regular intervals.
94+
4. Display the data on the PSLab interface or log it for later analysis.
95+
5. Observe how temperature and humidity change under different conditions (e.g., breathing on the sensor, moving it to different locations).
96+
97+
98+
This experiment showcases how digital sensors can provide multiple data points and how they interface differently with the PSLab compared to analog sensors.
99+
3100

4-
What are Sensors
5-
----------------
6101

7-
What are Analog and what Digital Sensors
8-
----------------------------------------
9102

10-
Analog Sensor Experiments with the Generic Sensor Instrument
11-
------------------------------------------------------------
12-
Experiment: Motion Sensor, turn on music
13103

14-
Digital Sensor Experiments with the Generic Sensor Instrument
15-
----------------------------------------
16-
Experiment: Temperature and Humidity

0 commit comments

Comments
 (0)