Use the table of contents to the right to find the sensor you'd like to use, how to connect it to your device and the code you need to make it work.
Copy and paste the code to the right into the Arduino IDE and compile it into your device. Don't forget to open the serial window to see your values.
Details
Use the command terminal to install w1thermsensor. Make sure the RPI configuration matches that of the image to the right then copy the code in the bottom right of the image into the IDE and press run.
Copy the data it returns to you into a spreadsheet and graph the result. This is good for the phase changes lab.
Details
H-Bridge motor control breakout board $9.07
This device allows you to attach an external power source to up to two motors. This is useful if your motors need to draw more energy than your device can give (max output from a RPI is 5V). This device can also make it easier to control 2 motors with 1 RPI. Copy and paste the code into the IDE and run it. To change the behaviours of your motors, change the code in the main function.
Details
To avoid burning the components in this device, make sure to always disconnect the power before adding this to or removing this from you Pi. Bad connections can fry it so be careful.
This device can sense:
temperature
humidity
pressure
acceleration
its orientation in space
magnetic fields
This device also has:
A LED matrix (screen)
A joystick
Visit this site to see the code that can be run on this device as well as examples
Details
Visit this website to learn how to use the picamera and example code.
https://picamera.readthedocs.io/en/release-1.13/
Things Sam tried with the camera:
Click to see the code he used to make these work...reaction rate sensor
velocity calculator
Details
Ideas:
Combine this with a laser to make a tripwire or photogate.
Use this component with a carbon dioxide sensor in a terrarium to compare the rise and fall of CO2 with the rise and fall of the sun.
from gpiozero import LightSensor
LS = LightSensor(17)
print(LS.value)
Other functions the LightSensor class can do...
## Pause until no light is detected
wait_for_dark()
## Pause until light is detected
wait_for_light()
## Return True if light is detected
light_detected
## Function to run when it is dark
when_dark = my_function
## Function to run when it is light
when_light = my_function
## for example:
LS.wait_for_dark()
print('It is dark now.')
Get to know the gpiozero library here:
This photocell is encased in a dark plastic straw to protect it from ambient light as it and a laser act as a photogate.