Skip to content

7. Light Sensor

RGill-1 edited this page Feb 6, 2023 · 2 revisions

An onboard VEML7700 light sensor detects light intensity between 0 - ~120,00 lux at ~20Hz. This sensor uses the same case as the distance sensor with a new lid and PCB tray to be printed.

Build Guide

1. Components

Component Product Code Approx Ex-VAT price Link
Adafruit ESP Feather V2 ADA5400 £16.5 Pimoroni
Adafruit VEML 7700 ADA4162 £4 Pimoroni
50mm JST SH cable CAB1015 (Pimoroni) / 104220 (PiHut) £1 PiHut / Pimoroni
M2.5 3x10mm screw, 3x6mm screw, 6x nuts 103126 (PiHut) / ADA3299 £ PiHut
500mAh LiPo battery (Optional) BAT0003 (Pimoroni) £6 Pimoroni
1/4 inch nut (Optional) £
2 x M2.5 threaded insert (Optional) £

Note both Pimoroni and PiHut have educational discounts available that can reduce these costs further.


2. 3D Printing

  • Navigate to the device page on Printables and download the model files (stl): https://www.printables.com/model/385964-diy-bluetooth-light-sensor
  • Slice the stl files. I have had success printing with 0.20mm 'Layer Height' and 6 Top/ 4 Bottom 'Solid Layers'
  • Suggested print order is shown left to right with the example prints below:

The image shows the case with threaded inserts already placed in. These are optional, if you don't want to screw down the lid, print the lid with no holes (choice on printables).


3. Assembly

  • Gather the electronics and fitting hardware together (battery and 1/4 inch nut optional)

  • Using one 6mm screw (and nut) in the bottom right corner attach the ESP32 Feather V2 to the PCB tray. Use another two 6mm screws (and nuts) attach the VEML7700 sensor board as well - note the orientation in the photo below. The PCB tray has a notch, this needs to be to the left (under the USB-C connector) so ensure a snug fit to case

  • Use the 50mm STEMMA QT cable to join the board to the sensor (as above)
  • Turn the case over and place three nuts into the recessed holes. Then place the case face up on a flat surface

  • If using a battery now is the time to attach it. Ensure the polarity is correct using the information printed on the PCB silkscreen to guide

  • Place the battery into the case and lay the PCB tray over it with the three remaining mounting holes lining up with the three case holes. Use the three 10mm screws to attach the PCB tray to the case. You may need to manipulate the battery wires - ensure they do not lie between the battery and the PCB tray

  • If using the 1/4inch screw, place it into the slot

  • Snap fit the lid and the build is complete (if using threaded inserts 2 x 4mm screws will secure the lid)


4. Upload the sketch

Ensure you have the 'Adafruit VEML7700', 'phyphox BLE' and 'Adafruit NeoPixel' libraries installed (Library Manager)

You must also have ESP32 board definitions installed (see wiki entry for guidance)


5. phyphox

  • In phyphox use the 'Add experiment for Bluetooth device' functionality to get the experiment off the device. Make sure to click 'save to collection' when prompted

  • Start collecting data by pressing the play button at the top (the first time you do this you may need to reconnect to the device - click 'try again' if prompted)

Example Labs

1. Polarising filters - Video coming

2. Inverse square law - Video coming

3. Transit of Exoplanets - Video coming

Clone this wiki locally