Reef-pi + Arduino

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
Hi all,

I am in the process of crashing my first Aquarium controller. I have ordered a few parts and have a few Arduino laying around too. Reef-Pi is my preferred route although I am more experienced with the Arduinos and the C programming than Python.

I have a case for the pi4b which has a screen but instead of using the display port it is using the GPIO pins which is actually a big issue for the project as covers most of the pins including the ones used for i2C and this is taking me to my question.

What is left is the last 2*7pin at the end of GPIO.

I can hack the display to get connection to the I2C pins however this is not what I would prefer or connect a device via usb that than can act as I2C. Hub. Arduino would make perfect sense as a nano would give me several ports I2C and more not to mention with little programming a better timer than than the PI’s.

The big question is if anyone went down this route?
What is your opinion on the idea altogether?

It is also an option to have USB to I2C adapter but if I go USB that doesn’t make much sense as those cost 2-3 times of a Nano. (Not original of course)

Any input appreciated.
 

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
Not that im aware of. reef-pi is written in go and react/javascript and needs a full computer with linux userland, hence it wont run on arduiono. You dont need i2c for power, temperature, ato and two channel pwm , so those cane still be done
 
Upvote 0

MattW33

Community Member
View Badges
Joined
Aug 19, 2020
Messages
40
Reaction score
37
Location
UK
Rating - 0%
0   0   0
I had a go at this when I set up a pi based controller. I hadn't realised how extensive the reef pi thread on here is, and in hindsight I'd probably just have used that. However, I do like a challenge and it was a way for me to pick some basic coding up again.

I had the pi set up as a screen, with a usb to the arduino in the sump area. The pH, salinity and ORP probes were on the analogue arduino pins. I had a couple of temp probes on there too.
The main challenge (for me) was working out how best to get the parameters to display as a string on the bus read and coding the pi to convert these into numbers on the gui.

The arduino pi connection worked well, but in the end I just found that I didn't really needs the probes so I scrapped the arduino part and just used the pi as a light controller.
 
Upvote 0
OP
OP
attiland

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
Not that im aware of. reef-pi is written in go and react/javascript and needs a full computer with linux userland, hence it wont run on arduiono. You dont need i2c for power, temperature, ato and two channel pwm , so those cane still be done
I think you have misunderstood what the Arduino would do in this scenario.
I am thinking of using a as a port extender as with the screen I have important pins are already used.
 
Upvote 0

MattW33

Community Member
View Badges
Joined
Aug 19, 2020
Messages
40
Reaction score
37
Location
UK
Rating - 0%
0   0   0
I think you have misunderstood what the Arduino would do in this scenario.
I am thinking of using a as a port extender as with the screen I have important pins are already used.
100‰ should have read your post properly

It's not something I tried to do as I had different needs, so I'll bow out!
 
Upvote 0
OP
OP
attiland

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
I had a go at this when I set up a pi based controller. I hadn't realised how extensive the reef pi thread on here is, and in hindsight I'd probably just have used that. However, I do like a challenge and it was a way for me to pick some basic coding up again.

I had the pi set up as a screen, with a usb to the arduino in the sump area. The pH, salinity and ORP probes were on the analogue arduino pins. I had a couple of temp probes on there too.
The main challenge (for me) was working out how best to get the parameters to display as a string on the bus read and coding the pi to convert these into numbers on the gui.

The arduino pi connection worked well, but in the end I just found that I didn't really needs the probes so I scrapped the arduino part and just used the pi as a light controller.
Thank you. My plan is to use a few thing won’t be available without i2c and since access to it is blocked by the screen I have limited options and most importantly I want a constant displayed information about things. I may however end up changing the screen to display port one.
I2C would be used for RTC, PWM port extender, Humidity measure,
For ph you need only genetic port which I have 14 left even with the screen
 
Upvote 0
OP
OP
attiland

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
100‰ should have read your post properly

It's not something I tried to do as I had different needs, so I'll bow out!
Thank you for trying anyway. I struggle to find some of the info re reef-pi. I think next step for the developers would need to be able to o start to build documentation / wiki ;)
 
Upvote 0

MattW33

Community Member
View Badges
Joined
Aug 19, 2020
Messages
40
Reaction score
37
Location
UK
Rating - 0%
0   0   0
Thank you. My plan is to use a few thing won’t be available without i2c and since access to it is blocked by the screen I have limited options and most importantly I want a constant displayed information about things. I may however end up changing the screen to display port one.
I2C would be used for RTC, PWM port extender, Humidity measure,
For ph you need only genetic port which I have 14 left even with the screen

Pretty sure I was asleep yesterday when I was responding to this thread o_O, I think the Arduino can handle all the functions you'd want from the I2C. The serial communication between the two worked well for me, but it was definitely more of a faff than just using the Pi. So I suppose my opinion is that the path of least resistance would be a display that uses the display port on the pi, leaving you the I2C free. But if cost is an issue then definitely have a go at using the Arduino as a port extender of sorts. Do you have a plan for getting the arduino data from the serial output to a useful readout format? Do you have a gui format in mind?
 
Upvote 0

elysics

Valuable Member
View Badges
Joined
Jan 15, 2020
Messages
1,520
Reaction score
1,511
Rating - 0%
0   0   0
Im not sure about integration with reef pi, but you can definitely set the Pi up to use other pins for i2c instead of the standard ones

With

dtoverlay=i2c-gpio,i2c_gpio_sda=5,i2c_gpio_scl=6

In /boot/config.txt

And replace the 5 and the 6 with the pins you want to use
 
Upvote 0
OP
OP
attiland

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
Pretty sure I was asleep yesterday when I was responding to this thread o_O, I think the Arduino can handle all the functions you'd want from the I2C. The serial communication between the two worked well for me, but it was definitely more of a faff than just using the Pi. So I suppose my opinion is that the path of least resistance would be a display that uses the display port on the pi, leaving you the I2C free. But if cost is an issue then definitely have a go at using the Arduino as a port extender of sorts. Do you have a plan for getting the arduino data from the serial output to a useful readout format? Do you have a gui format in mind?
As per cost an Arduino nano clone is about £1 a usb to i2c £3-4.

The plan is just set up a script for serial communications something like send request to Aquino via serial something like the below
Q - query
S - set

If port 15 is a ph and 5 is a on/of switch
Send Q15
Send S5-1
The response would be status of port 15 something like P15-8.2 or P5-1

In this plan Arduino would handle all reading/writing to it’s pins. I haven’t look around yet but sure I don’t have to write it from scratch.
On the PI end I would write the statuses to a file(s)

Plan b is using MQTT and a wifi. The advantage of this would be not to have set up a new protocol for myself.

GUI? Unlikely reef-pi should handle that. I am not familiar with reef-pi yet so wait and see. Unfortunately the lack of documentation is a killer of the platform.
 
Upvote 0
OP
OP
attiland

attiland

2500 Club Member
View Badges
Joined
Jul 22, 2020
Messages
2,594
Reaction score
4,800
Location
United Kingdom
Rating - 0%
0   0   0
Im not sure about integration with reef pi, but you can definitely set the Pi up to use other pins for i2c instead of the standard ones

With

dtoverlay=i2c-gpio,i2c_gpio_sda=5,i2c_gpio_scl=6

In /boot/config.txt

And replace the 5 and the 6 with the pins you want to use

Now we are talking as long as I can have more than 1 I2C.

I am more an Arduino guy than PI. Can’t wait to able to test this
 
Upvote 0
Back
Top