0.0
No commit activity in last 3 years
No release in over 3 years
Use with a Raspberry Pi + MCP3008 10 bit analog to digital converter + photoresistor to detect ambient light intensity.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.1.0, ~> 0.1
 Project Readme

Introducing the Rpi_photocell gem

To use this gem you will need the following:

Connections

Make the following physical wiring connections:

  • 3.3v from the Raspberry Pi to VCC and VREF on the MCP3008
  • Ground from the Raspberry Pi to AGND and DGND on the MCP3008
  • GPIO 18 from the Raspberry Pi to CLK on the MCP3008
  • GPIO 23 from the Raspberry Pi to DOUT on the MCP3008
  • GPIO 24 from the Raspberry Pi to DIN on the MCP3008
  • GPIO 25 from the Raspberry Pi to CS on the MCP3008

Usage

require 'rpi_photocell'

RPiPhotocell.new.read
#=> 642

Note: The value ranges from 0-1023, with the value decreasing the darker it gets, and increasing the brighter it gets.

Resources

rpiphotocell gem adc photocell pi_piper