Arduino-based event counter

I teach Modern Physics here at CSUC, and we occasionally use isotopes with half-lives of a year or less (such as Zinc-65 and Cadmium-109) for energy-calibration sources for a gamma-spectroscopy lab. I thought it might be fun to try measuring the activity of one of these sources over time and thus get a looooong-scale half-life data-set for students to play around with. Or maybe watch background nuclear count rates as a function of time for a couple months and see if we can locate the sun and/or galactic center from the cosmic ray count rate as a function of time and/or season.

Arduino-based event counter

I didn’t want to dedicate an entire computer and LabVIEW seat to the project, and besides I haven’t yet seen a six-month period here during which our power didn’t go off at least once. I figured it’d be nice to have a cheap self-contained module that did nothing else but count and log the counts. Here’s what I came up with:
The control unit is an Arduino Pro Mini, 328/3.3V/8MHz. It talks to a DS3231 real-time clock to get time-stamp information, and counts nuclear events (or any other digital signals) using an interrupt. Every hour (or so) it saves the event count to the SD card, with time-stamp information at the beginning and end of the interval, and starts another interval. The board has a large capacitor and a zener diode so that if the power fails the Arduino immediately saves the current count (with time-stamp) and writes a warning in the file to let the user know what happened. When power resumes, so does the counting — on the next line in the file with a new time-stamp, of course. When you’re ready to stop collecting data, flip the switch and pull the SD card: everything is saved in ASCII format on the file “DATA.TXT”

It can comfortably count events at up to 10ks/s. Possibly more, but I’ve not tested it past that rate as that’s two orders of magnitude faster than what I need. There is also a count/don’t-count switch, a battery backup on the RTC chip, an ALD1701 op-amp follower making sure that the input pulses are 3.3V-safe by the time they reach the Arduino, and of course an LCD that provides helpful information such as the time/date, count, and occasionally an error message.

Arduino-based event counter schematic

A complete parts-list, EagleCAD schematic and board layout, and Arduino programs are available here, should you want to make your own. I use the DS3231 library I wrote earlier, so you’ll need to either grab that or modify my code to use your own clock routines if you’d prefer. The board layout I put together has larger-than-necessary pads —particularly on the vias— to facilitate 2-sided board production if you’re using the toner-transfer method.


For more detail: Arduino-based event counter

This Post / Project can also be found using search terms:

  • arduino based counter projects
Clip to Evernote

Leave a Comment

(Spamcheck Enabled)

Read previous post:
Lithium Battery Solar USB - iPhone - Arduino Charger
Lithium Battery Solar USB – iPhone – Arduino Charger

One of the most fun and useful projects on instructables is to create your very own solar USB/ iPhone charger....

Scroll to top