Find out how fast you can run


The final piece of the timing block is the logic bit, which accepts input on channel 1 of the Wireless receiver (from the starting block) and from the Motion trigger circuit. In the previous issue, the littleBits article was about the logic bits and truth tables, so you can refer to that article for review [3]. To determine which logic bit would be appropriate for this project, I had to build a truth table for the behavior I wanted.

In the system truth table in Figure 6, a 0 means off or untriggered, whereas a 1 means on or triggered. As you can see, only when pressure is off of the Pressure sensor and the Motion trigger has not sensed movement do I want the timer to run. In any other case, I want the timer to be off, or the situation should not exist (X), in which case the state of the system needs to be reset. The truth table of the NOR bit satisfies these logic requirements.

Figure 6: The truth table for the sprintBits matches that for the NOR bit.

System State

Before you can use the sprintBits setup, you need to make sure the system is in the correct state. Three LEDs help you make this determination (Table 3). In the timing block, you have to make sure the Motion trigger LED is off. When the sprinter triggers the sensor, the LED turns on and the timer LED turns off, indicating that it is no longer keeping time.

Table 3

LEDs and Sprinter's Actions


On Starting Block


At Finish Line

Returns to Start

Pressure sensor LED





Motion trigger LED





Timer LED





The runner should record the time before returning to the starting block by passing in front of the Motion trigger again, which triggers the sensor and turns its LED off (i.e., the Timer and Sprinter Returns columns are the same). Although this also lets the timer start running, this situation is corrected when the runner prepares for the next sprint at the starting block.

As just explained, before placing a foot on the runner's block, the Motion trigger LED must be off. Once the Pressure sensor is activated, the timer stops, and the Pressure sensor LED in section T1 should turn on; if it doesn't, pressing the state button to the right of the runner will put the system in the correct state. All the runner has to do now is hit the button in section T2 to reset the Number bit to 00. Now when the sprinter takes off, the timer starts, and the Motion trigger is in the correct state to stop the timing when activated.

To summarize:

  • The Motion trigger LED is off.
  • The runner's foot is on the Pressure sensor.
  • The T1 LED is on.
  • The runner presses the reset button.
  • The race is on!

Figure 7 shows the finish line setup with the timer activated. The Motion trigger is very sensitive and has quite a large active area, so the cone over the sensor confines the space in which it senses activity. You'll have to experiment with the size of the cone to determine how big it has to be to "see" the sprinter without being triggered by activity outside the area of interest.

Figure 7: The timing block at the finish line. The timer is running, as its LED indicates.

Buy this article as PDF

Express-Checkout as PDF

Pages: 4

Price $2.95
(incl. VAT)

Buy Raspberry Pi Geek

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content