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

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0

Marc Kruithof

New Member
View Badges
Joined
Feb 16, 2018
Messages
14
Reaction score
15
Rating - 0%
0   0   0
Hi all,

I'm new here and I'm also bussy working on the harware.
Down here you will find a schema and pcb for mine. Basically it is four sollid state relais to drive 240V.
Also four connectors for four ds18b20 that are ordered.
Schema.jpg
pcb.jpg

It is ready and working well.. I did not make pictures yet. But they will be placed later.
Keep in mind that if you are going to use my schema, IT IS HIGH VOLTAGE and DANGEROUS for humans.

There are a lot of question that I have. I don't know go lang yet, and alo JSX I'm not familiar with. But my idea is to make a selection in the configuration that it is posible to choose between fahrenheit and celsius. It is pitty that it now converts the current response from the sensor to fahrenheit. When it only converts it's value when it shows it, it would be beter I think. But I don't know how to do this. Is there a good document that describes how the current reef-py software works? Is the database prebuilded, or is it build when first time reef-py is started? (build in the code)

So basically my question is, HELP ME getting started with learning JSX, GO, and all there is to devellop for the reef-py.

Regards,
Marc
 
Last edited:

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
Hi all,

Schema.jpg
pcb.jpg

It is ready and working well.. I did not make pictures yet. But they will be placed later.
Keep in mind that if you are going to use my schema, IT IS HIGH VOLTAGE and DANGEROUS for humans.

Nice - like the inclusion of a fuse here :)

Do you have heatsinks on the BTA16 Triacs? Looks like max PD at 3A RMS is about 2-3W?
 

Marc Kruithof

New Member
View Badges
Joined
Feb 16, 2018
Messages
14
Reaction score
15
Rating - 0%
0   0   0
Nice - like the inclusion of a fuse here :)

Do you have heatsinks on the BTA16 Triacs? Looks like max PD at 3A RMS is about 2-3W?

It is 3A fast fuse. Just to protect against shorting. So max 3A total (all 4). I will never drive than mutch. I used 16A triacs just because I still had them. Now, one is driving my 15W light. (15/240=62mA) Don't think you ever will notice any power dissipation in the triac. If you want to drive more power, you might want heatsinks. But TO220 can also dissipate without heatsink. I never did calculate it, but I have done a lot with triacs and from my experiance you need cooling on those if you drive more than about 3A for one triac that is switching 240V. You might always want to check after using a bit. (Kill the power first)

greetings.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
It is 3A fast fuse. Just to protect against shorting. So max 3A total (all 4). I will never drive than mutch. I used 16A triacs just because I still had them. Now, one is driving my 15W light. (15/240=62mA) Don't think you ever will notice any power dissipation in the triac. If you want to drive more power, you might want heatsinks. But TO220 can also dissipate without heatsink. I never did calculate it, but I have done a lot with triacs and from my experiance you need cooling on those if you drive more than about 3A for one triac that is switching 240V. You might always want to check after using a bit. (Kill the power first)

greetings.

Sounds good :) The days of running 1kW of metal halide are a bit in our past :-D

As for developing on Reef-Pi, I only ever use Linux directly for this - you can host the whole environment on the Raspberry Pi (compiles won't be light speed but it works). The Go server acts as the controller logic, and the front end calls it with requests to display data, which helps split up where you want to make changes. What are you thinking of adding? Have you seen the development environment page? https://reef-pi.github.io/additional-documentation/development/
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
While I want to dive into the software more, I've been spending some time conceptualizing a "base board" for a Raspberry Pi which has most of the common I/O circuits, power supplies, etc into a single board solution that will work with Reef-Pi.

I'm currently considering connectors and how to run various control signals to and from the board (PWM, 0-10V, temperature sensors, etc - pH remains BNC :)).

There are three main ways I'm thinking about this:
  • Do what the APEX does and use RJ-45 jacks for connectors. Pros: Its compact, Cons: Probably the most annoying to wire arbitrary sensors into an RJ45 plug and crimp it - requires at least one special tool. I've more or less ruled this out.

  • Do something similar to the blueAcro drivers and LEDs and use Phoenix PTSM right angle push-in terminal blocks. There is also a variant of these "push-in" headers which has a push-in plug, which mates with a latching board-mount connector. Pros: Accepts arbitrary wire, quick disconnect from the board. Cons: Some cost add.
MFG_1709460.jpg


1814935.JPG

  • Go vertical on the board and don't try to put connectors on the edge of the board. This adds a lot of vertical height to any enclosures you would use with this (I'd like to design this with at least one target off the shelf plastic box). There are push-in terminal blocks available for this as well:
1891085.JPG


