-
Notifications
You must be signed in to change notification settings - Fork 1
Raspberry Pi Set Up
Though this Raspberry Pi build is quite simple, there are a few things that you will need before you get started with your data collection. Please note that a very basic knowledge of Raspberry Pi projects and sensory assembly is needed to complete this project, so if you need to refresher on any Raspberry Pi-related content, please see the tutorials here.
If you have the Raspberry Starter kit, these materials should be easy to find, but you will need:
- A Raspberry Pi board.
- A breadboard for keeping things organized.
- Several male-to-female wires.
Three sensors are needed for this project. Please keep in mind that you can use any similar sensors that you may already have, but we listed the ones that we used should you want those sensors specifically.
- A simple button input.
- A sound sensor for Raspberry Pi. We used the LM393.
- A photodiode for Raspberry Pi. We used the GL5529.
You can choose to connect the sensors listed above to your Raspberry Pi any way that you like, and there are numerous tutorials available for each one. The important part is that your photodiode is securely attached to the display that will be running OpenMaze in a way that prevents any light bleed from the surrounding area.
For this purpose, we have included the 3D models of the housings that we printed for both the sound and light sensors for your use.
Begin by opening the Python script in this repo on the Raspberry Pi set up with the version of OpenMaze that you would like to test. After making sure that the input PIN numbers are set correctly in the Python file, run it and press the button to begin recording.
Once you wish to stop recording, press the button again and the Python script will create an export .xslx file and terminate.
When preparing to run your timing analysis it is important to make sure that your sensor thresholds are set appropriately, so that you don’t get any false positives, or miss out on recording important events.
The process of setting sensor thresholds depends on which sensor you use (for example, LM393 would require a physical screw tightening or loosening to change the threshold), so it is up to you to set the thresholds in tune to the screen brightness and speaker volume of your particular system.
There exists a helper method called printSensorStream() in the main Python file which will help you to do just that. Simply run the script with that method expressed in __init__, instead of the production ones, and you will see a steady stream of sensor data output in the console on the Raspberry Pi. This is a great time to alter the activation threshold of both sensors to suit your needs. Once that is done, remove the script reference in __init__ before running your timing experiment.