Reef-Pi pH-ORP adapter

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
@Roberto_b i just picked up the ph board from local usps office, thank you . I’ll start working on writing driver for this for reef-pi.
13BF63CB-0E9D-4F92-8DD9-D4F89BF64450.jpeg


Couple of questions, what those two switches does? I am assuming the pins are starting from 5v on the right , and GND is on the left most pin.
The README.md on Github states following about SW1:
There is also a 2 way dip switch that offers 4 different I2C addresses, so up to 4 probes can theoretically be connected on the same I2C bus.
and
Address table, SW1 Slide 1 Slide 2 Address off off 0x40 on off 0x41 off on 0x42 on on 0x43

Testing Connect the board to RPI3, gnd (pin 39) +5V (pin 2) SDA1 (pin3) SCL1 (pin 5), be sure the address is 0x40 (SW1 off),be sure the I2C is enabled on Pi3, run i2cdetect (i2cdetect -y 1), the program must find the device at address 0x40, if not check the solder / connections

From the schematics, PCB lay-out and picture above:
Pin 2 is connected to R7 and ADM3260 SCL2
Pin 3 is connected to R8 and ADM3260 SDA2
Pin 1 is connected to C4 and ADM3260 pins 4 and 9 meaning +5V
So yes, Pin 1 is starting with +5V from the right
 
Last edited:

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
Address table, SW1 Slide 1 Slide 2 Address off off 0x40 on off 0x41 off on 0x42 on on 0x43
Reading the ADS1119 datasheet, I think there's a small mistake:
off off = 0x40 (ok)
off on = 0x41 (ok)
on off = 0x44
on on = 0x45

Roberto_b's design uses gnd and +5V for up to 4 different I2C addresses. Technically the ADS1119 also allows the use of SDA and SCL for address selection for a total of 16 different I2C addresses. As written in another thread I would prefer not to use 0x40 as default address since it conflicts with the Reef-PI standard PCA9685 (PWM module) I2C address.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Awesome. I am going through the README, I'll start updating in in the process. We have to add an opensource license as well. Do you have anything in mind? I was thinking of adding Cern OHL ,
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,123
Rating - 0%
0   0   0
@Roberto_b we need four holes for standoffs to mount the board. The one I got, I am planning to drill holes for M2.5 standoffs, I think it is safe.
I am using this board as a panel mount connector since the BNC connector has retaining nut. I just drilled a 1/2 inch hole in the enclosure, slipped the connector through, and tightened the retaining nut. Works a treat, and doesn't need to be screwed down to anything else for me.

However, drilling holes in the 4 corners would probably be fine.
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,123
Rating - 0%
0   0   0
Thank you for sharing files. Can used this shield for Arduino. Is there a code reference for Arduino. Thank you
This board can be used with Arduino. There isn't any reference code yet, but any code that can read over i2c can work with this board. I'd be willing to help if you start getting it set up on an Arduino. The more complicated part will be calibration and transforming the reading to a ph value. We're implementing that for reef-pi, so the algorithm could be a straight-forward port to Arduino once it is done,
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I am using this board as a panel mount connector since the BNC connector has retaining nut. I just drilled a 1/2 inch hole in the enclosure, slipped the connector through, and tightened the retaining nut. Works a treat, and doesn't need to be screwed down to anything else for me.

However, drilling holes in the 4 corners would probably be fine.
Agree.
I think the board could be slightly smaller as well.
I am working on the repo to clean it up little bit, I noticed the c sample code is in zip file.

Out of curiousity , how much it cost to get the parts and the PCB, without any of the soldering tools etc. atlas scientific Ezo board with isolated Bnc circuit cost around 90$
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
This board can be used with Arduino. There isn't any reference code yet, but any code that can read over i2c can work with this board. I'd be willing to help if you start getting it set up on an Arduino. The more complicated part will be calibration and transforming the reading to a ph value. We're implementing that for reef-pi, so the algorithm could be a straight-forward port to Arduino once it is done,
There’s some code in the zip file.. I’ll hack on it tonight and report back my findings
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
677
Reaction score
1,123
Rating - 0%
0   0   0
Agree.
I think the board could be slightly smaller as well.
I am working on the repo to clean it up little bit, I noticed the c sample code is in zip file.

Out of curiousity , how much it cost to get the parts and the PCB, without any of the soldering tools etc. atlas scientific Ezo board with isolated Bnc circuit cost around 90$
I built 2 of them for about $80 (including the PCB manufacturing from JLCPCB). It's tough to give a realistic estimate for a single unit since the PCBs are ordered 10 at a time (I still have 6 extras, after giving 2 away!) and the other jelly bean components are pennies if you order enough. The BOM file provides all the details needed to put an order together on Mouser or Digikey. Even with shipping, I still think these are half the price of the Ezo boards. Roberto's design is very nice and actually higher quality than the atlas scientific designs. I'm glad to be able to learn from his contributions.

