New Laser Gate
In the Cal Poly Pomona Physics department we have designed a low cost accurate
laser timing gate for use in physics experiments. We use the PIC16F690 chip
to perform the timing and to transfer the data via USB to a PC.
We first explain how to construct
the gate, then how to run the software. The total cost for the system is under
30 dollars, with most of the cost being the USB-TTL cable (20 dollars).
The new laser gate is an improvement over the older version in the following
The laser gate is very similar to the previous version with the addition of
an LED on pin 13:
- An LED has been added that lights when the laser hits the detector and
is off when the detector does not register a signal. This is very useful in
testing if the gate is ready for data collection.
- A more general graphing program is used to graph the data. After recording
the times, the data is saved automatically in a file called data.txt.
The student then runs
in the browser to upload and graph the
data. The new graphing program adds more options than the older version.
One can construct the gate
by placing the components
onto a solderless breadboard,
or by soldering the components
onto a perf-board. The connections
(with the 20 MHz resonator)
are shown in the figure to the right:
Click here to see a
parts list .
A picture of the breadboard with connections is shown below:
The PIC chip is loaded with the assemply code timer3led.asm
(4 MHz clock) or time3fastled.asm (20 MHz clock).
With the 4 MHz clock on the PIC16F690, the shortest measured blocking
time possible is 2 msec. For blocking times greater than 2 msec, the accuracy
for the blocking time is 2 micro-seconds. For blocking times
shorter than 2 msec, you will need to use our faster version with a 20 MHz resonator,
time3fastled.asm . With the 20 MHz
resonator, the blocking time can be as short as 0.4 msec, with an accuracy of 0.4 micro-seconds.
For instructions on how to program the PIC16F690 see
If the chip is running properly, the LED on pin 13 will light when the IR detector on
pin 11 goes "low" (i.e. detects the laser light). The resistance of the IR detector
changes when IR light strikes it. With IR light, the resistance is around 500 Ohms.
When no IR light is detected the resistance of the detector is large.
We run a C code in linux to read the usb port, collect the data and save it
We have also produced an image file that you can burn onto a CD or flash drive
to boot up into. The image file is:
lasergate3.iso . This image will start
your computer in a nice distribution of linux, "Puppy Linux". After booting,
hit "OK" in the setup screen, and
there will be 4 programs on the desktop that you can run by clicking once on the desktop icon:
conacc.desktop, tandv.desktop, graphdata.html, and linefitjs.html. A short page of
instructions can be found at
- conacc.desktop is a link to the program conacc that will run in
terminal mode. This program can be used if you suspect that the motion has
a constant acceleration. In our lab, we expect the acceleration
to be constant for the Atwood Machine,
ladder drop, and rotational dynamics experiments. The c program that is
run is conaccusbf.c described below. After the data is collected, it is
automatically saved in the file data.txt, which can be uploaded into
graphdata.html described below.
is a linear fitting program that gives the slope and intercept
as well as the uncertainty in these two parameters for the data in the table.
To graph the data from the lasergate, browse to find data.txt, which is
located in the root directory. Then click
upload file to upload the data, and click display data to graph
and fit the data. Click (or unclick) the boxes to include (or exclude) the
data points you want in the fit.
- tandv.desktop is a link to the program tandv that will run in
terminal mode. The program measures the time and velocity of the motion
when the gate is blocked. To calibrate the speed, you need to enter the
effective blocking distance. The c program that is run is tandvf.c, which
is described below. This program can be used in our Conserved Quantites
is a general linear fitting program that gives the slope and intercept as well
as the uncertainty in these two parameters. This program is not set to upload
any data, but the user can enter data of their choice.
- conaccusb.c and
conaccusbf.c (fast chip):
These programs can be used if one expects constant acceleration, such as
the ladder drop, atwood machine, rotational dynamics. Type "z" for calibration. After
typing "z" you will be asked for the number of blockings for calibration and the distance
between the first and the last calibration blocking. Check to see if the gate is
working by blocking the detector with your hand and observing the LED. If the gate works, type
"d", enter, to collect data. The source code is
conaccusb.c (4 Mhz chip) and
conaccusbf.c (20 Mhz chip).
After the data is collected it is automatically saved in the file data.txt in the
same directory as the executable of conaccusb.c. To compile conaccusb.c or conaccusbf.c
type "gcc conaccusb.c -lm" in terminal mode. To run the executable you might need to
be in super user mode to read the usb: sudo ./a.out.
- tandv.c and
tandvf.c (fast chip): This program records the time and
speed of the object as it blocks the lasergate. You can enter the effective blocking distance
and the number of data points you want. There is also the option to save the data to a
file called tvout.txt, which will be located in the root directory.
Siegel's Home Page
College of Science