PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)

More
9 years 3 weeks ago #981 by switchingpower
Can someone help me with interfacing my counter (based on SBM19 tube) to a GPIO pin on the Pi. My counter supplies a 0-3V square wave pulse ( so compatible with Pi logic levels). I'm a hardware engineer so can provide any required signal conditioning. Not sure if a build of PyRadMon already has this capability - thanks for any help. Looking forward to getting on the network. :)
Thanks

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

More
9 years 3 weeks ago #985 by ThibmoRozier

Can someone help me with interfacing my counter (based on SBM19 tube) to a GPIO pin on the Pi. My counter supplies a 0-3V square wave pulse ( so compatible with Pi logic levels). I'm a hardware engineer so can provide any required signal conditioning. Not sure if a build of PyRadMon already has this capability - thanks for any help. Looking forward to getting on the network. :)
Thanks

Actually not..
PyRadmon is a piece of code that handles the serial input from a usb interface and translates the hexadecimal values to integers before uploading it to radmon.org
for that we would need to re-create a full application specific code that handles the counts the pulses on a gpio pin.
Could be possible, just haven't had a chance to properly test this scenario.
And I thought gpio(x, high) was 5v?
Does the counter only give the feedback on a binary level {0/1} or does it change the voltage according to the reading?
If it is a binary system I could fiddle around with it, if not you'd need a firmware expert.:/

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

More
9 years 3 weeks ago #987 by mw0uzo
I think it might work ... take the audio code, strip out the buffer stuff and use the gpio as the detect event. Or maybe butcher the audio code and shoehorn in the gpio event. Lots of this type of stuff goes on in RadLog. Imagine the pulse detection code... but worse :lol:

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

More
9 years 3 weeks ago - 9 years 3 weeks ago #995 by Vinkx
Don't connect 5 V to the PI GPIO pins , you will have a burned PI.

I just made a test script in python 2 on a raspbery PI 2
It counts for one minute and then prints out the CPM
I tested it with a button hooked up from the 3.3V pin to the GPIO 17 pin .

If this works for you then its trivial to send the CPM to radmon.org after the count.
Or you can count longer and the divide the result by the number of minutes counted if you do not want to send every minute.

you also might want to reduce or remove the bouncetime , its there to prevent button bounce effects.

#!/usr/bin/env python

import time
import RPi.GPIO as GPIO

cpm = 0


# handle the button event
def pulseEventHandler (pin):
    print "I just saw a pulse ...."
    global cpm
    cpm=cpm+1


# main function
def main():

    # tell the GPIO module that we want to use 
    # the chip's pin numbering scheme
    GPIO.setmode(GPIO.BCM)

    # setup pin 17 as an input and pull it down
    GPIO.setup(17,GPIO.IN,pull_up_down = GPIO.PUD_DOWN)

    # tell the GPIO library to look out for an 
    # event on pin 17 and deal with it by calling 
    # the EventHandler function
    GPIO.add_event_detect(17,GPIO.RISING,callback=pulseEventHandler,bouncetime=500)

    # main loop
    global cpm
    while True:
        cpm=0
        print "i started counting , i will let you know in 1 minute"
        time.sleep(60)
        print "cpm =",cpm
      

    GPIO.cleanup()



if __name__=="__main__":
    main()



Last edit: 9 years 3 weeks ago by Vinkx.

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

More
9 years 3 weeks ago #996 by ThibmoRozier

Don't connect 5 V to the PI GPIO pins , you will have a burned PI.

I just made a test script in python 2 on a raspbery PI 2
It counts for one minute and then prints out the CPM
I tested it with a button hooked up from the 3.3V pin to the GPIO 17 pin .

If this works for you then its trivial to send the CPM to radmon.org after the count.
Or you can count longer and the divide the result by the number of minutes counted if you do not want to send every minute.

you also might want to reduce or remove the bouncetime , its there to prevent button bounce effects.

#!/usr/bin/env python

import time
import RPi.GPIO as GPIO

cpm = 0


# handle the button event
def pulseEventHandler (pin):
    print "I just saw a pulse ...."
    global cpm
    cpm=cpm+1


# main function
def main():

    # tell the GPIO module that we want to use 
    # the chip's pin numbering scheme
    GPIO.setmode(GPIO.BCM)

    # setup pin 17 as an input and pull it down
    GPIO.setup(17,GPIO.IN,pull_up_down = GPIO.PUD_DOWN)

    # tell the GPIO library to look out for an 
    # event on pin 17 and deal with it by calling 
    # the EventHandler function
    GPIO.add_event_detect(17,GPIO.RISING,callback=pulseEventHandler,bouncetime=500)

    # main loop
    global cpm
    while True:
        cpm=0
        print "i started counting , i will let you know in 1 minute"
        time.sleep(60)
        print "cpm =",cpm
      

    GPIO.cleanup()



if __name__=="__main__":
    main()




If this works you could combine it with the web part I made, or I could include it, perhaps into a special gpio pi edition.
Let us know, You have my permission to fiddle around with the web class, as long as it stays within Radmon.org and it has the license comments in it, referring to PyRadmon, as stated in the original license agreements. :)
If you need help just give me a shout, sorry about the bad commenting job within the script, it's to force away stuff like unwanted forking. ;)

Let's hope it works. :D

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

More
8 years 11 months ago #1144 by tcall
Hi,
I ran my system fine for a few months with no problem but recently started getting "Error communicating with server gieiger 1
Errorno --3 Temp Failure in Name Res

I used to get this when first switching on, but it usually cleared after a few tries. Has anyone any ideas please?

Regards,

Paul

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

Moderators: Gamma-Man
Time to create page: 0.262 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 58% Memory 14% Swap 16% CPU temp=57.9'C Uptime 47 Days