Cover by Andrew K. Dennis

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

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 ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required