DIY Geiger Counter With an ESP8266 and a Touchscreen

39K26768

Intro: DIY Geiger Counter With an ESP8266 and a Touchscreen

UPDATE: NEW AND IMPROVED VERSION WITH WIFI AND OTHER ADDED FEATURES HERE

I designed and built a Geiger Counter - a device that can detect ionizing radiation and warn its user of dangerous ambient radiation levels with the all-too-familiar clicking noise. It can also be used when scouting for minerals to see if the rock you found has Uranium Ore in it!

There are many existing kits and tutorials available online to make your own Geiger Counter, but I wanted to make one that is unique - I designed a GUI display with touch controls so the information is displayed in a pretty way.

STEP 1: Basic Theory

The working principle of a Geiger Counter is simple. A thin-walled tube with a low pressure gas inside (called a Geiger-Muller Tube) is energized with a high voltage across its two electrodes. The electric field that's created is not enough to cause dielectric breakdown - so no current flows through the tube. That is until a particle or photon of ionizing radiation goes through it.

When beta or gamma radiation passes through, it can ionize some of the gas molecules inside, creating free electrons and positive ions. These particles start moving due to the presence of the electric field, and the electrons actually pick up enough speed that they end up ionizing other molecules, creating a cascade of charged particles which momentarily conduct electricity. This brief pulse of current can be detected by the circuit shown in the schematic, which can then be used to create the clicking sound, or in this case, fed to the microcontroller that can do calculations with it.

I'm using the SBM-20 Geiger tube since it is easy to find on eBay, and quite sensitive to beta and gamma radiation.

STEP 2: Parts and Construction

I used the NodeMCU board based on the ESP8266 microcontroller as the brains for this project. I wanted something that can be programmed like an Arduino but is fast enough to drive the display without too much lag.

For the high voltage supply, I used this HV DC-DC boost converter from Aliexpress to supply 400V to the Geiger tube. Just keep in mind that when testing the output voltage, you can't measure it directly with a multimeter - the impedance is too low and it will drop the voltage so the reading will be inaccurate. Create a voltage divider with at least 100 MOhms in series with the multimeter and measure the voltage that way.

The device is powered by an 18650 battery that feeds into another boost converter that supplies a constant 4.2V for the rest of the circuit.

Here are all of the components needed for the circuit:

  • SBM-20 GM tube (many sellers on eBay)
  • High Voltage Boost Converter (AliExpress)
  • Boost Converter for 4.2V (AliExpress)
  • NodeMCU esp8266 board (Amazon)
  • 2.8" SPI Touchscreen (Amazon)
  • 18650 Li-ion cell (Amazon) OR Any 3.7 V LiPo battery (500+ mAh)
  • 18650 cell holder (Amazon) Note: this battery holder turned out to be a little too big for the PCB and I had to bend the pins inward to be able to solder it. I would recommend using a smaller LiPo battery and soldering JST leads to the battery pads on the PCB instead.

Miscellaneous electronic components needed (you might have some of these already):

  • Resistors (Ohms): 330, 1K, 10K, 22K, 100K, 1.8M, 3M. Recommend getting 10M resistors for making voltage divider needed to measure high voltage output.
  • Capacitors: 220 pF
  • Transistors: 2N3904
  • LED: 3mm
  • Buzzer: Any 12-17 mm piezo buzzer
  • Fuse holder 6.5*32 (to attach Geiger tube securely)
  • Toggle switch 12 mm

Please refer to the PDF schematic in my GitHub to see where all the components go. It's usually cheaper to order these components from a bulk distributor like DigiKey or LCSC. You'll find a spreadsheet with my order list from LCSC in the GitHub page that contains most of the components shown above.

While a PCB is not needed, it can help make the circuit assembly easy and make it look neat. The Gerber files for PCB manufacturing can be found in my GitHub as well. I have made a few fixes to the PCB design since I got mine, so the additional jumpers should not be needed with the new design. This has not been tested, however.

The case is 3D printed out of PLA and the parts can be found here. I have made changes to the CAD files to reflect the drill location changes in the PCB. It should work, but please note that this has not been tested.

STEP 3: Code and UI

I used the Adafruit GFX library to create the user interface for the display. The code can be found in my GitHub account here.

The home page shows the dose rate, counts per minute, and the total accumulated dose since the device was turned on. The user can choose a slow or fast integration mode which changes the rolling sum interval to either 60 seconds or 3 seconds. The buzzer and LED can be toggled on or off individually.

There is a basic settings menu that allows the user to change the dose units, the alert threshold, and the calibration factor that relates the CPM to dose rate. All settings are saved in the EEPROM so they can be retrieved when the device is reset.

STEP 4: Testing and Conclusion

The Geiger Counter measures a click rate of 15 - 30 counts per minute from natural background radiation, which is about what's expected from an SBM-20 tube. A small sample of Uranium Ore registers as moderately radioactive, at around 400 CPM, but a thoriated lantern mantle can make it click faster than 5000 CPM when held up against the tube!

The Geiger counter draws around 180 mA at 3.7V, so a 2000 mAh battery should last around 11 hours on a charge.

I plan to properly calibrate the tube with a standard source of Cesium-137, which will make the dose readings more accurate. For future improvements, I could also add WiFi capability and data logging functionality since the ESP8266 already comes with WiFi built in.

I hope you found this project interesting! Please share your build if you end up making something similar!

50 Comments

Hi,

For everyone who doesn't want to get used to SMD components, I have implemented the PCB version from blazkowicz0 on a double-sided board and incorporated all the changes/improvements ! Should still fit into the housing used by blazkowicz0 with a 18650 LIPO ! I'm open to suggestions for improving the layout!

Regards

Hi,Very Nice project! I'd love to make one, but I don't really know how to compile this source code. I understand that you can use VSCODE to add extensions, build and upload, but I would like you to tell me more about that. Since I am a beginner. ・・・
However, when I ran it again, I was able to build and upload without difficulty. Next, I'll try the GC-20. Thank you
I have tried this circuit.

It counts twice in one pulse.
why?
I made it, working fine. Have only one issue, to connect the device to WiFi. It refuse to connect to Mikrotik routers at the same time it can connect to my mobile hotspot. At the same time all other devices can connect to Mikrotik. Tried several router settings- no success. Searching in the Internet I found some information that issue could be related to ESP WiFi manager, but so far I am unable to sort it out . Tanks for the great project !
Hi! Could you make the firmware in .bin format for nodemcu flasher? Please... I tried to compile with Visual Studio Code several times, selecting different versions of libraries, and I have a white screen, a flashing LED on the esp8266 and a bip...bip...bip... in buzzer.
Are you able to help with a modified code for this project to include Alpha detection as well? i have a new Geiger tube on its way for my mk 2 version of this project, and its an end window version that is an upgrade to the SMB-20 tube. building the physical geiger counter is easy for me but as for the code, im totally out of my depth
hello great project. what needs to be changed in the code to adapt the counter to sts-5?
Great Project ! I have problems for the code sir, there is message "Error compiling for board Generic ESP8266 Module" even I use your code. Can you tell me the problem solving sir?

Best Regards
ADJI (Indonesia)
major problems with the new pcb footprints. neither the esp8266 or the boost converter pin sizes match. the esp8266 footprints are too narrow with the pin rows being much to close together. and the boost converter is also to narrow. have not tried to add the HV boost board but think that will also have problems. the only way i can get it to work is by removing the headers and replacing them with bent wires which is going to be a real hard job.
The esp8266 nodeMCU comes in two form factors. The one I linked is the smaller one and will fit.
As for the boost converter, I didn't have much trouble fitting it in, but if it doesn't work for you, try soldering it SMD-style. Just place the boost converter over the pads on the board and flow solder into the holes. This can help when the holes are misaligned.
hello Mr, why i have this message "Error compiling for board Generic ESP8266 Module.". even I use that code?
your pcb layout is dangerous.
the HV lines are WAY too close to various other signals.
The HV supply can barely deliver a few microamps at 400V so it's not really dangerous that the lines are close to other signal lines :)
Can someone tell me how to compile and flash the code using Visual Studio Code and the platformio extension for this great project? Thank you
Ok, I've got it almost done. Two last questions...

First, for the M4 bolts, I'm assuming you threaded them thru the standoffs, thru the top cover (like a very thick washer) correct? If so, I need to get much longer bolts... and idea how long they are? (I've got some on order up to 25mm...thinking that should be sufficient...)

Second, I'm not getting any readings on initial start up. I'm not 100% sure the tube is good (have some others on the way) but what voltage do you get reading across the two leads (without tube in place?) 430V? (I'm not sure if I need to adjust the potentiometer on the boost converter...) Did you have to adjust it?
I believe the screws I used were also 25mm. For the GM tube cover, I used 8mm. All screws are threaded into brass heat-set inserts.
As for the voltage, yes, I had to adjust the potentiometer on the boost converter to get 430 volts. Please note that you can only measure the high voltage directly if you have a high-impedance meter or probe. Normal 10 M-Ohm meters will draw too much current and show a reduced voltage.
One way to measure the voltage accurately is to construct a voltage divider. To do this, connect nine 10 M resistors in series (creating a 90M resistor) and connect one end of this series to the high voltage output. Use the multimeter to measure the voltage at the other end relative to ground. The reading from the multimeter should be multiplied by 10 to get the real voltage.
Some comments now that I have most of it put together. (have a few things still do to to get it working, but hopefully this week)
1) The case side walls -- They need to be higher by at least 10 mm or maybe more. I had to trim off every piece of thru legs on the power board and it still bulges a bit in the middle. Given that will probably get warm, it definitely needs to be higher. I'd suggest you make this change for this model, in case anybody builds one.
2) The battery holder you suggested wasn't really any better than what you had (at least from the problems you described). I had to hack corners, etc. to get things to close. I'd suggest as well that you find a solution that really works (either different holder or something else) so that any other builders don't fight this. I get your problems, but there should be a workable part for this that doesn't need so much modification.
3) For the speaker, I'd suggest you spec out a specific speaker. Based on the general guidance you gave, I ordered some from Amazon and while they were correct (from the spec) I've already had 3 where wires came off. I have ordered a second type that I will have to solder on wires (which is fine, since I can probably get something stronger there). My concern is if they'll fit.
4) I'd also suggest you come up with some way to attach the speaker, maybe a change to the 3d design or something where the speaker could be held in. Maybe a ridge around the grill? Dunno. But having it float around isn't probably good (and may have also contributed to my wire problems)
5) I'd definitely list in the BOM/parts what types of screws you used (and lengths that fit). Having to make multiple orders to get the right parts tends to be disappointing and can suck the wind out of someone building something (take it from me... I've had this problem on a number of instructables... they have ended up 1/2 done because I've already ordered 3 types of part trying to have it come together)
6) DEFINITELY need a second on getting the code onto the board.
7) I'd make the bottom of the case longer than it needs to be, as it stands it very tight trying to get stuff in there. I think it would be easier if there was maybe even some air space past the end of the PCB to help in that section.
8) The holes on the bottom part of the case need to be bigger around and deeper to allow the screws to go in (or you need tp spec longer screws). I'm ordering some longer screws (I did dig out the holes with an Xacto knife to get something to work for now, but definitely needs some refining.
9) The opening for the screen needs some refining. A little too much space around the top. Maybe a bezel?
10) The upcoming design (or perhaps some mod of this, that included a battery charger is a must. Having to open/close it is a pain, esp. with the tight tolerances.

Don't mean any of these as a dig, I think you have a great project here. Really like it in general (and I may make some of those Wifi changes you suggested... will let you know and send code back to you if I do). I'd also suggest that you give the builders the notes you gave me about how to measure if power is right (I have some resistors coming tomorrow -- I have some of the right value at the office, but I'm about to travel and screwed up my ankle so haven't been in the office all week.. I'll be trying to finish things when I get up to corp HQ this next week)

Thanks again,

Earl
Last question for tonight. You didn’t indicate the kind of screws nor inserts needed for the case. Do you have pointers for those?

( I have two resistors on order before I’m done, but would like to have all the parts to finish this week )
You will need M3 countersunk screws for the housing. Everything else is printed.
Another question. Have you thought about adding one of those small battery charger boards so you could charge the battery in place? I found out the system runs fine powered via the NodeMCU board ( switch does nothing in that situation :-) )
More Comments