Python code on UKRAA PicoMuon Detector’s Raspberry PI

Click on following links to download files:

https://www.astronomy.me.uk/wp-content/uploads/2026/03/UKRAA_Github_Software__PicoMuon-main-acc_300326.zip

https://www.astronomy.me.uk/wp-content/uploads/2026/03/How-to-set-up-software-UKRAA-PicoMuon-Detector-from-Github-300326.docx

https://www.astronomy.me.uk/wp-content/uploads/2026/03/UKRAA-PicoMuon_detector_Manual_ISSUE_1.1-acc_300326.pdf

https://www.astronomy.me.uk/wp-content/uploads/2026/03/UKRAA_Setting_the_PicoMuon_DS3231_rtc_instruction_V1-acc_300326.pdf

Information from Github page https://github.com/UKradioastro/UKRAA_PicoMuon 30/3/2026:

Name
N15TelescopeRemove reference to update code from READMEd6fa0ff · last month
WWWmoved id= tags9 months ago
docsChange RPi installer instruction to Trixielast month
imagesMore changes to images 🙁8 months ago
installRemoved mysql_secure_installation from install scriptlast month
scriptsRemove unused files8 months ago
LICENSEInitial commit2 years ago
README.mdRemove reference to update code from READMElast month

Repository files navigation

Python code for the UKRAA PicoMuon

License

Set of Python code to run on a RPi4/5 to get, process and present data from the UKRAA PicoMuon detector

This software was written to suit a specific set-up, feel free to use as you see fit.

Instructions for setting up a Raspberry Pi4/5 are included in the docs folder


Contents


Where is my detector

Plug your detector into any of the RPi USB ports – I normally use the blue ports (USB3).

  1. Open a terminal window and type the following command and press enter
ls /dev/tty*
img_48
  1. You are looking for /dev/ttyACM0 – this is on the right hand side of the screen shot above.
  1. This is the USB address for your attached detector – if you have more than one detector attached you may see /dev/ttyACM1 etc.
  1. If you do not see /dev/ttyACM0, then unplug and plug the detector back in and try again.
  1. As long as you see /dev/ttyACM0 then you do not have to make any changes to the python scripts, because they are looking for ACM0.

Back to Contents…


Using the code

The code assumes that your UKRAA PicoMuon detector is connected to the RPi4/5 via supplied USB cable and that it is /dev/ttyACM0 – you can check this by using ls /dev/tty* in a terminal window on the RPi4/5 and reviewing the response.

The code assumes username is pi. If pi is not the username, then you will need to change all occurances of ‘/home/pi’ to ‘/home/username‘ in the python and gnuplot scripts, where username is the username you have selected for your RPi4/5.

The code assumes one detector connected to the RPi4/5 USB and that it will be connected via /dev/ttyACM0, if there are other devices connected to the RPi and your detector is not /dev/ttyACM0, then you will need to change /dev/ttyACM0 to /dev/ttyACMx in the GetDataRawACM0.py python script, where ttyACMx is the tty address of you connected detector.

GetDataRawACM0.py is run as a service.

Other scripts (Python, gnuplot and shell) are run from cron

Back to Contents…


Getting the software onto your RPi

  1. Log into your Raspberry Pi4/5 using VNC.
  1. Open a terminal window, type the following command and press enter
git clone https://github.com/UKradioastro/UKRAA_PicoMuon
img_01

This will download all of the code to the directory UKRAA_PicoMuon inside /home/pi

Back to Contents…


Installing the software onto your RPi

  1. Open a terminal window and type the following command and press enter
cd ~/UKRAA_PicoMuon/install
img_02

This will take you to the install directory inside /home/pi/UKRAA_PicoMuon

  1. Type the following command and press enter
chmod +x *.sh
img_03

This will make the install.sh script executable.

  1. Type the following command and press enter
sudo bash install.sh
img_04

This will run the install script.

There may be occasions during the running of the install script that require you to make a keyboard entry.

When asked Do you want to continue? [Y/n] – type Y or y and press enter

That’s it!

The code is now set up to run automatically; it will get the data from the detector, process yesterdays data, plot yesterdays data and post yesterdays plots to your intranet web page once per day, at 9.30am in the morning.

Back to Contents…


What does the code do

The code receives the event data from the UKRAA PicoMuon detector via serial over the supplied USB cable and stores the event data to the raw data folder:

The raw data will be processed overnight, via CRON, to get counts per minute, the frequency of the counts per minute and the frequency of the adc values for your previous day’s data.

A number of plots will be created:

  • counts per minute
  • frequency of counts per minute
  • frequency of ADC values recorded

The raw data will also be processed overnight, via CRON, to produce % deviation of muon counts, this data is supplemented by a request to NMDB via NEST to get the previous days recorded neutron count, which will be overlaid onto the day / week / month / etc % deviation counts graphs.

These will appear as the required amount of data is recorded by the detector

A simple web server and web page is set up on your RPi so that you can view your detector’s results on your desktop PC and/or smart phone when connected to your home network.

To access the webpage on your desktop PC or your smart phone…

  1. Open your preferred web application (Safari, Chrome, Firefox, etc.).
  2. In the search bar type the following and press enter
http://rpi4-UKRAA.local

This will take you to the web page for your detector, displaying yesterday’s events graphs.

NOTE: if you have a different hostname for your RPi, change the search bar entry to…

http://hostname.local

Where hostname is the hostname for your RPi setup.

Back to Contents…


Check GetDataRawACM0 service is running

  1. To check the status of your service, type the following command and press enter.
sudo systemctl status PicoMuonACM0.service
  1. To start your service, type the following command and press enter.
sudo systemctl start PicoMuonACM0.service
  1. To stop your service, type the following command and press enter.
sudo systemctl stop PicoMuonACM0.service
  1. To enable your service, type the following command and press enter.
sudo systemctl enable PicoMuonACM0.service
  1. To disable your service, type the following command and press enter.
sudo systemctl disable PicoMuonACM0.service

Back to Contents…


License

MIT License

Copyright (c) 2024 UKRAA

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Back to Contents…


Contact us

Please send an e-mail to picomuon@ukraa.com

By Admin

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.