Remember the well-planned circuit diagram from last blog post? Well, like most projects, it turns out that we need to re-design most of it.
We were initially going to turn the lasers on and off with the raspberry pi through an electrical switch. However, we are dealing with 12V and 300mA through the lasers, which is too high of any of the available transistors. We then moved onto testing MOSFETs for the switch - but our stockroom did not carry any of the n-channel MOSFETs that we would need. (We did have p-channel mosfets, but the raspberry pi can’t put out negative voltages). So for now, we’ll be using a large manual switch on the box to control the lasers. This also has the benefit of being an emergency “off” switch in case the electrical system is malfunctioning. So maybe we can turn this bug into a feature.
Now onto the photodiodes, which we are using to detect whether the laser beam has been broken. (We were originally going to use photoresistors, but were able to scavenge photodiodes on campus for faster and cheaper testing). Our original plan was to connect the photodiodes straight to the raspberry pi, but we soon discovered that the output voltages are too small to be differentiated between by the pi. As a result, we’re planning to read the photodiode inputs through the analog read of an Arduino. The Arduino will then analyze the sensor values against a calibration function, and output a digital HIGH or LOW signal to the raspberry pi. Of course, this means that we’ll also have to add in a power supply for the Arduino.
We’re also getting a much smaller voltage output from the photodiodes than we were expecting, so we may need to amplify that signal. The amount of amplification will depend on the light conditions inside the large maze, so we will figure out the constants based on testing inside the box. We might use an additional photodiode as a control standard for the threshold between light and dark.
We may have to redesign these solutions again. We will definitely need to iterate through more prototypes. And I’m sure we will find ways to turn more bugs into features.