I have a Megamodem sending data from a PR55-5A with water level sensor attached, to an MQTT broker. The whole setup is powered by a 12v battery, which currently reads 12.82v DC with my multimeter. the 12v battery is in line between the M12 connector, and the 4-20ma sensor, and then directly connected to the barrel connector on the PR55-5A.
The values getting published to my MQTT broker show that my battery voltage is 3.162v, instead of the 12.82v I’m expecting. I’ve also tried a 5v ac adapter, and a 12v ac adapter, with similarly low voltage readings. The AA batteries are physically removed from the PR55-5A.
Here is the raw MQTT message, and my calculated voltage:
2023-06-04 17:38:42 INFO raw data: megamodem/pub1 {"data":[126,0,25,144,0,19,162,0,65,244,61,133,255,254,194,127,0,3,3,214,54,0,45,0,27,199,1,233,122]}
2023-06-04 17:38:42 INFO {"0": {"counter": 54, "sensor_ma": 4.89, "level_inches": 5.709, "level_cm": 14.5, "battery_voltage": 3.162}}
I’m using the following formula (from the user manual) to calculate voltage:
Battery Voltage=((Battery Voltage MSB x 256+Battery Voltage LSB) x 0.00322 V
And here is my actual python code doing the calculation:
battery_msb = payload['data'][18]
battery_lsb = payload['data'][19]
battery_voltage = round(((battery_msb * 256) + battery_lsb) * .00322,4)
Here is how I have the whole thing wired up: