This page describes how to build the two main components of the hardware: the Sticky Pi Device and the Data Harvester. Briefly, multiple Sticky Pis are deployed in the field. Each device stores its images on its own SD card. On a regular basis (e.g. weekly), experimenters use a data harvester to retrieve the data from multiple devices. Silently, the data harvester also syncs the location and time of the devices it communicates with. One Data Harvester may be used to maintain multiple traps. Multiple Data Harvesters can exist in the same platform (e.g. five experimenters, one harvester per experimenter, ten devices per experimenter).
This section involve familiarity with 3D printing, electronics, DIY, … We are working on streamlining the assembly process towards a more `off-the-shelf tool’, but are generally happy to collaborate and help building devices – do not hesitate to contact us.
As you can see in Figure 3.1, the device has two main parts, which are connected with a ribbon cable: the camera box and the light box.
A complete description of the parts, price and reference is available in our Bill of Material
Note that all 3D-printed parts are available on our onshape repository where they can be exported in a variety of formats.
You can also take a look at our schematic.
The camera Box and light box can be assembled separately and swapped between devices (i.e. the light box acts as a plug and play module for the camera box).
- Burn our OS image onto the SD card (note you can also make your own from scratch image by adaptingthe scripts in).
Danger Zone! Ensure you know what you are doing here. In particular, give the path to the correct drive otherwise you may wipe out the wrong drive, and lose data. On Unix-like systems, use
lsblkto see all drives.
To burn an SD card use our script like
sh burn_image.sh -i <PATH_TO_LOCAL_IMAGE> -d <DEVICE>, where
<PATH_TO_LOCAL_IMAGE>is the OS image you just downloaded, and
<DEVICE>the SD card location
e.g. /dev/mmcblk0– you need
- Prepare the Raspberry Pi.
- Solder 2x5 headers for the Real Time Clock on pins 1-10. Mount the clock (Figure 3.3A).
- Solder directly the IDC right angle connector onto the board on pins 35-40 (Figure 3.3A).
- On the back of the Raspberry pi board, use a jumper cable to solder GPIO pin 40 to +5V (this provides power to the Pi, Figure 3.3B)
- Use four screws to mount the pi on the “Pi sledge”. Plug the ribbon cable for the camera (Figure 3.4A).
- Fold the ribbon cable around the sledge as in the picture, and mount the camera with another four screws (Figure 3.4B-C)
- Insert the OS SD card (burnt as described above)
- Focus the camera. For those who want to assemble multiple devices, we recommend a “camera focusing station” that can adapt a Pi sledge and has a display, keyboard… This way, one can use raspivid in preview mode to check focus and alignment.
- Initialize your device (you can do that at the same time as focusing), which you can do with the Data harvester:
- Power the data harvester, and ensure the time is set (not it is in GMT/UTC).
- Plug it to the pi’s USB port.
- Boot/power the pi.
- The data harvester should then display information, including the unique ID of the pi. It will be an eight-digit hexadecimal number (e.g.
abcd0123). Make a couple of physical label with this tag and stick them to the box (and write them on the sledge).
- As part of the communication process, the clock of the raspberry pi will be updated (indeed the factory RTC is unset)
- Thread the 1x6 ribbon cable (it should be at least 50cm long) through the “camera box” before clamping the 2x3 IDC connector on each side. You want have the two connectors in the same orientation (i.e. a wire connect pin 1 of the left connector to pin 1 o the right connector – and not pin 6):
- Plug the ITC connector on the Pi GPIO, and gently slide the Pi sledge inside the camera box, while pulling the slack cable from the outside. Note, at the stage, you can also add some desiccant inside the box to reduce fogging.
- Assemble the “camera box lid”:
- Cut a glass microscope slide into a 25x25mm square with a glass cutter (e.g. with a 3d printed gauge and snaping tool and tool it takes just a few seconds, Figure 3.5A-C).
- Place the glass window on the slot, use masking tape or duct tape to cover the central area and the back. Cast a layer of epoxy resin, and let it set for a day this will embed the glass in the lid. Note that it makes sense to make multiple lids at the same time and avoid wasting time and epoxy (Figure 3.5D-E).
- Clean the lid. Optionally coat it with water repellent such as Rain-X
- Add calk at the junction between the lid and the box, screw the lid on the box. Also use calk to seal the 6x1 ribbon cable outlet.
- Coat the whole box with a layer of epoxy (note you can also chose to do that before assembly)
- Assemble our custom PCB:
- Manufacture/order the PCB from the gerber files (Figure 3.6A)
- Prepare the timer (scratch the board to disable the built-in potentiometer) – (red in Figure 3.6B).
- Solder all parts to the board. This should be fairly self explanatory from the labels (Figure 3.6C).
- Make a custom connection to our push button (red in Figure 3.6C). This is arguably a bit of a hack, but that allows us to mimic the built-in TLP5110 push button, with our own.
- Thread the push button (before soldering it, not to twist the cables)
- Screw the PCB to the bottom of the light box (be careful not to split the material, do not hesitate to use shorter screw).
- Insert the battery connector (Figure 3.7A)
- Screw the Humidity and temperature sensor to the outside the box (Figure 3.7A-B).
- Glue the solar panel in the top slot
- Assemble the light diffuser:
- Cut six 5V, white, led light strips (Figure 3.8A).
- On one side, cut away the + pad, and the - on the other side.
- Align all the + pads on the top, and solder them together, in parallel, with a transverse wire
- Solder the 1x2 header to be connected to our PCB as in the picture (the male pins will be protruding downward). Use superglue to glue the header to the diffuser (Figure 3.8B).
- Test setup: Connect a camera box, using the 1x6 cable. Plug the light diffuser (or just a placeholder 5v LED light for now). Plug a battery. You should see the LED of the timer glowing (if not, press the push button to force reset the timer). After less than a minute, the The flash should be triggered, and the timer should shut down. Pressing the push button should restart the whole process. If left untouched, this should happen every 20min, approximately.
Controlling the assembly before deployment in the field will save you a lot of trouble. A few suggestions:
- Plug all devices, and press the push button to initiate the image acquisition.
- Ensure all devices flash. The light should blink twice.
- If the light does not blink. Check power/timer/light connection
- If the light blinks more than twice, the device is reporting an error. Typically, the camera cannot be found.
- Plug the Data Harvester and boot a device you want to test. Data transfer should be initiated.
- Check the label of the pi matches the ID displayed by the harvester.
- Monitor image transfer.
- Once all devices have been harvested, retrieve the memory stick of the harvester and inspect the content.
- There should be one directory for each device
- Each directory contains all the pictures for this device and a log file
- Open the log file to check no errors were reported
- The name of each image contains the time in UTC. Ensure the time is correct.
- Open the images to check exposure, focus,…
- The environmental data (temperature, relative humidity, GPS coordinates and other meta variables) are encoded in the exif metadata inside the “Make” field (Sometime, though rarely, the temperature/humidity sensor fails, so you may have missing values).
The data harvester is a portable tool to retrieve the data from the Sticky Pis. It is a (micro) computer running custom server that are available to the devices through a wifi network (hotspot).
Role of each part:
* Raspberry Pi 4 – the core computer
* RTC – Real Time Clock: persistent time.
* Memory stick – external drive where all the images will be saved.
* Mini Router – connect the harvester with the Sticky Pis during data transfer.
* Push Button – to turn the Raspberyy Pi off
* GPS – optional, get geolocation
* Display –optional, show the data harvseter webpage (can be accessed with other devices on the network at
- Download our OS image and burn it on an SD card
- Format the USB stick to make a single ext4 partition
- In the new partition you created, create a file named
.api-credentials.envand fill it with:
This will allow the data harvester to automatically upload the new images to your sever. This implies you have set up a server, and have created at least one user, which is described the webserver section.
- Set the name of the wifi network to
sticky-pi-net, and the password to
sticky-pi(this is to match the devices’ environment variables).
- Ensure the subnet is
192.168.8.(the ip address of the router should then be
- Write down the MAC address of the Raspberry Pi ethernet port (you can do that by using the
ifconfig eth0command, and spot a six-fields number looking like
- In the DNS menu reserve the IP address
192.168.8.2to the mac address of the eth0 port you just retrieved
A simple way to make the device is to connect the parts according to the schematics, and arrange them in a junction box like:
You should be able to see a wifi network named
sticky-pi-net and log on to is using the password
sticky-pi using any device (phone, table, laptop). Then, when you connect to http://192.168.8.2 a webpage should display the data harvester status.
Assuming you have a data harvester and at least one Sticky Pi. You can plug your Sticky Pi, which should begin to take pictures every 20 min. Pushing its button will force it to take a picture and go back to sleep it should take ~40s between when you press the button and when the device shouts the picture (you should see a white flash). If the device turns on and detect a Data Harvester, it will send all the new data automatically. The progress can be monitored on the Harvester webpage.