This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automation pHat as a Voltmeter?
#1
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
Reply
#2
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)
Reply
#3
(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
Reply
#4
Good news - I will test it this evening and report here.
Reply
#5
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
Angel  Entschuldigung für mein Englisch. Es ist "deepl.com english"
PN bitte auf german.  Big Grin
Reply
#6
Yours is basicaly the same chip, the automation phat is ready to use, that means the voltage divider is on board.

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

Sent from my SGP511 using Tapatalk
Reply
#8
Good and bad news...

OP recognizes the automation pHat at once.
   

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.
   

The openplotter_analog.conf looks like this.
   

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.
Reply
#9
Try this..

Upper_resistance =820000
Lower_resistance=120000

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

Sent from my SGP511 using Tapatalk
Reply
#10
(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

   

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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)