Now you’ve learnt the core bits of the Raspberry Pi, it’s time to put them to use. Your
sensors.py file is now complete. You only need to modify your main project file now.
Here are some ideas for potential mini-projects you might like to try:
You will need your Ultrasonic sensor and Camera for this to work. Use the camera to take a photo anytime someone comes within a meter of your Raspberry Pi! For this to be useful, you’ll want to change the name of the PNG file each time so you don’t just save over the top of the same file.
As a suggestion, I’d use a filename based on the current time and date. Perhaps using something like this? Make sure you include a time/date stamp annotation in the PNG file as well.
now = datetime.datetime.now() filename = now.strftime("%Y-%m-%d-%H-%M-%S.png")
Modify the previous challenge so that it records the intruder on film!
Modify either of the previous challenges (ie: use photos or video, whichever you prefer) to incorporate a few extra features:
Moving away from the intruder detection system, here’s a different idea using 2 buttons, 2 LEDs and the camera.