Connecting Geiger Counter for Arduino and Raspberry Pi to radmon.org

More
5 years 9 months ago - 5 years 9 months ago #4326 by pilovis
Just to improve the system and get notification every time the CPM reading goes above a certain limit.

I choosed to get notification by XMPP since I've got my own personal XMPP server, but you can easily change the code and get notification by SMS or/and by email.

To install a simple XMMP client on Raspberry do the following:
su - root
apt-get install sendxmpp

then create config file for sendxmpp:
su - root
echo "me@myjabberserver.com mypassword" >> ~/.sendxmpprc
chmod 700 ~/.sendxmpprc
cp -v ~/.sendxmpprc /etc/sendxmpprc
note: change "This email address is being protected from spambots. You need JavaScript enabled to view it." and "mypassword" with your credentials

Bash code modified (see previous posts):
#!/bin/bash
# send data to radmon.org and send notification for alarm state
#
# SBM-20 tube conversion factor from uSv/h to CPM
conv=361
# read last value from csv file generated by the instrument
line="$(/usr/bin/tail -n 1 /tmp/readings.csv | cut --complement -c  1-31 | cut --complement -c  9-14 | sed -e 's/,/ /g')"
# calculations to get CPM from uSv/h
line2="$(echo "$line*$conv" | bc)"
line3="$(echo $line2 | awk '{print int($1+0.5)}')"
# send data to radmon.org
user="my_radmon_username"
password="mypasswd"
exec=`wget -O /dev/null "http://radmon.org/radmon.php?function=submit&user=$user&password=$password&value=$line3&unit=CPM"`
/bin/sleep 5
##### alarm notification section #####
# notify alarm by XMPP if CPM > 75
alarm=75
if [ $line3 -gt $alarm ];
then
echo "Alarm CPM = "$line3 | sendxmpp -s hello me@myjabberserver.com
else
    echo "everything is normal" > /dev/null 2>&1;
fi;
Last edit: 5 years 9 months ago by pilovis.
The following user(s) said Thank You: mw0uzo

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

More
2 years 7 months ago - 2 years 7 months ago #6098 by pilovis
I was finally able to power the geiger dosimeter with solar cells (12V 100W+20W).

File Attachment:

File Attachment:

File Attachment:


File Attachment:
Last edit: 2 years 7 months ago by pilovis.
The following user(s) said Thank You: mw0uzo

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

Moderators: Gamma-Man
Time to create page: 0.142 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 21% Swap 70% CPU temp=48.2'C Uptime 71 Days