The construction contains the following hardware:
- The LEDs are connected to eight GPIO ports on the Raspberry Pi as shown in the
figure. Note that a high signal (1) means that the LED will be on; with a low signal (0) it will be off.
- There is a light sensor on the bottom; when a hole in the rotating disc passes the LED-lightsensor the LED light will be detected by the sensor.
This will causes the light sensor to go from a low signal (no light) to a high signal (light).
The light sensor signal is connected to GPIO pin 23 of the Raspberry Pi.
Because the light sensor is interrupted for a small time, the sensor signal
will be like : _______---________
This can be used, for instance, to measure the time needed to pass the sensor since the Raspberry Pi can be programmed to give an interrupt when going from low to high and from high to low.
- The motor that rotates the disc has two speeds, low and high.
|
|
D0 = GPIO 2
D1 = GPIO 3
D2 = GPIO 4
D3 = GPIO 17
D4 = GPIO 27
D5 = GPIO 22
D6 = GPIO 10
D7 = GPIO 9
|