adding sketeches

This commit is contained in:
Peli de Halleux 2016-09-29 08:32:15 -07:00
parent 165cd0c67e
commit 13383e6232
5 changed files with 21 additions and 5 deletions

View File

@ -2,11 +2,6 @@
In ths project, we will build a timing gate, a system that can measure the speed of a car. In ths project, we will build a timing gate, a system that can measure the speed of a car.
The timing gate is made of two sensors that can detect the moving car.
When the car goes through the gate, it triggers each sensor and the micro:bit
records the times. The speed is then computed by dividing the distance between the sensors
by the time between each sensor trigger.
### ~hint ### ~hint
This lesson explains the principles of timing gates using household materials. To build high performance gates, This lesson explains the principles of timing gates using household materials. To build high performance gates,
@ -42,6 +37,27 @@ control.eventTimestamp();
basic.showNumber(0) basic.showNumber(0)
``` ```
## How does it work?
The two gates are connected to the micro:bit and can detect a car passing through.
![](/static/mb/projects/timing-gates/sketchgates.jpg "Sketch of the gates")
As the car passes through the gate ``0``, it sends an event to the micro:bit through the [on pin pressed](/reference/input/on-pin-pressed) block.
The micro:bit records the time in a variable ``t0``.
![](/static/mb/projects/timing-gates/sketchgate1.jpg "Sketch first gate")
As the car passes through the gate ``1``, it sends an event to the micro:bit through the [on pin pressed](/reference/input/on-pin-pressed) block.
The micro:bit records the time in a variable ``t1``.
![](/static/mb/projects/timing-gates/sketchgate2.jpg "Sketch first gate")
The rest is a bit of math and physics. The time taken to cross the gates is computed as the difference of ``t1 - t0``.
By dividing the distance between the gates by the duration, we get the speed of the car!
![](/static/mb/projects/timing-gates/sketchmath.jpg "Sketch math")
## Building the gate ## Building the gate
The sensor is made by tapping two strips of fail on the cardboard as close as possible. The sensor is made by tapping two strips of fail on the cardboard as close as possible.

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB