I followed the tutorial on this page (Build a simple radiation monitor using a Raspberry Pi, InfluxDB and Grafana - balena Blog) to build the Geiger counter web portal but I’m not getting any data on the page. I figured I might have to wait for something to start happening but it’s not happening. My GND pin is connected to pin 6, my 5V is connected to pin 2, and my VIN pin is connected to pin 7. My Geiger counter is making plenty of noise, but my gauges are always at 0 and my graphs say “No data” no matter what time scale I use.
My device summary dashboard says that all three services are running, it says my device is active.
I’ve had it running for over 30 minutes now but it’s bed time and I don’t know how to turn the sound off on the Geiger counter >< I’ll start it up again tomorrow and hopefully i’ll see a change.
Hey there @dkallen78 congrats on getting the project built and running - you might need to either wait longer or change the scale on the Grafana dashboard to something a lot lower, i.e. 5 minutes.
What you could also consider, if this still isn’t working, is adding some kind of log output to the Python script here, which would then allow you to tell if the pulses from the geiger counter are at least getting through. Maybe something like print(text_count) seeing as that should already be a string with the number of counts in.
Thanks for the reply Chris. How would I go about inserting that code and how would I go about monitoring the output? Is this as simple as hooking up a monitor and keyboard to my Pi?
Hello @dkallen78 if you add a print there, the log output might appear in the Logs on balenaCloud, so you wouldn’t need a new monitor and keyboard.
To insert the code, clone the repo on your computer, install balena CLI and run balena push <name of your fleet> to deploy it. Let us know if you need more help!
okay, I’m not sure if I did everything correctly but I’m getting the same output as before, 0 on the gauges no activity on the graphs with 5 min/5 s resolution. I don’t see anything new in the logs, it’s all from influxdb and looks like this:
I thought I redid everything with the new forked repo with the new line but I’m not sure how to check that from the dashboard. What might be a good next step?
okay, it says my release is from last night, and not the one I did 15 minutes ago, so, pretending I’m a caveman who has never used balenaCloud before, how can I update this one line of code?
Okay, I figured out that balena push only works from the directory in which you cloned the repo, and now I’m seeing the output. The counter isn’t incrementing so my next step would be to see if the Geiger counter is outputting any signal or if the gpio is wonky. My money is on the cheap chinese geiger counter but given the other two pins work I’m still unsure… any recommendations? maybe I can change the pin it’s listening on?
Added the line print(“detected”) inside the countme function of the counter.py and my logs are quiet again, so i’m going to fiddle with my jumper cables… nope. Switched in a new female-to-female jumper and still no luck. Going to reassign to another pin and see if that helps.
I’m not sure if I’m using my multimeter right but when I put the red probe on the VIN pin and the black probe on the GND pin I get a near constant 4.88 V out. It will drop down to 1.something sometimes but I don’t see a change that corresponds with the clicks. So I’m guessing it’s a flaw with my board? Any ideas?
edit: it seems like there might be a voltage drop when a bunch of clicks come through at once
edit2: no voltage drop, I just don’t have steady hands, so I guess that’s the problem but I don’t know where to go from here…
I put in a print(GPIO.input(7)) command in the while loop to see if there was any change input signal and it just stays at 1, even if I trigger the clicks. the back of the board is a little funky though so hopefully it’s not damaged but I wouldn’t know how to tell. Any ideas @mpous or @chrisys ?
I have leveled up my multimeter game to level 2. So, after being more careful, I could discern that there wasn’t a drop in voltage when I got a click. I followed the calibration instructions I found here (Geiger-Counter-RadiationD-v1.1-CAJOE-/En_Calibration_GMv1.1.pdf at master · SensorsIot/Geiger-Counter-RadiationD-v1.1-CAJOE- · GitHub) but I’m still getting the same output so that wasn’t the issue either. When I check the signal out of the VIN pin with a multimeter I get a consistent 4.88 V so maybe the problem is somewhere between the clicks and the pin? I’m not sure how to check that.
Did you try putting print(text_count) in like I suggested? This would go on line 95 of the code as it is in the repo (obviously if you’ve changed yours the line numbers would be different).
After that what I would suggest is ruling out the geiger counter board entirely - you should be able to make the counter increment just by grounding pin 7. You would ‘pull it up’ with something like a 10K resistor to 5V, and then ground it by connecting it directly to zero volts.
Like this:
+5V
|
|
10K resistor
|
|
+-------> To Raspberry Pi GPIO Pin 7
|
\
\ Disconnected Wire - touch to ground to generate pulse
\
|
GND
Okay, I didn’t do what you suggested because I had a hunch before I went to bed last night. I saw a Reddit post where someone had an issue getting this project to work on their RPiZero and I thought that maybe there’s an issue with using a Raspberry Pi 5, like maybe they changed something and this code/project from 2020 might be optimized for an older Pi, so I added a RPi3B+ to my fleet and it works. So, I have no clue why it wouldn’t work on the RPi5, but it doesn’t out of the box. I don’t have an RPi4 to test so I don’t know which devices it will work with but 3B+ works for sure.
All that work just to find out I need to switch my Pi ><
Thanks for putting up with my ramblings, and at least I learned how to use my multimeter