Pros: If you put this in a box, no need to try to make side cutouts to run connectors, everything can just be mounted from the top which is easier for a total custom enclosure. Cons: Adds height to the whole thing.

I've made a quick "floor planning" mock of what these connectors would look like on a board with a Raspberry Pi Zero W:

connectors.png


(Yes, the Raspberry Pi Zero is floating in mid-air - pretend there is a connector to the board in that avoid as well as standoffs ;))

Thoughts?

(Connectors will be the single biggest part cost to building such a board, easily $1-4 each)
Love it.
What if we use hdmi connectors instead of rj45 ?
I would like to settle one audio jacks, barrel jacks, and hdmi if possible. Reason being they are universal (can get both panel mount and pcb mount connectors) and aesthetically more pleasing. BNC is kinda the only way to go for some probes, so no choice there,
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Yes, trying to adapt the profilux 4 design to my reef-pi build.
With the media center enclosure gain manual reset and on/off button. Reset in newer pi’s is actually easy, just need to short the p6/run header(need to solder pins, these are not on the pi by default). On/off button plenty of open source, will use init script to run a adafruit 16x2 lcd on start up.
Already has usb ports just need to run these to the pi usb ports so have bluetooth device support(key board lol).
Flat design Fits in my cabinet better. Aluminum cutouts easier to work jack housing using a drill press, than with plastic.

I have written a physical interface software for my pis, I have not yet opensourced it (due to time constrains), it allows you to reboot pi gracefully using a mechanical (tactile) button. It does not depend on reef-pi, runs as a separate daemon, has integration with LED panel (ht16k33) and can be customized to do some more things (like show IP, show bootup or shutdown message). I 'll try to publish it next week, if you want you can use it. I had to write this due to several time my reef-pi gets stuck (it works, but I can access it) due to network issues. I kinda lost my enthu on it later because I dropped a simple systemd timer job to restart wifi service every night, and that solved all my problems. But I still see lot of value in a having a common barebone software (no dependency on reef-pi) that will respond to push button (physical interface) and take some action (run a command or run a reef-pi API call) and show the response in a LED display.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
So rebuilding my reef-pi controller.

What i didnt like with previous build.
-i created modules like apex. temperature/ato in this box. Raspberry pi and display in this box. It added to my wiring rather than decreased. After looking at the GHL design i have rethought this approach.
- touch screen was in a static location created less usefulness.
-the look, i see all these great controller setups, i didnt have that lol.

To that end ordered.
-An aluminum media center housing. Reef-pi all sensors, etc go in here.
-Ordered a second raspberry pi. And Phone batter backup. This attaches to display. Now when not charging this is mobile, connects to reef-pi via web server only.
-with the aluminum housing i can use rj45’s and bnc for every connection. Easier to work with cutouts than the full plastic of a project box.
- larger power supply can fit in the box. Will require a fan now but thats not really an expense. But will be able to power all probes from one supply.(with proper voltage regulation of course lol)
-fit flat under my dosing pumps.
-thinking of using the lcd screen on the media center to be controlled by a simple program that says hello and good bye (on/off). And power button to initiate shutdown and on. Open source is great for simple tasks lol.
-room for upgrades.
-Only power strip and display will not be inside the housing.

6ab42b12edfe9fc08cbacaa17a52865f.jpg
what the reef-pi is going in. Will post pictures of my build steps once i have all the parts. Using perfboards and single core wires for stability and t-cobbler to attach pi. No jumper wires.
I am assuming that this will only house the DC components. AC relays wont be part of this?
How do you plan to do the power supply ? Multiple components will require different type of powers (3.3v for probes, 5v for pi/pwm, 12 v for light/doser, 24v for wavemaker). I am thinking about using a micro ATX psu or a traco PSU with multiple outputs (and then use a linear regulator or something else if need be). I would also pay attention to possible interference and its implications on sensors (ph sensors are sensitive to this)/
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
Love it.
What if we use hdmi connectors instead of rj45 ?
I would like to settle one audio jacks, barrel jacks, and hdmi if possible. Reason being they are universal (can get both panel mount and pcb mount connectors) and aesthetically more pleasing. BNC is kinda the only way to go for some probes, so no choice there,

Hand terminating HDMI _cables_ is difficult. Connector shells are rare, the pitch is small. Hacking off an HDMI cable would then end up with a ton of wire nuts to actually connect to the intended wire.There are some odd Chinese HDMI to terminal block adapters, but we might as well just put terminal blocks right on the board then in smaller plugable increments, and less chance of error of connecting HDMI to the I/O port, or vice versa (since the RPi also has one).

Most of the sensors, outside of pH, are not using any standard connector so retaining full flexibility feels like the right strategy.

