Arduino best way to count and upload CPM?

More
3 years 8 months ago #5682 by DonZalmrol
So, I'm upgrading and updating my station and I'm trying to figure out the best way to upload my total CPM as the SI-22G are very sensitive.
e.g. SMB-20 counts +- 21 CPM for my location, while the SI-22G counts 83 CPM

Tube minimize the error rates, I now have two SI-22G tubes that are connected respectively to INT0 and INT1 on my Arduino.
The CPM math is being handled with an Arduino Moving Average Library and does the following:
  • Tube 1 counts per seconds go into an movingAverage array 1 that is 60 large (e.g counts 0-94 -> AVG = 45)
  • Tube 2 counts per seconds go into an movingAverage array 2 that is also 60 large (e.g. counts 0-87 -> AVG = 45)
  • movingAverage array 3 is 120 large and Tube 1 and 2 their CPS is added there to calculate the moving average -> 20 CPM
Why moving average? As it can store each count per second (CPS) as a value and then calculate the average of it over 60 samples (count per minute).
Then I do this for tube 1 and 2 and then recalculate it for a global moving average to got the actual CPM between two tubes.

Is my approach good or am I overthinking it and should I then simple it down?
I'll try to provide a link with my ino file for those who are interested.

Thanks!

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago - 3 years 8 months ago #5686 by mw0uzo
Looks good to me!

I remember converting CPM readings with varying sample intervals to a steady 30s interval in radlog took a bit of fiddling and checking to get right.

Yes the project files would be useful for sure - try uploading them. If there is a problem let me know and I can change settings so that it works. e.g. file size or type.
Last edit: 3 years 8 months ago by mw0uzo.

Please Log in or Create an account to join the conversation.

More
3 years 8 months ago #5688 by DonZalmrol
I think I got it, the current uploads looks similar to the background radiation of Radu from pocketmagic for his SI-22G tube.

My code: https://pastebin.com/M97sNxNX
Might needs some fine tuning.

Please Log in or Create an account to join the conversation.

Moderators: Gamma-Man
Time to create page: 0.137 seconds
Powered by Kunena Forum
Everything's free. Please support us by considering a donation. Log in first!
Solar powered Raspberry Pi 4 server stats: CPU 37% Memory 22% Swap 70% CPU temp=50.1'C Uptime 71 Days