When all items are selected with -s A and option -d from this new version on, items are decoded and dumped to stdout en separated by end-of-line character(s).
This picture was taken on an airplane: you have more radiation (cosmic rays) at high altitude.
I figured out how to interface with this counter in Python to log real time data:
#!/usr/bin/env python
from __future__ import print_function
__description__ = "Program for geiger meter"
__author__ = 'Didier Stevens'
__version__ = '0.0.1'
__date__ = '2024/05/11'
"""
Source code put in the public domain by Didier Stevens, no Copyright
https://DidierStevens.com
Use at your own risk
History:
2024/05/11: start
Todo:
"""
import optparse
import serial
import time
def FormatTime(epoch=None):
if epoch == None:
epoch = time.time()
return '%04d%02d%02d-%02d%02d%02d' % time.localtime(epoch)[0:6]
def FindCOMPorts():
ports = []
for number in range(1, 10):
try:
comport = 'COM%d' % number
with serial.Serial(comport) as oSerial:
ports.append(comport)
except serial.serialutil.SerialException as e:
if 'PermissionError' in e.args[0]:
ports.append(comport)
return ports
def LogToCSV(comport):
ser = serial.Serial(comport, 115200, timeout=0, write_timeout=0)
ser.write(b'\xAA\x05\x0E\x01\xBE\x55\x00')
alldata = b''
fOut = open('geiger.csv', 'a')
while True:
data = ser.read(1000)
if data != b'':
alldata += data
lines = alldata.split(b'\xaaU\x0e')
alldata = lines[-1]
lines = lines[:-1]
for line in lines:
if line != b'':
out = FormatTime() + ';' + line.decode('latin')
print(out)
fOut.write(out + '\n')
if alldata.endswith(b'U') and not alldata.endswith(b'\xaaU'):
out = FormatTime() + ';' + alldata.decode('latin')
print(out)
fOut.write(out + '\n')
alldata = b''
time.sleep(0.40)
def Main():
oParser = optparse.OptionParser(usage='usage: %prog [options]\n' + __description__ , version='%prog ' + __version__)
oParser.add_option('-l', '--listports', action='store_true', default=False, help='List ports')
(options, args) = oParser.parse_args()
comports = FindCOMPorts()
if options.listports:
print('Available ports:')
for comport in comports:
print(' %s' % comport)
return
if len(args) == 1:
LogToCSV(args[0])
elif len(comports) == 1:
print('Using %s' % comports[0])
LogToCSV(comports[0])
else:
print('Provide the COM port as argument')
print('Available ports:')
for comport in comports:
print(' %s' % comport)
if __name__ == '__main__':
Main()
I have a classic wired doorbell at home: the 230V powered transformer produces 12V on its secondary winding. The circuit on that secondary winding powers an electromechanical doorbell via a pushbutton. The bell rings (“ding-dong”) when the button is pushed (closing the circuit).
Since losses occur in all transformers, I wanted to know how much my doorbell transformer consumes in standby mode (doorbell not ringing). The primary winding is always energized, as the pushbutton (normal-open switch) is on the circuit of the secondary winding.
I made the measurements on the primary winding: 3,043 Watt. That’s more than I expected, so I double-checked, and noticed I had forgotten this:
There’s a small incandescent light-bulb in the doorbell button. That consumes power too!
Second set of measurements after removing the light-bulb: 1,475 Watt.
So with light-bulb, my doorbell consumes 3 Watt 24/7, and 1,5 Watt without light-bulb.
1,5 Watt is very similar to the standby consumption of linear power supplies. As energy experts here in Europe advice to replace linear power supplies in favor of switched-mode power supplies, I wonder why they never mention doorbells … Replacing your doorbell would not be as easy as replacing a (USB) charger though (it would best be done by an electrician), so that might explain it, but on the other hand, there are enough energy experts proposing impractical solutions.
3 Watt is 26,28 kWh for a whole year. In my case, that’s a cost of €5,89 (that’s total cost: electricity plus taxes). I could reduce this by half, just by removing the incandescent light-bulb.
Should I do this? Well, the decision has already been taken for me: I dropped the light-bulb while it was still hot, and the impact broke the filament …
For comparison: 3 Watt is at least three times higher than the individual standby consumption of our appliances like TV, fridge, freezer, …
Yet another comparison: asking an LLM to write an email requires less (< 0,3 Wh) than my doorbell over a period of an hour (3 Wh).