The PICPET is a delight: it uses the most basic PIC microcontroller in a clever way. Although the chip only has 8 pins, the hardware is particularly suitable for timing pendula! It really is a 'Precision Event Timer'. I give it 5 gold stars!

The pP6 is connected to 5V power, Ground, a 10Mhz crystal (or external oscillator), a pendulum sensor (usually a beam breaker) and two pins provide serial output at 9600 baud. The device measures the number of 10MHz ticks between each beam break, and sends the results to an external computer where a serial reading program either displays the results and/or saves the timings to a file for later analysis. The analysis is down to the user: spreadsheet, write your own program, the R statistical package. I prefer Python because I'm familiar with it, and it has lots of advanced built-ins, but not difficult to program averages, standard deviation, etc in other languages including BASIC.
The main problem with Spreadsheets for this application is the sheer volume of data produced by the picOET. At 1 second per pendulum swing, it sends 86,400 samples per day, more than 1 million samples a fortnight. Early versions of Excel could only hold 65,536 rows. The current Excel will stretch to about 1 million rows, but a fast computer with at least 8Gb of memory is needed to do it, and expect sluggish performance.
When the picPET was made available by Tom, most computers came with at least one serial port, and it was easy to wire the picPET up to them. Today most connectivity is done by USB and serial ports have become rare, creating a minor problem. One solution is a USB to serial converter cable, like these examples on Amazon. The breadboard above, a few connections are missing, shows I did it by connecting the pP6 to an Arduino Nano, which was programmed to write whatever it received to USB. (Not difficult to program and many examples on the web.)
Whilst picPET does a brilliant job, I wondered if the same could be done with a more modern microcontroller, to which the answer is yes, no, and maybe! It depends on which one. A typical problem with modern microcontrollers is they get high performance and functionality by adding clever features and a host of go-faster tricks that reduce timing accuracy. They time fast events, but not necessarily with high precision.
Turns out the simpler chips are better for this than the sooper-dooper ones. Some of the Arduinos are suitable, and have advantages compared with the picPET. (disadvantages too!)
Advantages:
- Arduino boards all come with a USB interface – no need to wire up an adaptor. The interface runs much faster than 9600 baud – I'm using 115200. Roughly 960 characters per second vs 11520 cps.
- The boards all come with a built-in 16MHz oscillator, so no need to source an wire up a 10MHz crystal. But make sure the board has a crystal rather than a wobbly ceramic resonator. (Uno, Leonardo, & Mega2560 have crystals, Nanos have resonators.) And they're affordable.
- Arduinos can be programmed to provide the same timer functionality used by the picPET to achieve high precision
- 16MHz provides higher resolution than 10MHz
- Most important to me, extra functionality can be added to the Arduino, such as reporting air pressure, humidity and temperatures as well as pendulum period
- Arduino programming is aimed at the hobbyist, and it's free. No special equipment is needed. There is a learning curve because the devices are programmed in C/C++, but much of the behind the scenes complexity is hidden. Most advantageous is the existence of many libraries and working examples, which make using all the common sensors simple. Most of these have been modularised to make the electronics hobby friendly, plugging components into a breadboard rather than soldering. Soldering is only necessary in the production version, because breadboard connections eventually become unreliable.
Disadvantage: accuracy depends on the 16MHz crystal, which is not intended for high-accuracy work. Could be replaced but I hate soldering sub-miniature electronics. Some chips, like that in the Leonardo, can be clocked from an external pin connected to a better oscillator, but only up to 6.4MHz, which is inferior to a picPET,
Example of Arduino Precision Timer here. I believe it works, but as always, comments welcome!
Same job could be done with more powerful members of the PIC family, but I'm less enamoured of them for historical reasons. My first microcontroller projects were PIC but this was back when you made your own boards, the programming environment was for experts, sensors were poorly supported, and one either bought an expensive chip burner or bodged one: mine used the parallel printer port driven by a special program. Everything was hard work! Arduino, when it arrived, had many improvements: lessons had been learned! Far more straightforward: board ready to go, built-in burner programmed via standard USB, and a simplified development environment. Not suitable for everything – there are glass ceilings – but the environment is more than powerful enough for most hobby needs.
Dave