Maker.io main logo

Making a Desktop Geiger Counter with Unihiker

2023-10-11 | By DFRobot

License: Attribution Non-Commercial No Derivatives Single Board Computers

 

 

Making a Desktop Geiger Counter with Unihiker --- Real-Time Nuclear Radiation Monitoring

I. Introduction

Radiation monitoring is super important these days. It's not just about health and safety - it also reveals some fascinating mysteries of science! Nuclear radiation refers to particles or electromagnetic waves given off by radioactive stuff. There are three types: alpha, beta, and gamma radiation. These radiations are part of our daily lives, with uses in medical diagnostics, energy production, and irradiating food. However, they also pose some risks. Understanding how these radiations work and safe levels of exposure can help us manage potential dangers better.

I had the idea to use a Unihiker to make a desktop Geiger counter. Basically, it's a device to detects the intensity of ionizing radiation. A typical Geiger counter has a sealed inflated tube and display that counts detected particles over time. I'll share how I DIY'ed the Geiger counter, to help with checking radiation levels in daily life.

1

1. Hardware Selection

2

HARDWARE LIST
1Unihiker
1Geiger Counter Module
1DHT20 Temperature & Humidity Sensor
1U-Shaped Male to Female Type C Extension Cord
2. Wiring Diagram
- Connect the Geiger counter module to Pin 23 of the UniHiker board
- Connect the DHT20 temperature and humidity sensor to the I2C interface of the UniHiker board
 
3
 
4
 
3. Print 3D Shell

 3D files download here: https://www.thingiverse.com/thing:6224720/files

1

11

III. Principle of Geiger Counter1. How to measure radiation?

Let me explain the working principle of a Geiger counter. A Geiger counter is a gas-discharge detector filled with easily ionized gas. When radiation enters the tube, it causes gas ionization and generates current pulses. These pulse signals are amplified and become counting pulses. We just need to count the number of pulses per unit time to directly calculate the radiation level. Compared to other detectors, the biggest advantage of a Geiger-Müller tube is its digital output signal, which allows precise radiation counting without complex analog circuits. So, by counting the radiation particles passing through the gas tube per minute, we can determine the radiation level of the current environment. 

1

1

2. How to calculate radiation levels?

There are three key units: CPM, millisieverts (mSv/h), and microsieverts (μSv/h). CPM (Counts Per Minute) is a unit of measurement for radiation levels, in counts/minute. It represents the number of times radiation particles hit the detector in one minute. Radiation levels can be measured using the equilibrium dose rate per hour: (Sv/h), millisieverts (mSv/h), and microsieverts (μSv/h). The conversion formula is: 151CPM = 1μSv/h1Sv/h = 1000mSv/h = 1000000μSv/h

 3. How to evaluate and quantify radiation levels?

The "Basic Standards for Radiation Health Protection" states that the annual dose equivalent limit for individual public exposure is: whole-body uniform irradiation not exceeding 5mSv; any single tissue/organ not exceeding 50mSv; the annual whole-body dose equivalent limit throughout life should not exceed 1mSv.The standard for indoor nuclear radiation dose is 0.5μSV/h. Based on the annual public radiation dose limit of 5mSv/h, and calculating with 365*24 hours, the dose rate should not exceed 0.5μSv/h, which is considered normal. Generally, the normal indoor radiation dose rate is below 0.20μSv/h, mostly around 0.13. However, radiation levels in bathrooms and kitchens tend to be higher. 

III. Program Editing1. Use Python to calculate μSv/h

Calculate how many times the pin interrupt is triggered in a time interval (count) to determine how many radiation particles passed through. Here we first set it to calculate every 5 seconds (time_gap). Then use 60 seconds/5 seconds * particles passed to calculate particles per minute (cpm). Since 151CPM = 1μSv/h, we can derive the μSv/h value.

2. Load the pinpong library to control the Geiger counter in Python.

Load the GUI library to display numbers on the screen.Connect the sensor to pin p23 as signal input. 

import timefrom pinpong.board import Board,Pin Board("unihiker").begin() from unihiker import GUI gui=GUI() btn = Pin(Pin.P23, Pin.IN)

Copy Code
import time
from pinpong.board import Board,Pin

Board("unihiker").begin()
from unihiker import GUI
gui=GUI()
btn = Pin(Pin.P23, Pin.IN)

3. Set variables and functions:

- time_gap: time interval between calculating μSv/h values

- start_time: time when counting starts

- count: number of particles passed

- time_gap: time interval between calculations

- uSvh: final calculated radiation value

- Define zero function to set start time and reset count to zero

- Define interrupt function, increment particle count by 1 on falling edge

- Define get_cpm function to calculate usvh value 

Copy Code
time_gap = 0
start_time = 0
count = 0
time_gap = 5
uSvh = 0

def zero():
global start_time,count
start_time = time.time()
count = 0

def btn_falling_handler(pin):
global count
count += 1

zero()
btn.irq(trigger=Pin.IRQ_FALLING, handler=btn_falling_handler)

def get_cpm():
global uSvh
if time.time() - start_time >= time_gap:
uSvh = round((count/151)*(60/time_gap),2)
print("uSvh=",uSvh)
zero()
4. Display on Screen

- Display the current radiation value in 150*90 pixel black font size 20

- Call get_cpm function and update the text on display 

Copy Code
dig = gui.draw_digit(x=150, y=90, text=uSvh, origin = "center",color="black",font_size=20,angle=90)

while True:
#start()
time.sleep(1)
get_cpm()
dig.config(text=uSvh)
 
5. Complete Code
1
 
Copy Code
import time
from pinpong.board import Board,Pin

Board("unihiker").begin()
from unihiker import GUI
gui=GUI()
btn = Pin(Pin.P23, Pin.IN)

time_gap = 0
start_time = 0
count = 0
time_gap = 5
uSvh = 0

def zero():
global start_time,count
start_time = time.time()
count = 0

def btn_falling_handler(pin):
global count
count += 1

zero()
btn.irq(trigger=Pin.IRQ_FALLING, handler=btn_falling_handler)

def get_cpm():
global uSvh
if time.time() - start_time >= time_gap:
uSvh = round((count/151)*(60/time_gap),2)
print("uSvh=",uSvh)
zero()

dig = gui.draw_digit(x=150, y=90, text=uSvh, origin = "center",color="black",font_size=20,angle=90)

while True:
#start()
time.sleep(1)
get_cpm()
dig.config(text=uSvh)
4. Display Optimization

Now the radiation value is displayed, but the screen looks a bit plain. We can try adding a temperature and humidity sensor, showing temperature, humidity, real-time date/time info, and a line chart of radiation value changes. When the radiation exceeds 0.5μSvh, the UniHiker board beeps and the value turns red.

1
 
HARDWARE LIST
1DHT20 Temperature & Humidity Sensor
制造商零件编号 DFR0706-EN
UNIHIKER IOT PROGRAMMING SBC
DFRobot
¥691.91
Details
制造商零件编号 SEN0463
GRAVITY: GEIGER COUNTER MODULE I
DFRobot
¥505.55
Details
制造商零件编号 SEN0497
GRAVITY DHT20 TEMP HUMIDITY
DFRobot
¥64.31
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum