Attempt to plot light sensor data from lunarsensor.

Buy the components, install firmware on Ambient Light Sensor.

Build the go app that polls data from lunarsensor.local host in your local network:

go build -o lightsensor main.go

Run the app for as long as you want to collect the data:

./lightsensor | tee

Plot the data with gnuplot:

gnuplot lightsensor.plot

Open generated lightsensor.png


Automatically update lightsensor.png as you change lightsensor.plot:

fswatch lightsensor.plot | xargs -n1 sh -c "gnuplot lightsensor.plot"


View Github