I like PicoLock connectors as well, but I would not suggest anyone hand-crimp the connector blades on them. It takes a special tool ($$$$, really Molex charges like $300 for a crimp tool) or a poor fit general purpose tool (still like $50).

Barrel is fine for power, as that is standardized.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib I've been investigating my "flashing" issue and had a question as i'm not used to working with GO. Could you share which methods are called by the cron, as i'm struggling to figure it out.

When manually setting the PWM values on the RPI I do not suffer with any flickering, I can also adjust the duty cycle up and down without any flickering. What i'd like to understand is how the cron is interacting with the RPI PWM interface, as it feels like PWM0 is being disabled/enabled when ever the cron runs. If I manually disable/enable PWM0 i'm able to replicate the "flash", this happens because my light's power supply doesn't receive a PWM signal so it defaults to 100% output. This is the data sheet for power supply i'm using, https://docs-emea.rs-online.com/webdocs/13ec/0900766b813eccfc.pdf
Hey, did we get this sorted, if not. I should look into this. RPI based pwm drivers are not second class citizen. And it should work flawlessly , if you are still encountering issue (i.e. threshold are not solving the flashing), its likely a bug with on/off thing that we are doing in the reef-pi/rpi pwm code path. I would definitely address this before a public release.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hand terminating HDMI _cables_ is difficult. Connector shells are rare, the pitch is small. Hacking off an HDMI cable would then end up with a ton of wire nuts to actually connect to the intended wire.There are some odd Chinese HDMI to terminal block adapters, but we might as well just put terminal blocks right on the board then in smaller plugable increments, and less chance of error of connecting HDMI to the I/O port, or vice versa (since the RPi also has one).

Most of the sensors, outside of pH, are not using any standard connector so retaining full flexibility feels like the right strategy.

I like PicoLock connectors as well, but I would not suggest anyone hand-crimp the connector blades on them. It takes a special tool ($$$$, really Molex charges like $300 for a crimp tool) or a poor fit general purpose tool (still like $50).

Barrel is fine for power, as that is standardized.
I went with hdmi because the number of pins are higher, and the breakout boards make it easy, if we go with pcb mount instead of panel mount then the wiring hassle is solved right?
I am leaning on hdmi over rj45 becuase it has more pins, folks who wants 16 channel relays can use it.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Seconded - audio jack connectors are more of a pain to solder to or crimp to. Would you vote for RJ45 over a more conventional terminal block?
Fascinating :) I found the audio jacks are easiest and most minimal. They have exactly three pins that I need for building kessil controller or connecting temperature probe etc.
Whatever works for you. I can say that rj45 is definitely better in terms of safety, since they dont let the GND/+Ve touch , which happens when you insert the audio connector (and has bad impact on sensor/circuit downstream)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Hi all,

I'm new here and I'm also bussy working on the harware.
Down here you will find a schema and pcb for mine. Basically it is four sollid state relais to drive 240V.
Also four connectors for four ds18b20 that are ordered.
Schema.jpg
pcb.jpg

It is ready and working well.. I did not make pictures yet. But they will be placed later.
Keep in mind that if you are going to use my schema, IT IS HIGH VOLTAGE and DANGEROUS for humans.

There are a lot of question that I have. I don't know go lang yet, and alo JSX I'm not familiar with. But my idea is to make a selection in the configuration that it is posible to choose between fahrenheit and celsius. It is pitty that it now converts the current response from the sensor to fahrenheit. When it only converts it's value when it shows it, it would be beter I think. But I don't know how to do this. Is there a good document that describes how the current reef-py software works? Is the database prebuilded, or is it build when first time reef-py is started? (build in the code)

So basically my question is, HELP ME getting started with learning JSX, GO, and all there is to devellop for the reef-py.

Regards,
Marc
You work is really cool. Thank you for sharing this with us.
We can definitely get you started with the development workflow. Can you PM me your email id? I can send you an invite to slack, something we use for developer discussion. It's a chat software, you can ask and get answers there in real time. I would be happy to guide you through the code and get a fix for Celsius to Fahrenheit conversion.

I have couple of feedback on the PCB design.
1. It would be nice to break out the pin 18 and 19 (pwm) and have holes for soldering a transistor (can be anything from 2n2222a /tip120 or any power mosfet) for 10v pwm conversion and resistors (check the lighting circuit guide for reference)
2. Break out the i2c pins, we'll need that to connect pca9684 board, sht1d sensor, led display any various other things. It might be good to have a 3.3 and 5v dc rail as well
3. What if you separate the AC parts with rest of the board (i.e. triac/relays are in seperate pcb, connected to the main pcb with jst connectors)

Great work, keep it up :)

by the way the software name is reef-pi (reef + Raspberry Pi, not py, which mostly denoted python language based software) :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
It is 3A fast fuse. Just to protect against shorting. So max 3A total (all 4). I will never drive than mutch. I used 16A triacs just because I still had them. Now, one is driving my 15W light. (15/240=62mA) Don't think you ever will notice any power dissipation in the triac. If you want to drive more power, you might want heatsinks. But TO220 can also dissipate without heatsink. I never did calculate it, but I have done a lot with triacs and from my experiance you need cooling on those if you drive more than about 3A for one triac that is switching 240V. You might always want to check after using a bit. (Kill the power first)

greetings.
We can also mount ds18b20 in to-92 packaging to sense the onboard heat. I think it will be a good thing to have as a general safety measure, since we are likely to have voltage regulators (for multiple output PSUs) and pwm converter (5v -> 10v or 25v using mosfets or tip120) which also have this risk.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
I went with hdmi because the number of pins are higher, and the breakout boards make it easy, if we go with pcb mount instead of panel mount then the wiring hassle is solved right?
I am leaning on hdmi over rj45 becuase it has more pins, folks who wants 16 channel relays can use it.

To rehash my thinking:

Downside: everything is on one cable breakout dongle. Requires a dongle. Confusion with the HDMI port on a raspberry Pi will eventually cause some sad Pi, monitor, or base board.

Upside: As you said, single plug. It does make the actual base board smaller. If I make a female on both ends with a dongle with terminal blocks, a standard HDMI cable can be used to remote locate the actual signals. There are differential pairs that can be exploited to not make a mess of any analog signals. HDMI connectors are reflowable (unlike cheap terminal blocks). HDMI connectors are cheap.

I’m going to go with HDMI for now and backup to the push-in wire pluggable connectors.

I’m pretty cold on RJ45. Let’s consider that dead.

Thanks :)
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
To rehash my thinking:

Downside: everything is on one cable breakout dongle. Requires a dongle. Confusion with the HDMI port on a raspberry Pi will eventually cause some sad Pi, monitor, or base board.

Upside: As you said, single plug. It does make the actual base board smaller. If I make a female on both ends with a dongle with terminal blocks, a standard HDMI cable can be used to remote locate the actual signals. There are differential pairs that can be exploited to not make a mess of any analog signals. HDMI connectors are reflowable (unlike cheap terminal blocks). HDMI connectors are cheap.

I’m going to go with HDMI for now and backup to the push-in wire pluggable connectors.

I’m pretty cold on RJ45. Let’s consider that dead.

Thanks :)
I agree, if user confuse the hdmi connector, it will foo bar big time :) . Thats a very good thought. I guess it was not obvious to me, as I am mostly using pi zero, and the mini-hdmi connector makes it less obvious. Keep us posted,
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,843
Reaction score
17,056
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I agree, if user confuse the hdmi connector, it will foo bar big time :) . Thats a very good thought. I guess it was not obvious to me, as I am mostly using pi zero, and the mini-hdmi connector makes it less obvious. Keep us posted,
The only thing I am still not sure about the HDMI route is if its safe for relay use. My understanding is hdmi specs limit current draw to 60ma, and most relays (mechanical or ssds) will draw 20ma per channel. So this is safe. But I think it will be nice to know how much current I can draw, anyway.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
1,951
Reaction score
3,353
Location
Sacramento, CA area
Rating - 0%
0   0   0
Standard cheap HDMI connector has a contact rating of 500mA.

https://www.amphenol-icc.com/media/wysiwyg/files/drawing/10029449.pdf

Most good HDMI cables are in the 22-26 gauge ballpark, which should be ok at this loading. Obviously signals intended for direct relay control would need beefier output drivers, and flyback protection diodes on the coil side. My current 5V bus design has capability for up to about 3A total on the 5V rail (12->5V DC/DC). Do you prefer 12V or 5V coil relays? :)

Some USB connectors will carry contact ratings up to 1.5A, and a digital control bus may be best for a relay breakout board vs other logic-level signalling, so thats a future extension point. I'm going to throw up a concept doc for the I/O of the base board (for various cost and flexibility reasons, most of the heavy lifting is done by a single slave MCU sitting on the I2c bus instead of lots of special-purpose chips).
 

Gary G

Active Member
View Badges
Joined
Nov 8, 2016
Messages
128
Reaction score
66
Rating - 0%
0   0   0
I like the idea of an HDMI for main connectors. As for as probes I like the audio jack keep it simple. This will be my first pi experience so I'm holding off on buying stuff cause I don't know enough to try and design a shield. this is such a cool program so I'm in it for the long haul. wish I could be of more help.
 
Back
Top