Schematic view of an Arduino connected to two photocells and a speaker. One leg of the first photocell is connected to 5 volts. The other leg is connected simultaneously to the first leg of the second photocell and the Arduino’s analog input pin A0. The red positive wire of the speaker is connected to digital pin 8 of the Arduino. The black ground wire of the speaker is connected to one leg of a 100 ohm resistor. The other leg of the resistor connects to ground.

Return to article.