reef-pi :: An opensource reef tank controller based on Raspberry Pi.

sellereef

New Member
View Badges
Joined
Sep 28, 2020
Messages
4
Reaction score
2
Location
Grand Rapids
Rating - 0%
0   0   0
Has anyone setup reef-pi light controller for Mars Aqua? I am reading some things now that looks like I may need an additional converter to be able to use PWM?

Thank you!
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
90
Reaction score
73
Location
Parma, Italy
Rating - 0%
0   0   0
Im workin today so keep in mind ill respond as I can.

First off, those relay boards require 15-20ma Per channel to switch on and off, the pi can source or sink 16ma per gpio pin and only a total of 50ma for the whole pi, which is why you need to use an uln2803. 8 relays x 20ma each is 160ma with all relays on.

The uln2803 is an 8 channel transistor chip. The pi turns on the 2803, which can handle the current of the relay board much better.

This leads me to another thing. Those relay boards work by supplying VCC to the opticals and each relay input is actually sinking current to ground to turn the opticals on.

Id suggest using a uln2803 between the pi and relay board. Roll your own on a breadboard, or get one of the fantastic hats with one built in.

15-20 ma per channel? even if they have optocoupler on-board? ... ok ill'try the uln2803 .. i don't find the hat on amazon.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
15-20 ma per channel? even if they have optocoupler on-board? ... ok ill'try the uln2803 .. i don't find the hat on amazon.
Yes even with the octocouplers...there are several reef pi specific hats that have the uln onboard...wont find them on amazon.

@Michael Lane sells a nice goby hat on tindie
@robsworld78 sells nice hat type boards
@theatrus sells his pico board

Forgive me if i forgot anyone.

Anyways they make for a cleaner install and are big time savers.
 

Zippyfear

Community Member
View Badges
Joined
Apr 30, 2019
Messages
86
Reaction score
150
Rating - 0%
0   0   0
Yes even with the octocouplers...there are several reef pi specific hats that have the uln onboard...wont find them on amazon.

@Michael Lane sells a nice goby hat on tindie
@robsworld78 sells nice hat type boards
@theatrus sells his pico board

Forgive me if i forgot anyone.

Anyways they make for a cleaner install and are big time savers.

Also Brandon with Leviathan
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
15-20 ma per channel? even if they have optocoupler on-board? ... ok ill'try the uln2803 .. i don't find the hat on amazon.

Optocouplers are.. an LED and a photo sensor potted together in a small box, so its quite normal. Usually the optocouplers can run down to about 5mA, it all depends on the part they specced.

To be honest I'm not sure why they add optocouplers to a relay board, unless they're scared of the quality of relay they provide. If you just power both sides of the optocoupler with the same supply there is no isolation or other gain.
 

92Miata

Valuable Member
View Badges
Joined
Feb 26, 2020
Messages
1,523
Reaction score
2,358
Location
Richmond, VA
Rating - 0%
0   0   0
I think this is something different. I did a quick search and see lots of connection issues for various reasons, one common was wifi issues. If you use wifi I would try a hard wire connection and if you have an extra SD card maybe load the Raspberry Pi OS as it won't be a problem now.


I did some digging through the syslogs and found a basic pattern - I'd stop seeing API requests, then about 5-10 minutes later it would log a carrier lost, and then unregister everything and reconnect - so I think the problem was that it was dropping off the wifi and not realizing it. I'm not sure if my crappy wifi router is dropping the connection, or if the pi is.


Anyways - I put a script in that basically scans for wifi networks every 2 minutes and then pings the router - and its been up for 12 hours now.


Got pH and temp logging and alerts set up. Knocked the temp probe out this morning and started getting text messages. They're false alarms, but cool to see.

Gonna give it a couple days and make sure it stays up - and if it does I'll start moving my less vital stuff onto it first.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
I did some digging through the syslogs and found a basic pattern - I'd stop seeing API requests, then about 5-10 minutes later it would log a carrier lost, and then unregister everything and reconnect - so I think the problem was that it was dropping off the wifi and not realizing it. I'm not sure if my crappy wifi router is dropping the connection, or if the pi is.


Anyways - I put a script in that basically scans for wifi networks every 2 minutes and then pings the router - and its been up for 12 hours now.


Got pH and temp logging and alerts set up. Knocked the temp probe out this morning and started getting text messages. They're false alarms, but cool to see.

Gonna give it a couple days and make sure it stays up - and if it does I'll start moving my less vital stuff onto it first.
I use a pi zero w, never had a wifi issue, but i have a good wifi router. I did make sure the pi was not in a metal enclosure which would block signal.

Is your stand , enclosure or the combo causimg wifi signal to the pi to be weak perhaps?
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,189
Reaction score
2,811
Rating - 0%
0   0   0
Optocouplers are.. an LED and a photo sensor potted together in a small box, so its quite normal. Usually the optocouplers can run down to about 5mA, it all depends on the part they specced.

