O'Reilly logo

Raspberry Pi Home Automation with Arduino by Andrew K. Dennis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the photoresistor

We are going to start by wiring up our photoresistor and testing it with some software. Once we have tested it, we can then hook it up to the motor shield and use the values it returns to turn the motor on and off.

Wiring up the components

Our first task is to set up our circuit. This process is very similar to when you created the thermistor circuit in Chapter 3, Our First Project–A Basic Thermometer.

You'll need your resistor, photoresistor, three wires (black, red, and yellow are used in the explanation), and the breadboard.

  1. Take the red wire and connect it from the 5 V pin on the shield to the supply voltage on the breadboard.
  2. Next take the black wire and connect it from the ground pin on the Raspberry Pi to the Arduino ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required