build details

Show: section status errors & todos local changes recent changes last change in-page changes feedback controls

DEMO - Light sensors

Modified 2021-10-19 by Andrea Censi

A fully operational Duckietown (unknown ref opmanual_duckietown/book)

previous warning next (15 of 22) index
warning
I will ignore this because it is an external link. 

 > I do not know what is indicated by the link '#opmanual_duckietown/book'.

Location not known more precisely.

Created by function n/a in module n/a.
with watchtowers built to right specs. TODO : add the name of the right specs

Accurate measure of the light field of the Autolab

This container will show you how to mount the Adafruit TCS34725 sensor on a watchtower and how to correctly plug it in.

Hardware setup

Modified 2019-08-29 by gerni17

Requirements

Modified 2019-08-29 by gerni17

Pinheaders
Jumper Cables
The sensor
Screws
Watchtower top plate

the upper plate of the watchtower need apposite holes to fit the sensor.

Soldering

Modified 2019-08-29 by gerni17

The first thing to do is to solder the pin headers to the actual sensor: To do so the easiest way is to use a breadboard and cut a few pin headers in order to get a nice 90-degree angle between the sensor and the pins.

Sensor on breadboard

Fix the sensor to the watchtower plate.

Modified 2019-08-29 by gerni17

To do so put the pin headers into the big hole and fix it with the screws.

Final assembled sensor

Wire the sensor to the watchtower

Modified 2020-07-18 by Andrea Censi

The best way to figure out how to do this is to always take the sensor and turn it until you can read what is written on it and that will be our basic position.

Plugins on the raspberry-pi:

o o 1 o o

2 3 4 o 5

Plugins on TCS34725:

o 1 2 4 3 o 5

This is the pin layout, every number corresponds to a wire color (it doesn’t matter which color is which number but just make sure that the wire is connected to the right pin header).

Pinheaders
Pinheaders

Now the hardware construction part should be done.

Software setup

Modified 2019-08-29 by gerni17

Requirements

*A sensor which is correctly setup on a running watchtower. Ideally an external light sensor that measures luminescence in [lux] that can be used as reference.

*An environment where you can control the light intensity, it can also be very small (try to use two light intensities below and above the operating point).

Introduction

Modified 2019-08-29 by gerni17

To calibrate the sensor we need to measure the light at two different intensities in order to be able to make a linear approximation. To do so we measure two different light intensities and input the expected values to the sensor and then make a linear approximation.

To do so measure the two intensities by running the container and follow the steps of the instruction provided on the console (don’t forget that you need an external reference sensor as well).

Run the calibration

Modified 2019-08-29 by gerni17

You can pull the image of the docker container to the agent

Check calibration of sensor

Modified 2019-08-29 by gerni17

You can check the calibration by going to the calibration folder, TODO

Run

Modified 2020-07-18 by Andrea Censi

To run the sensor container first you need to pull the image:

$ docker -H HOSTNAME.local pull gian1717/sensor:p2

And then start the container:

$ docker -H HOSTNAME.local run -it  --net host --privileged --name light-sensor -v /data:/data gian1717/sensor:p2

If you want to know more:

The whole sensor software is on my GitHub account , on the repository light sensor, sensor calibration.