To be honest I'm not sure why they add optocouplers to a relay board, unless they're scared of the quality of relay they provide. If you just power both sides of the optocoupler with the same supply there is no isolation or other gain.
The octocouplers on those boards let either a 3.3 or a 5 v signal turn on the octocoupler to let the relays work. Yes they could spec 5ma ones but i tested my boards which are the same board as the posters and they run 15-20ma.
The board has a jumper that determines if you run completely isolated or commonly grounded. People wiring things wrong were hosing their arduinos so i think that is the reasoning for isolation.

These boards are kind of a universal fit for arduinos and pi and general experimenting. The relays are the songle ones like in the american DJ power strip so not very robust.

That being said, even though i got a great ebay deal on a crapload of nice phoenix contact 24v mini relays with inductive protection and suppression with din rail sockets to go with them, that I was going to change out if my cheapy board failed. The cheapy relays have been working for 2 years running my heaters and return pump. Maybe its because I run most of the relays normally closed in case reef pi goes nuts. Reef pi has to energize the relays to turn them off so most of the time the relay coils are sitting not energized.
 
Last edited:

92Miata

Valuable Member
View Badges
Joined
Feb 26, 2020
Messages
1,523
Reaction score
2,358
Location
Richmond, VA
Rating - 0%
0   0   0
I use a pi zero w, never had a wifi issue, but i have a good wifi router. I did make sure the pi was not in a metal enclosure which would block signal.

Is your stand , enclosure or the combo causimg wifi signal to the pi to be weak perhaps?
It's basically sitting on my desk - router is about 6 feet away. I don't think it's a signal issue.

I think the router was killing the connection because it isn't seeing activity. The router's ui Is awful so I'm not really sure past that.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,876
Reaction score
16,680
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I used to have some of these types of issues with my comcast router. But they have never been a big deal. I did install a systemd timer to restart network service every night.
Those problems all went away since I switched to google WiFi.

On a related note, remember it’s possible to run reef-pi as standalone WiFi hotspot. It will not have access to internet this way (assuming no LAN connection present ) , but it should work fine, you just have to connect to the reef-pi hotspot to access the web ui. Its pretty awesome from security perspective,
 

Kurtzisa

Community Member
View Badges
Joined
Mar 21, 2020
Messages
90
Reaction score
73
Location
Parma, Italy
Rating - 0%
0   0   0
@Ranjib my ph probe into the calcium reactor didn't work well.
I can't set the hysteresis, every minute the solenoid valve open for one minute and turn off... I think there is something wrong... Maybe a DB wiping could be the solution?
the PH is pretty linear

PH.jpg
 

DeeEmm

New Member
View Badges
Joined
Sep 20, 2020
Messages
24
Reaction score
27
Location
RADelaide
Rating - 0%
0   0   0
It should be possible using an ATO. A momentary switch is set up as an Input should be able to trigger a Macro. When I last played with that, I could not get an input on an ATO to trigger a Macro in any way. But it should be possible as the options are built in.

Thanks Des. I've set up the ATO to trigger the macro but haven't had a chance to do any bench testing yet.
 

BenB

Active Member
View Badges
Joined
Jun 11, 2019
Messages
118
Reaction score
152
Rating - 0%
0   0   0
@Ranjib my ph probe into the calcium reactor didn't work well.
I can't set the hysteresis, every minute the solenoid valve open for one minute and turn off... I think there is something wrong... Maybe a DB wiping could be the solution?
the PH is pretty linear

PH.jpg
Your hysteresis is 0 in the picture, I do not think that will work, maybe better change it to 0.1 like Ranjib mentioned!
 

DeeEmm

New Member
View Badges
Joined
Sep 20, 2020
Messages
24
Reaction score
27
Location
RADelaide
Rating - 0%
0   0   0
It's basically sitting on my desk - router is about 6 feet away. I don't think it's a signal issue.

I think the router was killing the connection because it isn't seeing activity. The router's ui Is awful so I'm not really sure past that.


What else do you have on your network? We have a lot of network traffic (CCTV + Home automation ), throw in a couple of phones, ipads, computers and things get busy.

I think that the issue we had was that at peak demand times some devices would drop as the router simply could not handle the traffic. Those generic routers that you buy from officeworks or get free with your broadband connection are really not that good when your network starts to grow.

I think that the Google Wifi has different (roaming) control algorithms due to the way it handles mesh connections and so is less likely to drop connections, especially if the connection hops from one node to the next. We have three nodes set up.

Here's an easy test you can try: In chrome browser type 'speed test' it'll give you a link to test your connection speed.

Do it whilst connected on wifi. Then turn off your wifi and plug in an ethernet cable. Then run it again. Compare the results. It'll soon show up if you have any bandwidth issues.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
It's basically sitting on my desk - router is about 6 feet away. I don't think it's a signal issue.

I think the router was killing the connection because it isn't seeing activity. The router's ui Is awful so I'm not really sure past that.

There are a lot of bad implentations of specs out there for Wifi, especially on home routers. Also, the space is really complex now with multiple power management modes, roaming hand-offs, etc so I'm not too surprised there is some funkiness with idle devices.

