Light Sensor

The light sensor add-on can be used to measure overall light level nearby. The add-on is actually made up of three light sensors which you can see in the photo below.

Tip: You can use the Sensor Dashboard to view and graph readings from Marty's light sensor in real time.

Set Up

Lightsensortopnumbered Front of light sensor, showing the three light sensors

Lightsensorbottom Back of the light sensor, showing the I2C connectors, microcontroller and the rest of the circuitry

The light sensor is designed to attach to one of the two attachment points on each of Marty's feet - the front or the back.

Lightsensorfootunmounted An empty slot on Marty's foot where the sensor can be mounted

Installing the Sensor

Step 1: Decide where to mount the sensor, and ensure you have a free cable

We recommend mounting the light sensor at the back of Marty's foot. Alternatively, you can mount it at the front, although you may need to remove an existing sensor to make space.

Step 2: Connect the cable to the light sensor

Connect the black I2C cable to any available socket on the light sensor.

Step 3: Fix the light sensor board to Marty

Use two M3 nuts and bolts to firmly fix the light sensor to the foot.

Lightsensorfoot The light sensor connected and screwed into place on Marty's foot

Checking and Configuring the Sensor

When you are connected to your Marty from the Robotical app, select Configure then Add-ons to get to the Add-on configuration screen.

Config Addons Light Sensor

Your light sensor should appear in the list of add-ons, with a default name such as lightsensor_28.

If you have only one light sensor, you don't need to rename it. If you have multiple light sensors, you can give them different names to make them easier to identify.

There is no need to rename the sensor unless you have more than one.

Using the Light Sensor with Blocks

The light sensor can be read using the “light sensor” block under Sensing.

If you only have one light sensor, there is only one option. If you have two light sensors we recommend naming so you can differentiate them.

The block will always return a positive number, with a higher number meaning more light.

Try shining the torch from a mobile phone on the sensor and see what happens!

Light Sensor Block

Task Runner