Skip to content

This is a quick an dirty LCD display for Gieger counters to allow long term readings for low radiation levels.

Notifications You must be signed in to change notification settings

b-wave/geiger_counter_lcd_display

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PIC12F1822 Geiger Counter Display

This project was my first Co-Pilot collaberation. It came about when someone asked me how to tell if her frozen shrimp were radioactive. Simple, read the background radiation and add your sample reading the difference is the radiation from your frozen friends!

It uses a PIC12F1822 microcontroller to count Geiger pulses and display either total counts or CPM (counts per minute) on a serial LCD. It’s designed for ultra-low resource environments and runs entirely on internal oscillator and software UART. The display was intended to be an 8x2 LCD with a serial interface. I used a Newhaven Dispay NHD-0420DZ3 Display which is overkill but it was the only other serial diaplay on-hand for testing. If you want to use a larger display this one is OK but the backlight should be turned off on a battery powered system. Also, this display defaults to 9600bd but the PIC was not capible of outputting 9600bd. At 4800bd it worked fine but this display skips 4800bd so we reduced the rate to 2400. I will post a short video soon about my experence using my AI assistant Co-Pilot.

Features

  • Interrupt-driven pulse counting (RA1 was RA5)
  • Mode toggle between CPM and total count (RA3)
  • Reset button to clear counters (RA4)
  • Serial LCD output via software UART (RA0)
  • Timer1-based CPM calculation (1Hz tick)
  • Compact code for memory-constrained PICs

Count Modes

The counter has two modes. First is the total count. Also included is a timer to show how long the displayed count has ben running. There is also an overflow to prevent the count from rolling over.

The second is CPM. This counts the running number of counts-per-minute. There is a limit on the number of counts the counter will take due to speed limitations. If the threshhold of "reliable counts" get exceeded the counts are flagged as possble under counted.

Circuit Description

The KiCad schematic is provided in the hardware folder. A PDF version is in the Files folder. Also included is an untested PCB made from that schematic. The two diodes (D2 and D3) are optional. D2 provides input reverse polarity and a small voltage drop for counters supply voltage. My counter has a 6V battery, it is mostly OK for the 5V chip but it may be a little out of voltage spec. for some batteries. Diode D3 is to protect against the negitive part of the waveform. It is probabily not needed with the tansistor, but if you want to use the input pins of the PIC it may be useful. Typically, interrupts use RA5. I had issues using this input on my chips, the pin looked like a Low impeadence or Output Pin so I swapped to RA1. I am not sure what was going on but RA1 is typically uses as data input so since we were not usong serial input this was fine.

Hardware

Here are some features:

  • PIC12F1822 (8 MHz internal oscillator)
  • Geiger tube pulse output indicator
  • Serial LCD (2400 baud)
  • Button to toggle display modes "Total Count" and "CPM"
  • Reset Button to Zero the counts
  • A small 8x2 LCD Display to fit in counter case. (Set by software)
  • Serial input to LCD (Note: A serial "backpack" may be required)

Proto

The prototype shown here built up on a breadboard.

Pulse Input Waveform

Typical waveform from my Geiger Counter, the pulse stays active for 524uSec. This is the timeout for the counter that means the interrupt servce should be done before this time. Also note the pulse ends with a negitive drop. I added a buffer in the circuit so it should not be an issue.

Pulses can occur back to back. Shown here is an example of two close counts:

Pin Mapping

Function PIC Pin Symbol
Geiger Pulse RA1 GP2
Reset Button RA4 GP3
Mode Select RA3 GP4
LCD TX RA0 GP1

Notes

  • Configuration bits are explicitly set to avoid compiler warnings.

  • sprintf() removed to reduce RAM usage.

  • Project based on a cloned MPLAB X setup—manual setup may require recreating project structure.

  • Timer1 Configuration Notes

  • Internal oscillator set to 8 MHz via OSCCON = 0x70

  • Timer1 uses 1:64 prescaler (T1CON = 0b00110101)

  • Preload value TMR1 = 0x85BE gives 1 Hz overflow:

    • Tick rate = 2 MHz / 64 = 31,250 Hz
    • Overflow after 31,250 ticks = 1 second
  • CPM calculation now matches expected values (e.g. 1 Hz input → 60 CPM)

Files

  • geiger_counter_display.c – Main source code
  • README.md – This file

File Naming Convention

This project uses a stable filename (geiger_counter_display.c) with versioning tracked in code comments and commit history. No separate v1/v2 branches—just iterative improvements.

License

MIT license.

Built with XC8

About

This is a quick an dirty LCD display for Gieger counters to allow long term readings for low radiation levels.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages