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

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
940
Reaction score
1,370
Review score
+0 /0 /-0
Location
Missouri
Now I'm confused. I would have guessed you were using the outputs in the bottom right corner as those go through the ULN2803A. The doser connector you circled is 3 PWM outputs which can only handle very little current and only put out 3.3v, definitely no motors connected directly would work. Did you have a circuit between the board and the pump? What pump are you using, is it PWM controllable?



EDIT: Just noticed he has a dosing adapter, that also has the ULN2803A which explains things. Have you checked the voltage coming out of the plug you circled, if it's stuck on 3.3v there then yeah either resistor or more likely the pca9685 output.
Yup he had a uln2803a module coming off the pwm pins which was also fed 12v. I never measured voltage all I know is if I hook it up its on, always on. Could the resistor failing cause that or is it most likely the pca9685? My other question is what would have caused it to go belly up....
 
Nutramar Foods

geekengineer

Active Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 10, 2019
Messages
367
Reaction score
514
Review score
+0 /0 /-0
Location
South Aurora
Just realized that pi pico has a wifi variant. I‘ll get it and get started with the driver development. If you can wait, don’t buy esp32, ill get this done,
thank you for calling this out. I don’t know how I missed it , I guess I was just aware of esp32 and didn’t pay attention to pi pico family
I was just curious how was your esp32 driver project going and if you were still going to do a driver for the pi Pico W as well?

Also is it possble or a plan to be able to interface with another rasberry pi via wifi? Sort of in a simmilar manor to the ESP32 or pi pico W. I was wondering if it would just be a matter of coding a slave interface up on the raspberry pi even. I was thinking of a few things I could do remotly in my water mixing area that might need some more CPU horse power to do.
 

robsworld78

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 14, 2020
Messages
893
Reaction score
1,180
Review score
+0 /0 /-0
Location
Edmonton, Canada
Yup he had a uln2803a module coming off the pwm pins which was also fed 12v. I never measured voltage all I know is if I hook it up its on, always on. Could the resistor failing cause that or is it most likely the pca9685? My other question is what would have caused it to go belly up....
Based on that I think it's more likely the ULN2803A is damaged, either by ESD or high kickback voltage. If you check the 3 PWM pins on doser plug with the ground all 3 should read 0v, if so it'll be the ULN. To verify if you turn the pumps on those 3 pins on doser plug should be 3.3v.
 

Tom Bishop

Well-Known Member
Review score
+0 /0 /-0
View Badges
Joined
Jan 1, 2019
Messages
940
Reaction score
1,370
Review score
+0 /0 /-0
Location
Missouri
Based on that I think it's more likely the ULN2803A is damaged, either by ESD or high kickback voltage. If you check the 3 PWM pins on doser plug with the ground all 3 should read 0v, if so it'll be the ULN. To verify if you turn the pumps on those 3 pins on doser plug should be 3.3v.
Thats a good idea and I can do that, will do that this weekend and see what I find out...thanks for the clarity. :)
 

dadarara

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Nov 16, 2020
Messages
88
Reaction score
37
Review score
+0 /0 /-0
Location
Israel
last night we had a summer time change. moved 1 hour back. since this morning , the lights are not switching on per the schedule.
if the setting in lights configuration is manual, then its working. so its not electrical issue
the date/time in linux is ok.
rebooted
upgraded to reefpi5.3 from 5.2

what else should I check ?
reinstall from scratch ?
 

Martin Lowry

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Sep 19, 2017
Messages
60
Reaction score
66
Review score
+0 /0 /-0
Location
Dover, NH
So I need to figure out a automatic feeder for when I need to leave things unattended, I know @robsworld78 has a diagram for wiring up the Ehiem but was wondering if anyone else had done something differently. Havent made up my mind yet but would be nice to be able to time shutting the pumps off etc when feeding, just thought I would ask. :)
If it's of any value, I used Robs EHEIM diag with one that I had laying around and it works great. I have a single feeding instance macro set up and I also set the EHEIM to feed once a day as well just in case anything goes sideways with the RPi macro while I'm away.
 
Tidal Gardens
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,678
Reaction score
16,721
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
last night we had a summer time change. moved 1 hour back. since this morning , the lights are not switching on per the schedule.
if the setting in lights configuration is manual, then its working. so its not electrical issue
the date/time in linux is ok.
rebooted
upgraded to reefpi5.3 from 5.2

what else should I check ?
reinstall from scratch ?
are you using wifi based setup? reload reef-pi after reboot, in case this is a network driver loading related issues. Do you see anything in log? or error in the ui?
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,678
Reaction score
16,721
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
I was just curious how was your esp32 driver project going and if you were still going to do a driver for the pi Pico W as well?

Also is it possble or a plan to be able to interface with another rasberry pi via wifi? Sort of in a simmilar manor to the ESP32 or pi pico W. I was wondering if it would just be a matter of coding a slave interface up on the raspberry pi even. I was thinking of a few things I could do remotly in my water mixing area that might need some more CPU horse power to do.
its working ok. Graphs do show occassional blips in temperature reading, but the whole unit has been pretty much functional.
esp32-temperature.png

this also tests the new transform functionality, that im using here to convert reading in C-> F.

driver config, i have used this one with 4 outlet, 2 inlet, 2 pwm, 1 ds1820 (as analog input) connectors.
esp32-reef-pi.png


while the entire setup is working as expected (including light, equipment, temperature and ato control), i do not like the fact that reef-pi has to constantly communicate with the esp32 unit. ideally i want the esp32 unit to run independently and with full manual fall back capabilities on hardware. From what i understand we can only run two control loops , unless we use evenloop like libraries. I have learn those bits. and this will take some time.

Still, I'll ship what I have, as I find this to be super awesome :), that we can augment reef-pi capabilities with esp32 based light, doser, ato, temperature controller. This reduces the circuit complexity required in a single unit. reef-pi 6.0 will unlock this and as we experiment, learn things we can build those specific capabilities in the esp32 driver side. Core reef-pi controller software also needs new set of feature (delegated control loops) for that world. Im excited :)
 
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,678
Reaction score
16,721
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Meanwhile, i am taking some small pauses to reflect,

Jake's sudden departure kinda hit me hard. Some how i feel very sad about this. I learned a lot from his content. And his fearless, honest way of saying this, accepting failures is something i can relate to. And above all, calling for better coral husbandry, his love of this hobby was electric. His long endurance () He was perhaps the most inspiring person for me in this hobby. I had the opportunity to see him live in Aquashella. Many things i tried to do with reef-pi (focus on core reef keeping chores, coral requirement, avoiding hubris/un-needed complexity, focus on learning continuously) have huge influence from his work. RIP my friend. Our fearless and beloved reef keeper. Every time I'll spell a scientific name of a coral, you'll be in my mind.

A modern (not mid century) pico tank stand,
38553B9A-24B1-4711-8A82-8D873B179D92.jpeg

with two side doors for easy access of ato container and electronics . There’s a gap that is planned to be used for mounting panels with manual overrides.
217506F5-4220-4579-93A3-6A6D62A11AC0.jpeg

92E29A4F-4E29-4EC7-B1A1-0F527879DA82.jpeg


built from 3/4” plywood.
884DE3B0-4AE9-4426-A6E3-AA496B8D6DE8.jpeg

all joinery are dominos . And edge banding on all sides except back
67B89E15-B92E-4866-9008-1DA7F54BC717.jpeg


Soft close hinges for mounting doors.
753B5BFF-8F26-4F5A-9969-699B9A9A72C9.jpeg

3D printed parts are next, followed by mounting the electronics. -and finally one of the pico tank .

We’ll miss you Jake. your teachings will guide us always.
 

Attachments

  • C7835DC2-07F3-4F31-8F11-E381A8E7E2DB.jpeg
    C7835DC2-07F3-4F31-8F11-E381A8E7E2DB.jpeg
    265.3 KB · Views: 19
Top Shelf Aquatics
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,678
Reaction score
16,721
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
Hello folks
I have a puzzle, I'm missing something. See the photo
1667673017899.png
:-O where is configuration tab ?are you using a non english translation? I also dont see reef-pi version. how you installed and run reef-pi .. as in is it running on raspberry pi?
 

eggi55

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Sep 18, 2022
Messages
35
Reaction score
22
Review score
+0 /0 /-0
Location
germany
:-O where is configuration tab ?are you using a non english translation? I also dont see reef-pi version. how you installed and run reef-pi .. as in is it running on raspberry pi?
hello [email protected]
thank you for your quick answer actually I haven't changed or reinstalled anything I can get into the configuration via the errors. I think my raspi is junk. USB is defective due to water.

89B192D6-DAD1-4111-A287-1AE48A29B706.png AFA0B419-CBAE-4D6D-870A-8D138A5A6354.png
 
Last edited:
OP
Ranjib

Ranjib

7500 Club Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 16, 2016
Messages
9,678
Reaction score
16,721
Review score
+0 /0 /-0
Location
Pleasant Hill, Concord
hello [email protected]
thank you for your quick answer actually I haven't changed or reinstalled anything I can get into the configuration via the errors. I think my raspi is junk. USB is defective due to water.

89B192D6-DAD1-4111-A287-1AE48A29B706.png AFA0B419-CBAE-4D6D-870A-8D138A5A6354.png
there are errors related to adafruit.io , try disabling it. Still not sure why its not in english or why its not showing any version details
 

eggi55

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Sep 18, 2022
Messages
35
Reaction score
22
Review score
+0 /0 /-0
Location
germany
there are errors related to adafruit.io , try disabling it. Still not sure why its not in english or why its not showing any version details
since I live in Germany, I put it in German with adufruit. io doesn't bother me for now, I'm still considering closing the subscription. adufruit.io I wanted to deactivate some feeds, which also worked, but reactivating them didn't work. I'll take care of that later.
 
Top Shelf Aquatics

tyronbes

New Member
Review score
+0 /0 /-0
View Badges
Joined
Nov 5, 2022
Messages
20
Reaction score
57
Review score
+0 /0 /-0
Location
Austin
Welcome to the development thread of reef-pi, an open-source, affordable, modular DIY reef-tank controller based on Raspberry Pi.

aio.jpg

If you are trying to build a reef-pi controller, please check out the build guides linked below. You can use this thread to seek help and to stay updated with the latest development.

Screen Shot 2018-11-04 at 8.38.50 PM.png



reef-pi provides following functionalities:
  • Equipment control or automated power strip (including digital timers to switch on/off equipment at periodic intervals)
  • LED light control (24 hour cycle), diurnal cycle, fixed dimmig
  • Auto Top Off (based on photoelectric water level sensor or float switch)
  • Temperature monitoring and control (switch on/off heater & chiller)
  • pH monitoring
  • Dosing automation
  • Macro (feed mode etc)
  • And several other features like camera controls (periodic image capture and upload on google drive), telemetry (dashboard and alerting based on sensor values using adafruit.io), mobile friendly UI etc.
A beginner friendly list of reef-pi build guides are available on adafruit.io, if you are planning to build a reef-pi controller start with them.
  1. Setup and installation
  2. Power controller
  3. Temperature controller
  4. Auto Top Off
  5. Light controller
  6. pH monitor
Since reef-pi is modular and customizable, the cost of individual builds varies. In our experience reef-pi controller are almost always cheaper than the commercial alternatives and costs anywhere between 100 to 550 USD. An example bill of materials can be found here as amazon list. If you are building a reef-pi controller, I highly encorage you start a build thread and tag it with #reefpi to seek help with your build


--------------------------- Original thread start ---------------------
Hello friends,
I am starting a master thread for a DIY reef tank controller that is based on all opensource software and hardware. I had started with this project with following goals:
- Build an opensource software and hardware based reeftank controller that anyone can use and hack
- Keep the controller well tested against a set of standard equipment I use, while make it possible for other equipment to be used
- Maintain my own tank build threads and their evolution, backed by this controller.
- Learn electronics and reef keeping along the way (I am biologist by education & software engineer by occupation)

Following are the details of what I have developed & tested till now:
Controller software:
- The main controller software is called reef-pi. It is written in go, its fast and performant. It used embd for hardware communication. It also runs a little web server which provides the UI for the controller. UI is written in React , and can be accessed from anything that has web browser. As of now, the reef-pi supports following things:
- AC 110/220 V socket on/off (uses optocoupled relays underneath). This is used to remotely switch on/off return pump, LED bulb, heater etc.
- 0-20 Volt DC PWM. This is used to control things like dimmable LEDs, DC pumps. I use it to control my Kessil A80, A360. As well as a 5V DC pump (i use it as wave maker in one of my pico with SPS). PWM is done using PCA9685 breakout board from adafruit. This board supports 16 channels. I am using only 5 at max, as of now.
- Analog sensor support using MCP3008 analog to digital converter. This supports 8 channels. i.e. I can use up to 8 sensors/probes. As of now, I have only tested temperature sensor with it.
Other than the following basic hardware/equipment support, the controller software provides following additional features:
- Setting up daily/weekly/monthly scheduled jobs. Like turning on/off certain equipment. I use this feature to run my AC20 HOB filter nightly.
- Setting up dusk-to-dawn like lighting using PWM. The UI gives 12 vertical slider based 0-24 hours (each slider representing 2 hours gaps). I combine two of these two control the kessil LEDs.
- Authentication using Google OAuth. Since the whole controller runs on raspberry pi and provides an web frontend, security of one of my concern. To mitigate this, I have added google authentication support, which when configured will allow only certain users to log in (email specified in the configuration value).

This is the summary of the core controller software and what features it has as of now. I am constantly writing/improving things around it. As of now, I have two reef tank powered by this. I 'll have seperate threads on the individual builds that will include the housing and ancillary hardware in nano-reef.com, as my tank build threads are there, but I'll share all the controller specific common bits here, including UI screen shots, and tank pics :)

20161115_081550.jpg
So much awesomeness here!! I started building my reef pi about a week or so go, I'm following a tutorial on learn adafruit, decided to go with making my own 8 channel relay outlets, I'm not exactly sure what is going on, I can get in2 to come on and off, in4-8 stay on, and 1&3 do nothing. Did you have to do any coding on python to get your relay to work? I've noticed theres 2 different gpio pinot diagrams, not sure which one to follow. But I'm slowely getting it going, in the tutorial they are using a premade relay outlet, so it's definitely been an interesting trial and error so far. But I'm glad I stumbled upon your post, I'm going to read through it and see what valuable info I can get!
 

geekengineer

Active Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 10, 2019
Messages
367
Reaction score
514
Review score
+0 /0 /-0
Location
South Aurora
Hi, I've got an issue with My ATO pump that I've now got working properly, but can't seem to reset so the charts look normal... I get this error
1668040281767.png
Sorry to Jest but this error message sort of makes it sound like your ATO bucket is empty. lol Anyways hopefully figure it out.
 

geologeek

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Apr 21, 2010
Messages
27
Reaction score
9
Review score
+0 /0 /-0
Location
UK
Hi all, i am just looking for some advice.....

My reef-pi setup has been working wonderfully for the last 2 years without any hiccups whatsoever but unfortunately this changed on friday night when i could not access the UI via my phone or browser and Putty would not allow me to access the Pi via ssh despite the right password etc being used :confused-face:

So my only remedy i could think of was to pull my sd card and put it into another raspberry pi and temporarily adding init=/bin/sh to the end of /boot/cmdline.txt and resetting the pi password.

i was then thankfully able to ssh back into the Pi and disable/re-enable the reef pi service and POW i was back up and running with access via the UI :beaming-face-with-smiling-eyes::cool:

Now unfortunately i am left with a couple of problems.........7 of my 8 relays on the power module have failed and one of my temp sensors has gone haywire - it was the one controlling my heater so i have had to plug the heater into this last functioning relay and use my secondary temp probe to control it. All my equipment still works as they were initially wired up NC so they have power still, just now cannot be controlled. Will have to do a rebuild and sort that issue out as i dont think the last relay has much life left as it is clicking like crazy when the heater needs to be on.


So there is my story - now for the request for some assistance if i can?

on one of my channels in the Equipment section of the UI (Channel 2) even though it has no function now given the relay has failed it gives me the following error if i turn the channel on/off

{"error":"Failed to update. Error: can't set output on channel 8: open /sys/class/gpio/gpio8/direction: no such file or directory"} | HTTP 500

Anyone care to enlighten me as to why this is the case? Is it something as simple as the wire has come loose somehow or is this software side?

I will be completely starting a fresh with this build - i just need to figure out a new housing as i originally have it as an all in one enclosure - but have found that it would probably be best if i split it into at least 3 seperate modules for future maintenance and especially keep my AC side away from the controller side..........not sure if this is why the problem started in the first instance with some sort of power surge or something? cant see it has given the tank is meant to have a surge protector at the outlet..........

Anyway some guidance on the above error would be apprecited thanks!

Hope you are all good and happily reefing!
 
Avast

Sral

Active Member
Review score
+0 /0 /-0
View Badges
Joined
May 2, 2022
Messages
361
Reaction score
429
Review score
+0 /0 /-0
Location
Germany
So much awesomeness here!! I started building my reef pi about a week or so go, I'm following a tutorial on learn adafruit, decided to go with making my own 8 channel relay outlets, I'm not exactly sure what is going on, I can get in2 to come on and off, in4-8 stay on, and 1&3 do nothing. Did you have to do any coding on python to get your relay to work? I've noticed theres 2 different gpio pinot diagrams, not sure which one to follow. But I'm slowely getting it going, in the tutorial they are using a premade relay outlet, so it's definitely been an interesting trial and error so far. But I'm glad I stumbled upon your post, I'm going to read through it and see what valuable info I can get!
Welcome to the club !
I didn't have to do any coding for my Outlets. Personally I used an 8 channel Relay board from Robotank and connected that to my Raspberry Pi Zero on the GPIO Pins Number 7,8,9,10,11,23,24,25 using a ULN2803A transistor brick (Bottom part of the circuit drawing):
PiUnit_schem.png


OUT1 to OUT8 feed directly into the Relay board IN1 to IN8 as displyed here (not that visible, but the DB9 connector pins at the bottom feed directly into the IN1 to IN8 pins of the board, which are soldered directly to this mint board, just in front of the DIP18 socket and the lower row of screw terminals with the color coded wires from the DB9 connector):
4e99d86c-ade4-4b2c-aa98-693c1ed6cc4d-jpeg.2721327


I defined the PIns as outlet Connectors in the Configuration Tab:
1668341893636.png


I then defined some Equipment that uses those Outlets in the Equipment Tab:
1668342123157.png
 

Sral

Active Member
Review score
+0 /0 /-0
View Badges
Joined
May 2, 2022
Messages
361
Reaction score
429
Review score
+0 /0 /-0
Location
Germany
Hi all, i am just looking for some advice.....

My reef-pi setup has been working wonderfully for the last 2 years without any hiccups whatsoever but unfortunately this changed on friday night when i could not access the UI via my phone or browser and Putty would not allow me to access the Pi via ssh despite the right password etc being used :confused-face:

So my only remedy i could think of was to pull my sd card and put it into another raspberry pi and temporarily adding init=/bin/sh to the end of /boot/cmdline.txt and resetting the pi password.

i was then thankfully able to ssh back into the Pi and disable/re-enable the reef pi service and POW i was back up and running with access via the UI :beaming-face-with-smiling-eyes::cool:

Now unfortunately i am left with a couple of problems.........7 of my 8 relays on the power module have failed and one of my temp sensors has gone haywire - it was the one controlling my heater so i have had to plug the heater into this last functioning relay and use my secondary temp probe to control it. All my equipment still works as they were initially wired up NC so they have power still, just now cannot be controlled. Will have to do a rebuild and sort that issue out as i dont think the last relay has much life left as it is clicking like crazy when the heater needs to be on.


So there is my story - now for the request for some assistance if i can?

on one of my channels in the Equipment section of the UI (Channel 2) even though it has no function now given the relay has failed it gives me the following error if i turn the channel on/off



Anyone care to enlighten me as to why this is the case? Is it something as simple as the wire has come loose somehow or is this software side?

I will be completely starting a fresh with this build - i just need to figure out a new housing as i originally have it as an all in one enclosure - but have found that it would probably be best if i split it into at least 3 seperate modules for future maintenance and especially keep my AC side away from the controller side..........not sure if this is why the problem started in the first instance with some sort of power surge or something? cant see it has given the tank is meant to have a surge protector at the outlet..........

Anyway some guidance on the above error would be apprecited thanks!

Hope you are all good and happily reefing!
Unfortunate to hear.
That error points to a software or hardware error on the PI. Since that Outlet would only give OUT a signal, it doesn't care if something is connected or not. If I'm not mistaken, that error says, that the Reef-Pi software can't find the interface to set the GPIO Pin 8. That means it's software and should resolve once you reinstall Raspbian and Reef-PI.

I would recommend to save your Reef-PI's database using WinSCP for example. Settings are pretty much the same as for Putty.
 

Does it matter to you whether your fish are captive-bred or wild caught?

  • I only buy captive bred fish.

    Votes: 94 14.4%
  • It matters, but I will buy either captive-bred or wild-caught.

    Votes: 459 70.2%
  • I think wild-caught fish are the better option.

    Votes: 16 2.4%
  • I don’t care where the fish were bred.

    Votes: 85 13.0%
World Wide Corals
Top