Chapter 3 Hardware

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.



Sticky Pi Device

Figure 3.1: Sticky Pi Device

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).

Camera box

Needed parts for the camera box

Figure 3.2: Needed parts for the camera box

  1. 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 lsblk to see all drives.

    To burn an SD card use our script like 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 etcher-cli.

  2. Prepare the Raspberry Pi.
    Modifications to the Raspberry Pi Zero

    Figure 3.3: Modifications to the Raspberry Pi Zero

    1. Solder 2x5 headers for the Real Time Clock on pins 1-10. Mount the clock (Figure 3.3A).
    2. Solder directly the IDC right angle connector onto the board on pins 35-40 (Figure 3.3A).
    3. 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)
      Mounting the Raspberry Pi on the sledge

      Figure 3.4: Mounting the Raspberry Pi on the sledge

    4. Use four screws to mount the pi on the “Pi sledge”. Plug the ribbon cable for the camera (Figure 3.4A).
    5. Fold the ribbon cable around the sledge as in the picture, and mount the camera with another four screws (Figure 3.4B-C)
    6. Insert the OS SD card (burnt as described above)
    7. 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.
    8. Initialize your device (you can do that at the same time as focusing), which you can do with the Data harvester:
      1. Power the data harvester, and ensure the time is set (not it is in GMT/UTC).
      2. Plug it to the pi’s USB port.
      3. Boot/power the pi.
      4. 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).
      5. As part of the communication process, the clock of the raspberry pi will be updated (indeed the factory RTC is unset)
    9. 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): IDC
    10. 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.
    11. Assemble the “camera box lid”:
      Assembly of the camera box lid

      Figure 3.5: Assembly of the camera box lid

      1. 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).
      2. 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).
      3. Clean the lid. Optionally coat it with water repellent such as Rain-X
    12. 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.
    13. Coat the whole box with a layer of epoxy (note you can also chose to do that before assembly)

Light box

Needed parts for the light box

Needed parts for the light box

  1. Assemble our custom PCB:
    Assembly of the custom PCB

    Figure 3.6: Assembly of the custom PCB

    1. Manufacture/order the PCB from the gerber files (Figure 3.6A)
    2. Prepare the timer (scratch the board to disable the built-in potentiometer) – (red in Figure 3.6B).
    3. Solder all parts to the board. This should be fairly self explanatory from the labels (Figure 3.6C).
    4. 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.
    5. Thread the push button (before soldering it, not to twist the cables)
    6. Screw the PCB to the bottom of the light box (be careful not to split the material, do not hesitate to use shorter screw).
      Assembly of the custom PCB

      Figure 3.7: Assembly of the custom PCB

    7. Insert the battery connector (Figure 3.7A)
    8. Screw the Humidity and temperature sensor to the outside the box (Figure 3.7A-B).
    9. Glue the solar panel in the top slot
  2. Assemble the light diffuser:
    Assembly of the custom PCB

    Figure 3.8: Assembly of the custom PCB

    1. Cut six 5V, white, led light strips (Figure 3.8A).
    2. On one side, cut away the + pad, and the - on the other side.
    3. Align all the + pads on the top, and solder them together, in parallel, with a transverse wire
    4. 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).
  3. 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.

QC and troubleshooting

Controlling the assembly before deployment in the field will save you a lot of trouble. A few suggestions:

  1. Plug all devices, and press the push button to initiate the image acquisition.
  2. 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.
  3. 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.
  4. 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).

Data harvester

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).

Sticky Pi Harvester schematic

Figure 3.9: Sticky Pi Harvester schematic

Figure 3.9 show how the different hardware parts interact. The parts we used are described in the Bill of Material.

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

Rapsberry Pi

  1. Download our OS image and burn it on an SD card
  2. Format the USB stick to make a single ext4 partition
  3. In the new partition you created, create a file named .api-credentials.env and 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.


  1. 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).
  2. Ensure the subnet is 192.168.8. (the ip address of the router should then be
  3. Write down the MAC address of the Raspberry Pi ethernet port (you can do that by using the ifconfig eth0 command, and spot a six-fields number looking like aa:db:e1:00:01:23).
  4. In the DNS menu reserve the IP address to 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:

Sticky Pi Harvester Assembled

Figure 3.10: Sticky Pi Harvester Assembled

QC and troubleshooting

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 a webpage should display the data harvester status.

Using Sticky Pis

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.