I don't think the ICs are available in through hole parts, but surface mount isn't much more difficult than through hole (in some ways, it's easier since you don't have to bend leads and snip after soldering). The passives could probably be replaced with larger 1206 components without changing the board dimensions.

I assembled mine with a cheap soldering/rework station from Aoyue. I think it was about $70 when I got it a few years ago.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I built 2 of them for about $80 (including the PCB manufacturing from JLCPCB). It's tough to give a realistic estimate for a single unit since the PCBs are ordered 10 at a time (I still have 6 extras, after giving 2 away!) and the other jelly bean components are pennies if you order enough. The BOM file provides all the details needed to put an order together on Mouser or Digikey. Even with shipping, I still think these are half the price of the Ezo boards. Roberto's design is very nice and actually higher quality than the atlas scientific designs. I'm glad to be able to learn from his contributions.

I don't think the ICs are available in through hole parts, but surface mount isn't much more difficult than through hole (in some ways, it's easier since you don't have to bend leads and snip after soldering). The passives could probably be replaced with larger 1206 components without changing the board dimensions.

I assembled mine with a cheap soldering/rework station from Aoyue. I think it was about $70 when I got it a few years ago.
I am more than happy to invest in quality SMD tools for soldering/desoldering, if there through hole counter parts are not present. I would agree that having some bigger parts will be easier to deal with.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I built 2 of them for about $80 (including the PCB manufacturing from JLCPCB). It's tough to give a realistic estimate for a single unit since the PCBs are ordered 10 at a time (I still have 6 extras, after giving 2 away!) and the other jelly bean components are pennies if you order enough. The BOM file provides all the details needed to put an order together on Mouser or Digikey. Even with shipping, I still think these are half the price of the Ezo boards. Roberto's design is very nice and actually higher quality than the atlas scientific designs. I'm glad to be able to learn from his contributions.

I don't think the ICs are available in through hole parts, but surface mount isn't much more difficult than through hole (in some ways, it's easier since you don't have to bend leads and snip after soldering). The passives could probably be replaced with larger 1206 components without changing the board dimensions.

I assembled mine with a cheap soldering/rework station from Aoyue. I think it was about $70 when I got it a few years ago.
@Michael Lane, I am curious why you think this is better than AtlasScientific ? I see one advantage of being able to use the same circuit for ORP as well as pH (may be even EC or DO) and the price point. Is there anything else? Like any technically better designs etc?
 

Soulreefer

Community Member
View Badges
Joined
Aug 16, 2018
Messages
44
Reaction score
68
Location
Jakarta, Indonesia
Rating - 0%
0   0   0
This board can be used with Arduino. There isn't any reference code yet, but any code that can read over i2c can work with this board. I'd be willing to help if you start getting it set up on an Arduino. The more complicated part will be calibration and transforming the reading to a ph value. We're implementing that for reef-pi, so the algorithm could be a straight-forward port to Arduino once it is done,
Thank you Michael lane. for Quick aswer. I found this reference code https://github.com/SparkysWidgets/MinipHBFW Is this possible to be applied. Because the board is not in my hand.
Sorry if this OOT.

Very tank you.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,957
Reaction score
3,355
Location
Sacramento, CA area
Rating - 0%
0   0   0
@Michael Lane, I am curious why you think this is better than AtlasScientific ? I see one advantage of being able to use the same circuit for ORP as well as pH (may be even EC or DO) and the price point. Is there anything else? Like any technically better designs etc?

Having the ADM3260 (as far as I can tell, the same technique Atlas uses) on board is a nice touch - the errors without a floating reference are huge over the smaller ranges we usually care about.

The said, the Atlas uses an on-board PIC (onboard ADC and makes its split rail using the on board DAC). The ADS1119 is going to perform better, however its likely not going to matter much at all (and the design isn't going to extract 16 usable bits - getting this is very hard). The Atlas lets the calibration happen behind the scenes, whereas this design will just dump raw voltages values at you.

And this can be shrunk quite a bit, depending on how small of passives you would want to deal with - and the same goes for englarging it to 1206 in the same footprint. Chips like the ADM3260 (specifically the high frequency isolated power system) and the sensitive paths of the pH circuit aren't ammenable to protoboard construction, so there won't be any PTH parts. Staying away from QFN and the like makes hand soldering feasible though.
 

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Having the ADM3260 (as far as I can tell, the same technique Atlas uses) on board is a nice touch - the errors without a floating reference are huge over the smaller ranges we usually care about.

The said, the Atlas uses an on-board PIC (onboard ADC and makes its split rail using the on board DAC). The ADS1119 is going to perform better, however its likely not going to matter much at all (and the design isn't going to extract 16 usable bits - getting this is very hard). The Atlas lets the calibration happen behind the scenes, whereas this design will just dump raw voltages values at you.

And this can be shrunk quite a bit, depending on how small of passives you would want to deal with - and the same goes for englarging it to 1206 in the same footprint. Chips like the ADM3260 (specifically the high frequency isolated power system) and the sensitive paths of the pH circuit aren't ammenable to protoboard construction, so there won't be any PTH parts. Staying away from QFN and the like makes hand soldering feasible though.
Thank you :) . I am not too worried about the calibration part, it will be some computing, but we can get it done on the driver/reef-pi end. The raw voltage dump design allows us to reuse the board for ORP as well , if I understand correctly.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,957
Reaction score
3,355
Location
Sacramento, CA area
Rating - 0%
0   0   0
Thank you :) . I am not too worried about the calibration part, it will be some computing, but we can get it done on the driver/reef-pi end. The raw voltage dump design allows us to reuse the board for ORP as well , if I understand correctly.

