As I announced in the Water Drop (Pro) article (you should read this one first) the sensor add-on for this projects follows here. Because I already built the hardware of the Pro-Version for a sensor use one only has to change some small things to get the sensor running. Who has also read the post about the Advanced-Version will recognize the sensor, well, at least the idea - it's a laser photocell.
I also updated the files in the project directory. You can download them here.
For a laser photocell you need a sender and a receiver. I'm going to use an old laserpointer as sender. I modified it, so it doesn't need batteries anymore. It is now powered by one of the Arduinos pins.
The Laserpointer needs in my case 3V and 15mA. At this I can power it with one of the digital output-pins (40mA max.). If your Laserpointer needs more energy, you'll have to use a relais or a transistor in order to not destroy the microcontroller. The lace around the laserpointer keeps its button pressed, if you don't like that, just open the housing and solder the buttons pins together.
As I said, my Laserpointer operates with 3V, but the Arduino runs with 5V. At this you need a voltage divider (basically you need the simple version of the logic level shifters).
As receiver I use a phototransistor (620-960nm). It is placed in a different housing right opposite to the sender. The whole package will be connected with the switchbox via an microphone socket. The shematic plan below shows the sender/receiver-package, for which I used the following parts:
|1||Resistor||1kΩ||For the voltage divider|
|1||Resistor||2.2kΩ||For the voltage divider|
|1||Resistor||10kΩ||For the phototransistor|
|1||Phototransitor||620-960nm||BPW-16 or similar|
|1||Laserpointer||Red||Here shown as LED|
Attention! I use a laserpointer with red light. If you're going to use another color, you also have to adapt the phototransitor to it, because mine only catches red light. To make it easy, here's a table.
"Sensor Jack" is a simple 5-pin microphone plug, which can be connected with the socket on the switchbox. Theoretically you can use 4 pins (just connect both GND lines), but there is already a 4-pin socket on the switchbox. To not confound them I decided to use a different amount of pins - better safe than sorry.
The socket is the connected with the terminal blocks on the pcb. Just be careful, that you really connect the right pin with the right cable, otherwise you might create an short circuit - you don't want that.
To be sure, consider the Fritzing-file in the project directory (Zip-file you've downloaded).
The housing for the phototransistor is a small, cheap plastics housing. I drilled three holes into it:
- One for the 5-pole cable that comes from the switchbox.
- A smaller one for the sender's power supply (2-pole cable).
- And one for the light beam.
To keep the changings on the Pro-versions frame as little as possible I decided to attach a thin wooden board to the middle beam. That way you only have to drill two 12mm holes into the middle beam and fix a threaded nut (M8) in each of the holes, then mount the board with two wing screws.
The board can be designed anyway you want it, and as I don't think anyone uses the exact same housing for the sensor, I didn't put it into the zip file. The only requirement is, that the holes for the threaded nuts are 260mm apart from each other and symmetrical to the center line of the beam.
And of course, you'll find the always newest version of the code (and everything else) in the zip file. For all those of you who do want to take a look into the code before downloading it: GitHub. The sensor is supported from version 1.3.0 and works flawless on version 1.3.2 or higher.
To be actually able to use the sensor you first have to press the connect button, then check the checkbox besides the start button.
After that you can edit the parameters at the left side of the hosts mask.
- Height 1: This is the distance between the falling object and the sensor above the sensor. If you hold an apple 10cm above the sensor you have to set this paramater to 100mm.
- Height 2: This is the distance between the sensor and the bottom.
- Delay: The delay will be calculted automatically, due to some unknown delays in the camera this dela < may vary from the real delay. Just test it until it fits for your need.
If the checkbox is checked, the valves are not in use. If there are any request for the usage of both, I will add that to the software.
Is the sensor too sensible, does the camera trigger without any object falling trough the sensor? No problem! Just go to Tools -> Options and change the sensibiliy. 0 is the max. and 10 is the lowest sensibility, I know, it's counter intuitive, but that's because I'm lazy.
The sensor type has to be chosen depending on if you're using a digital or an analog sensor. The sensor I use is an analog one, because it just sends the raw value to the switchbox. A digital sensor only sends a low/high signal or a bunch of low/high signals.
Such a sensor could be that one:
Here you have to use a sensor that gives a LOW signal when an object is detected, otherwise it won't work with the switchbox.
To test it I've set the delay to zero and triggered a flash instead of the camera. The shutter speed was set to 4 seconds (you might guess it, I did it in a darkened room). That way the flash "catches" the object.
That picture is pretty darn ugly, but it shows quite good how fast the system is working. If you're going to use your camera (mirror lockup enabled, flash triggered via the cam) then you will get some major delays. Just figure out how big that delay is simply by testing it and take that time as more-or-less constant, then substract it from the delay in the host software.
A few last words. Besided this sensor you can of course use some other ones, maybe a sound sensor. If you want to know how to use or build such a sensor, just ask me in a comment or write me a mail.
That's is, questions and comments: Wordpress.