OpenMarine

Full Version: Automation pHat as a Voltmeter?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi!
I am looking for a simple way to transmit the battery voltage with OP.

Therefore I found the "Automation pHat" https://shop.pimoroni.com/products/automation-phat.

Can this board be connected to OP show the voltage in OP?

Martin
I ordered the automation phat, and I am now trying to figure out, how to implement it in OP.

The automation phat is connected via I2C and after installing a library, the battery is connected to the analog input. It measures up to 24V directly.

The voltage is shown as follows:

value = automationhat.analog.one.read()

How could the voltage data be shown in OP? The aim is to send it via MQTT.

Martin

Edit: Just found a python example, but I need it simpler :-)

#!/usr/bin/env python




import time




import automationhat

time.sleep(0.1) # short pause after ads1015 class creation recommended







print("""

Press CTRL+C to exit.

""")




while True:

   value = automationhat.analog.one.read()

   print(value)

   time.sleep(0.25)
(2017-09-12, 09:02 AM)Alpenskipper Wrote: [ -> ]I ordered the automation phat, and I am now trying to figure out, how to implement it in OP.

The automation phat is connected via I2C and after installing a library, the battery is connected to the analog input. It measures up to 24V directly.

The voltage is shown as follows:

value = automationhat.analog.one.read()

How could the voltage data be shown in OP? The aim is to send it via MQTT.

Martin

Edit: Just found a python example, but I need it simpler :-)

It might be almost simpler already Cool

I use a ADS1115 , sort of big brother to the ASD1015 which is fitted to the automation phat, looks like it might just mean an easy edit to get the ADS1015 working. The ADS1115 works perfect with the openplotter tools menu, no need to do any python, it's been done already.  I have it going out of MQTT as well. 
Having battery voltage measured is so useful if you aren't plugged in every night Cool 

https://sailoog.gitbooks.io/openplotter-...s1115.html
Good news - I will test it this evening and report here.
Hello everybody,
I had recently also pushed something.
look here:
http://forum.openmarine.net/showthread.p...46#pid2846

perhaps this is also a possibility. I have not yet got the part yet to test it.
Greetings Jürgen
Yours is basicaly the same chip, the automation phat is ready to use, that means the voltage divider is on board.

I will report...
The automation pat looks like a useful product, I want one Smile

Sent from my SGP511 using Tapatalk
Good and bad news...

OP recognizes the automation pHat at once.
[attachment=134]

But I have no idea, how to configure...

I changes the SigK names and connected a battery with 5.18 volts to ADC 1. A voltage is measured, but far to high. The unconnected ADS2 shows 3 volts.
[attachment=136]

The openplotter_analog.conf looks like this.
[attachment=135]

The pHat already has a voltage divider integrated and can measure up to 24V directly.

Could you please help me with the .conf file?

Edit: It seems, the ADS input is measuring resistance, not volts.
Try this..

Upper_resistance =820000
Lower_resistance=120000

https://discourse-cdn-sjc1.com/business/...1e4879.PNG

Sent from my SGP511 using Tapatalk
(2017-09-13, 09:05 AM)PaddyB Wrote: [ -> ]Try this..

Upper_resistance =820000
Lower_resistance=120000

https://discourse-cdn-sjc1.com/business/...1e4879.PNG

Sent from my SGP511 using Tapatalk

Thanks for your hints!

not working Sad

[attachment=137]

With voltage divider set to "0" the voltage is 666V. I guess, there is some math with the data in the openplotter code, that does not fit the integrated voltage divider in the pHat.

When shortening ADS1 to ground, it shows 23,5V
Pages: 1 2