GithubHelp home page GithubHelp logo

grillbaer / esp32-geiger-counter Goto Github PK

View Code? Open in Web Editor NEW
41.0 3.0 4.0 1.43 MB

IoT Geiger Counter with ESP32, OLED Display, Thingspeak Channel and MQTT

License: MIT License

C++ 84.64% C 15.36%
geiger-counter geiger-muller esp32 geiger thingspeak iot-geiger-counter radioactivity-level radioactivity sievert mqtt

esp32-geiger-counter's Introduction

PlatformIO CI Build Status

IoT Geiger Counter with ESP32, OLED Display, Thingspeak Channel and MQTT

  • Measures radioactive gamma and beta radiation with quite good resolution at the typical low levels of the natural radiation (due to the big STS-6 tube)
  • Displays the current counts per minute (CPM), estimated dose equivalent rate in micro-Sievert per hour (µS/h) and 10 minutes history with 5 second resolution as bargraph Circuit Board
  • Low-power mode for use with batteries, OLED display and click sounds on, WiFi off
  • WiFi mode for

Feel free to use this project as a base for your own projects AT YOUR OWN RISK!

Hardware

  • Russian Geiger counter tube STS-6 (CTC-6) at 400 V with ~5 MΩ series resistor
  • High voltage circuit from ArnoR at mikrocontroller.net https://www.mikrocontroller.net/topic/380666, schematic https://www.mikrocontroller.net/attachment/273334/HystereseStepUpTLC555-2.png. Keep the high-voltage capacitor small to avoid dangerous charges! For safety avoid any contact with the high voltage parts!
  • ~400 µs pulse generation using Geiger tube series resistors as voltage divider, high impedance input to darlington transistor and TLC 555 timer for rectangle pulse generation (schematic and pulses see below)
  • ESP32 board EzSBC ESP32-01
  • OLED 128x64 with controller SH1106 at I2C
  • Voltage supply from either USB or power supply or 3x 1.5V AAA batteries, circuit works stable from 3.0 V up to 5.0 V
  • Pulse input is expected at GPIO 15 (high pulses with at least about 250 µs length)
  • Switch for WiFi mode is expected at GPIO 4 (low=WiFi mode, high=low-power mode)
  • OLED I2C bus is expected at GPIO 22 (SCK) and 21 (SDA)
  • Pins may be adjusted in main.cpp

Software

  • PlatformIO VSCode project using Arduino library, Espressif ESP-IDF for sleep functions, U8g2 for display output and Arduino-MQTT.
  • Low-power mode uses light sleep, a wake-up for each signal pulse change and a wake-up every 1000 ms to update pulse statistics and OLED. This results in about 90% sleep. Could be improved using deep sleep and ULP. However, light sleep is already quite good and much easier.
  • WiFi mode uses no sleep and simple interrupts for pulse counting. Pulse statistics and OLED are updated every 1000 ms, data is sent to thingspeak every 60 s.
  • Credentials, addresses and user for WiFi, thingspeak channel and mqtt broker are declared in credentials.h and replaced by dummy values in credentials.cpp by default. Define your real secrets in a sibling file named secret_credentials.h (do never commit!). It will be automatically included by credentials.cpp if it exists. You may copy TEMPLATE_secret_credentials.h as a starting point.

MQTT Message Format

Published messages have the following JSON format:

{
  "pulses": 69,
  "cpm": 69,
  "uSph": 0.08,
  "secs": 60
}

Geiger Tube Pulse Forming

Pulse forming schematic

The 5.4 MΩ series resistor is split up to reduce the voltage on each of them. The diode partially removes the noise spikes from the high voltage circuit.

This is the raw pulse at point A, about 2 V for less than 100 µs, then falling back to 0 V in the next several 100 µs. Remainings of the little noise spikes are still visible:

Raw pulse at point A

This is the formed pulse at point B, from 5 V to about 0.5 V for 200 µs:

Formed pulse at output point B

It is then fed into a 555 timer to further extend its duration for the ESP32 wake-up from low-power mode.

Schematic

KiCad files are located in folder hardware. Currently only schematic, no PCB.

Schematics

esp32-geiger-counter's People

Contributors

grillbaer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

esp32-geiger-counter's Issues

WiFi connect fails permanently after a few weeks or months of operation

Every few months the WiFi connection stops working and then fails permanently. Reset or power off do not help. Only erasing the ESP32 flash with ESP32 tools plus re-flashing the software makes it work again.

Connection status is WL_DISCONNECTED 6.

=> Check which information ESP32 FW, WiFiClient and WiFiClientSecure store in flash. Try to reset it automatically upon connection failures.

Diode and inductor.

Hello. I am looking for the 200v and 500mw zener diodes of the BZX79C200 model that appears in the diagram, but it is difficult for me to get it, can you recommend another 200v zener model, the 10mH inductor cannot be found either. Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.