If you're 6 feet away, I'd recommend a cable - much more reliable in nearly every case :)
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
The octocouplers on those boards let either a 3.3 or a 5 v signal turn on the octocoupler to let the relays work. Yes they could spec 5ma ones but i tested my boards which are the same board as the posters and they run 15-20ma.
The board has a jumper that determines if you run completely isolated or commonly grounded. People wiring things wrong were hosing their arduinos so i think that is the reasoning for isolation.

These boards are kind of a universal fit for arduinos and pi and general experimenting. The relays are the songle ones like in the american DJ power strip so not very robust.

That being said, even though i got a great ebay deal on a crapload of nice phoenix contact 24v mini relays with inductive protection and suppression with din rail sockets to go with them, that I was going to change out if my cheapy board failed. The cheapy relays have been working for 2 years running my heaters and return pump. Maybe its because I run most of the relays normally closed in case reef pi goes nuts. Reef pi has to energize the relays to turn them off so most of the time the relay coils are sitting not energized.

Totally reasonable - its easy to want to gold plate things, but since you have multiple fallbacks like the heater thermostat I think everything is totally fine :)
 

92Miata

Valuable Member
View Badges
Joined
Feb 26, 2020
Messages
1,523
Reaction score
2,358
Location
Richmond, VA
Rating - 0%
0   0   0
There are a lot of bad implentations of specs out there for Wifi, especially on home routers. Also, the space is really complex now with multiple power management modes, roaming hand-offs, etc so I'm not too surprised there is some funkiness with idle devices.

If you're 6 feet away, I'd recommend a cable - much more reliable in nearly every case :)
We had some sort of power-surge event last year that damaged or killed everything that was connected to our Comcast lines, and nothing else - cable modem, both routers, a pc motherboard, hdmi ports on multiple tvs, ethernet ports on a couple other things - just a mess. It melted the aluminum casing for the RG6 distributor/amp comcast had put in.

In the interest of expediency, while trying to get Comcast to replace all the stuff that they fried (I'm still fighting with them) - I bought a cheap router, threw it in my office, and used one line from the cable modem (in the garage with the network distribution ) to my office for the uplink, and the other one back down to feed into the distro panel. So between that, my PC, my work laptop (yay, covid), and a networked printer, I'm out of ports near the tank and on the router.

I really just need to buy a mesh setup at some point, and put a gigabit router back in the garage and clean up all the rube-goldberg nonsense.



On a positive note - we're going on about 36 hours now with no connectivity issues. And the pH fluctuation have gone from 7.9->8.1 up to 8.1->8.25 since I added a DIY chaeto reactor and am running it at night. Gonna start moving timers/etc onto the reef-pi next.
 

DeeEmm

New Member
View Badges
Joined
Sep 20, 2020
Messages
24
Reaction score
27
Location
RADelaide
Rating - 0%
0   0   0
Finally getting around to testing the input triggering a macro but in testing I have found that I am not getting a reliable signal.

Then I found this comment...

I would recommend using a current limit resistor. I use 220 ohms, but the value isn't critical. The other end of float should be connected to 3.3v since the internal pull down is enabled by default (assuming GPIO 9 or higher).

Are the pins set with the internal Pull-DOWN enabled?

Meaning that I need to raise input potential to trigger the input?

/DM
 
Last edited:

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,253
Reaction score
3,603
Location
Sacramento, CA area
Rating - 0%
0   0   0
We had some sort of power-surge event last year that damaged or killed everything that was connected to our Comcast lines, and nothing else - cable modem, both routers, a pc motherboard, hdmi ports on multiple tvs, ethernet ports on a couple other things - just a mess. It melted the aluminum casing for the RG6 distributor/amp comcast had put in.

In the interest of expediency, while trying to get Comcast to replace all the stuff that they fried (I'm still fighting with them) - I bought a cheap router, threw it in my office, and used one line from the cable modem (in the garage with the network distribution ) to my office for the uplink, and the other one back down to feed into the distro panel. So between that, my PC, my work laptop (yay, covid), and a networked printer, I'm out of ports near the tank and on the router.

I really just need to buy a mesh setup at some point, and put a gigabit router back in the garage and clean up all the rube-goldberg nonsense.



On a positive note - we're going on about 36 hours now with no connectivity issues. And the pH fluctuation have gone from 7.9->8.1 up to 8.1->8.25 since I added a DIY chaeto reactor and am running it at night. Gonna start moving timers/etc onto the reef-pi next.

Wow and ouch. Thats a pretty bad power surge failure or lightning strike. Good luck and I'm glad just forcing activity on the link prevents the disconnects.

I ended up slowly converting everything but the gateway to Ubiquiti gear (5 switches, 4 APs, cameras) running over a mix of 1/10G wired links and MoCA 2.5 adapters. No wireless mesh since the throughput sucks by the nature of it.
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 38 27.1%
  • 100% dry rock + 100% live sand

    Votes: 47 33.6%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 31 22.1%
  • 75% live rock, 25% live sand

    Votes: 14 10.0%
  • 25% live rock, 75% live sand

    Votes: 10 7.1%
Back
Top