# Measuring Light with a BeagleBone Black

## Overview

In this tutorial, you will learn how to connect a photoresistor to a BeagleBone Black.

![](https://cdn-learn.adafruit.com/assets/assets/000/009/314/medium800/beaglebone_overview_web.jpg?1396887408)

Because the BBB runs Linux, there are many ways in which it can be programmed. In this tutorial we show how to read analog values with a photoresistor light sensor using Python.

- [Next Page](https://learn.adafruit.com/measuring-light-with-a-beaglebone-black/you-will-need.md)

## Featured Products

### BeagleBone Black - Rev B

[BeagleBone Black - Rev B](https://www.adafruit.com/product/1278)
**[Adafruit is no longer shipping the BeagleBone Black Rev B, it has been replaced with the Rev C as of 5/12/14](https://www.adafruit.com/products/1876) - the Rev C now has 4G flash and also comes with Debian, it also costs slightly more. There are no exchanges or...**

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1278)
[Related Guides to the Product](https://learn.adafruit.com/products/1278/guides)
### Half Sized Premium Breadboard - 400 Tie Points

[Half Sized Premium Breadboard - 400 Tie Points](https://www.adafruit.com/product/64)
This is a cute, half-size breadboard with&nbsp;400 tie points, good for small projects. It's 3.25" x 2.2" / 8.3cm&nbsp;x 5.5cm&nbsp;with a standard double-strip in the middle and two power rails on both sides.&nbsp;You can pull the power rails off easily to make the breadboard as...

In Stock
[Buy Now](https://www.adafruit.com/product/64)
[Related Guides to the Product](https://learn.adafruit.com/products/64/guides)
### Adafruit Proto Plate for Beagle Bone & Beagle Bone Black

[Adafruit Proto Plate for Beagle Bone & Beagle Bone Black](https://www.adafruit.com/product/702)
Ready to prototype your next [Beagle Bone](http://www.adafruit.com/products/1278) project? You'll certainly want this handy Proto-Plate! Not only is it really good looking, its also very useful, holding your [Beagle Bone or Beagle...](http://www.adafruit.com/products/1278)

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/702)
[Related Guides to the Product](https://learn.adafruit.com/products/702/guides)
### Premium Male/Male Jumper Wires - 40 x 3" (75mm)

[Premium Male/Male Jumper Wires - 40 x 3" (75mm)](https://www.adafruit.com/product/759)
Handy for making wire harnesses or jumpering between headers on PCB's. These premium jumper wires are 3" (75mm) long and come in a 'strip' of 40 (4 pieces of each of ten rainbow colors). They have 0.1" male header contacts on either end and fit cleanly next to each other...

In Stock
[Buy Now](https://www.adafruit.com/product/759)
[Related Guides to the Product](https://learn.adafruit.com/products/759/guides)
### Photo cell (CdS photoresistor)

[Photo cell (CdS photoresistor)](https://www.adafruit.com/product/161)
CdS cells are little light sensors. As the squiggly face is exposed to more light, the resistance goes down. When it's light, the resistance is about ~1KΩ, when dark it goes up to ~10KΩ.

To use, connect one side of the photocell (either one, it's symmetric) to power...

In Stock
[Buy Now](https://www.adafruit.com/product/161)
[Related Guides to the Product](https://learn.adafruit.com/products/161/guides)
### Round Force-Sensitive Resistor (FSR) -  0.3 ~ 10 Newton Force

[Round Force-Sensitive Resistor (FSR) -  0.3 ~ 10 Newton Force](https://www.adafruit.com/product/166)
FSRs are sensors that allow you to detect physical pressure, squeezing and weight. They are simple to use and low cost. This sensor is an Alpha MF01A-N-221-A01&nbsp;with 1/2 diameter sensing region.

We used to stock the Interlink model 402 FSR - the Alpha version is almost half the price...

In Stock
[Buy Now](https://www.adafruit.com/product/166)
[Related Guides to the Product](https://learn.adafruit.com/products/166/guides)
### Extra-long force-sensitive resistor (FSR)

[Extra-long force-sensitive resistor (FSR)](https://www.adafruit.com/product/1071)
FSRs are sensors that allow you to detect physical pressure, squeezing and weight. They are simple to use and low cost. This sensor is a Interlink model 408 FSR with a massive 1/4-inch x 24-inch sensing region. You can press anywhere along the strip and the pressure will be recognized. Note...

No Longer Stocked
[Buy Now](https://www.adafruit.com/product/1071)
[Related Guides to the Product](https://learn.adafruit.com/products/1071/guides)
### Square Force-Sensitive Resistor (FSR)

[Square Force-Sensitive Resistor (FSR)](https://www.adafruit.com/product/1075)
FSRs are sensors that allow you to detect physical pressure, squeezing and weight. They are simple to use and low cost. This sensor is an Alpha MF02A-N-221-A01 FSR with a 38mm square sensing region. Note that this sensor can't detect _where_ on the square you pressed (for that, <a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/1075)
[Related Guides to the Product](https://learn.adafruit.com/products/1075/guides)

## Related Guides

- [SSD1306 OLED Displays with Raspberry Pi and BeagleBone Black](https://learn.adafruit.com/ssd1306-oled-displays-with-raspberry-pi-and-beaglebone-black.md)
- [BNO055 Absolute Orientation Sensor with Raspberry Pi & BeagleBone Black](https://learn.adafruit.com/bno055-absolute-orientation-sensor-with-raspberry-pi-and-beaglebone-black.md)
- [Blinking an LED with BeagleBone Black](https://learn.adafruit.com/blinking-an-led-with-beaglebone-black.md)
- [MAX31855 Thermocouple Sensor Python Library](https://learn.adafruit.com/max31855-thermocouple-python-library.md)
- [Introduction to the BeagleBone Black Device Tree](https://learn.adafruit.com/introduction-to-the-beaglebone-black-device-tree.md)
- [MPR121 Capacitive Touch Sensor on Raspberry Pi & BeagleBone Black](https://learn.adafruit.com/mpr121-capacitive-touch-sensor-on-raspberry-pi-and-beaglebone-black.md)
- [DHT Humidity Sensing on Raspberry Pi or Beaglebone Black with GDocs Logging](https://learn.adafruit.com/dht-humidity-sensing-on-raspberry-pi-with-gdocs-logging.md)
- [FONA Tethering to Raspberry Pi or BeagleBone Black](https://learn.adafruit.com/fona-tethering-to-raspberry-pi-or-beaglebone-black.md)
- [LED Backpack Displays on Raspberry Pi and BeagleBone Black](https://learn.adafruit.com/led-backpack-displays-on-raspberry-pi-and-beaglebone-black.md)
- [BeagleBone Black: Installing Operating Systems](https://learn.adafruit.com/beaglebone-black-installing-operating-systems.md)
- [Bonjour (Zeroconf) Networking for Windows and Linux](https://learn.adafruit.com/bonjour-zeroconf-networking-for-windows-and-linux.md)
- [Setting up IO Python Library on BeagleBone Black](https://learn.adafruit.com/setting-up-io-python-library-on-beaglebone-black.md)
- [Adding a Real Time Clock to BeagleBone Black](https://learn.adafruit.com/adding-a-real-time-clock-to-beaglebone-black.md)
- [Bone Box](https://learn.adafruit.com/bone-box.md)
- [MCP9808 Temperature Sensor Python Library](https://learn.adafruit.com/mcp9808-temperature-sensor-python-library.md)