Yup! Both pH and ORP sensors behave differently.

Conductivity is a weird one. I found a reasonable supplier for non-astronomically priced probes, but from my reading they ideally need to be driven by an H bridge lest the electrodes degrade in an ionic solution like salt water. But that’s for another thread!
 

wykat

Active Member
View Badges
Joined
May 23, 2018
Messages
182
Reaction score
421
Rating - 0%
0   0   0
Out of curiousity , how much it cost to get the parts and the PCB, without any of the soldering tools etc. atlas scientific Ezo board with isolated Bnc circuit cost around 90$

I made an excel list based on the BOM from Roberto_B and collected MPN numbers and components prices from Mouser in Euro's. See picture below:
upload_2018-11-18_8-43-40.png


Do note that the prices from Mouser are without VAT.

So there is not such a big difference in ordering components for 1 PH board or for 10 at the same time. The main price drivers are the 3 IC's and the Molex BNC connector.

The big delta lies in the PCB cost, especially shipping costs. I pay around 25Eur for 10 boards at PCBWAY, delivery normally in 5-6 days.

The ADM3260 is an expensive component with about 33% of total component costs. The ADS1119 offers 2 differential channels of which only 1 is used. With minimal additional costs (around 6 Eur for the LMP77231, Molex BNC connector, some other components and PCB space) a 2nd PH probe could be added to the PCB design.
 
Last edited:

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,058
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Roberto_b I hooked up the pH board on one of my development Pi, following is the sequence of command I am using (I have configured the pH board to use 0x44 address using the onboard address switches). Here is the run down of minimum set of things I have to do, the example is in handy i2cset, i2cget command, I'll port the equivalent in golang for reef-pi. Can you check if I am doing the right things:
  • Reset the board
Code:
i2cset -y 1 0x44 0x06
  • Configuret the board for continuous reading
Code:
i2cset -y 1 0x44 0x40 0x06
  • Start the conversion process
Code:
i2cset -y 1 0x44 0x08

  • Ask for next reading

Code:
i2cset -y 1 0x44 0x10
  • Get the next value
Code:
i2cget -y 1 0x44

Anyone in the thread who have used it sees any issue?
 
OP
OP
Roberto_b

Roberto_b

New Member
View Badges
Joined
Oct 16, 2018
Messages
19
Reaction score
50
Location
Brescia, IT
Rating - 0%
0   0   0
Yes, pinout is correct see pictures on github for your convenience, dip switch set the I2C address of the board, in order to manage up to 4 adpater on same I2C.
probaly you forget the project & description is on repository, https://github.com/reef-pi/pH-Board, if some information is missing or not clear let me know, i will provide to improve description.
 
OP
OP
Roberto_b

Roberto_b

New Member
View Badges
Joined
Oct 16, 2018
Messages
19
Reaction score
50
Location
Brescia, IT
Rating - 0%
0   0   0
I've taken some time to understand your design as it's of great interest to me. The PH measurement is on my 'next to do' list and I already have some reference designs, but since your design is specifically made for Reef-PI, this makes it even more interesting. While going through the documentation following questions came up:
- Why are 0603 components used and not 0804 or TH when possible?
- The ADS1119 allows 2 analog inputs, why is only 1 used and not optionally 2?
- Why is port 0x40 used as default? The same port is used for the PCA9685 module.
- Which PH probe are you using, would like to order one as reference
- Need the module to be placed close to the PH probe? Some probes are offered with 3 meter cable. My preference is to make a stacked PH sensor board to my Reef-PI_HAT.

Thanks for sharing your designs!

No reason to use a package istead a different size, has been a choise..
Two inputs for what ? for double probe ? ..... no particular reason
0X40 is fixed addr base for AD , can't be changed, but can be changed on PCa9685.
each pH probe with BNC connector can be used.
Probe tipically came with cable / BNC with 1mt cable, do not exceed to much with I2C cable, but i think 3mt can be ok, better if you use a shielded cable and connect one side of shield (Pi3 side) to gnd.
 
Back
Top