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

Gareth elliott

Read, Tinker, Fail, Learn
View Badges
Joined
May 7, 2017
Messages
5,468
Reaction score
6,935
Location
NJ
Rating - 0%
0   0   0
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)/

I was planning similar i haven’t nailed down the specifics with the power supply. I dont need wave makers. Or leds. So right now its probes. Will test for isolation needs as the build progresses. I will probably in the future need control for dimming t5’s but i will reach that bridge when i actually build a hybrid unit lol.
That boot code sounds awesome btw!
 

Gary G

Active Member
View Badges
Joined
Nov 8, 2016
Messages
128
Reaction score
66
Rating - 0%
0   0   0
Can I ask what maker fair you like to go to?
 
OP
OP
Ranjib

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 was planning similar i haven’t nailed down the specifics with the power supply. I dont need wave makers. Or leds. So right now its probes. Will test for isolation needs as the build progresses. I will probably in the future need control for dimming t5’s but i will reach that bridge when i actually build a hybrid unit lol.
That boot code sounds awesome btw!
great. if you are only going with sensors then just a 5v 5A power supply will do. If you are going with kessil or dosers, then you need a dual output (12v and 5v) PSU or a single 12 v PSU and a converter to step down 12v to 5v .
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,232
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.

I started doing the complete opposite of an apex and have come to a similar conclusion that a GLH approach will also best suit my needs. Initially I really wanted to avoid wires going everywhere and keep it as compact as possible so I was going for an AIO enclosure - 16 power outlets, Raspberry pi, probes, PWM etc. all together to minimise external wiring.

While putting my build together I have realised that it's not going to be as functional and compact as I would like and it's very hard to manage the wires internally when doing 16 AC outlets + everything else :p

I'm now planning on doing 2x 8 outlet power bars, a remote PWM module (to go up in my hood with the LED lights) and then a main hub for everything else (Raspberry pi, probes and anything else in the future).

I've had to order a few new parts so my build is on hold for a month or two while they arrive but it gives me time to play with my new 3D printer and see if I can design and 3D print the enclosures I need :)

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.
Just a couple of days ago I made the decision to go with RJ-45 connectors. They are compact, clean and once you have the special crimp they appear very easy to do (might even be able to wire multiple float switches to 1 RJ-45 plug?)

The special crimp required almost put me off but I found one on ebay with a cable tester for only $11 which is next to nothing considering it will enable me to quite cheaply make multiple cables of different lengths to suit my needs. Then I was able to get 20 PCB mount female RJ-45 sockets and 20 male plugs with boots for $12. This should be more than enough to get me set up with current Reef-Pi capabilities with a few more for future expansion.

I'll also be using a small 240V AC - 5V DC buck converter inside each power bar enclosure with 8 outlets so I can power the 5v for the relay from that and then I can use all 8 of the RJ-45 wires for the 8 relay signals. That way each power bar will only have 2 cables going to it (AC plug and RJ-45). If I was going to do all 16 relays in one I could just put 2x RJ-45 sockets on it.

I wouldn't discount them completely as after the minor one off purchase of the crimp they appear quite functional to me.
 

Gareth elliott

Read, Tinker, Fail, Learn
View Badges
Joined
May 7, 2017
Messages
5,468
Reaction score
6,935
Location
NJ
Rating - 0%
0   0   0
great. if you are only going with sensors then just a 5v 5A power supply will do. If you are going with kessil or dosers, then you need a dual output (12v and 5v) PSU or a single 12 v PSU and a converter to step down 12v to 5v .

Would the kessil circuit you built be similar to the needs of attaching dimmable t5 retrofit kit?
https://www.bulkreefsupply.com/dimmable-t5-ho-miro-4-retrofit-kit-let-lighting.html

Im several months away from needing this. Although debating if going to do a mini upgrade to 40g before the 92g. And wanted to do t5/led hybrid with my ai primes. And when i do wanted to mimic the ai light schedule on the t5s.

So thinking just build the circuit now so its ready to attach when i need it.
 

Gary G

Active Member
View Badges
Joined
Nov 8, 2016
Messages
128
Reaction score
66
Rating - 0%
0   0   0
;Writing;Nailbiting all this is so over my head youtube to the rescue.
 

Marc Kruithof

New Member
View Badges
Joined
Feb 16, 2018
Messages
14
Reaction score
15
Rating - 0%
0   0   0
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) :)

Like the feedback on the design. Thanks.
I planned to do it a little differend. For the 40 pins RPI connector you can just add more connectors. So it is easy to just stack more boards. For other devices I planned to make other boards. This way I don't need more on this one. Sinse I only plan to add DS18B20 to it, I just placed the output of pin 4 to this board. That's it.


Maybe there is an other option to do. I like to do electronics, so if there are enough people that wants schema's and even designed boards, I'm willing to design those. The only thing is, I have not much spare time left currently.

Regards,
Marc
 

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
I started doing the complete opposite of an apex and have come to a similar conclusion that a GLH approach will also best suit my needs. Initially I really wanted to avoid wires going everywhere and keep it as compact as possible so I was going for an AIO enclosure - 16 power outlets, Raspberry pi, probes, PWM etc. all together to minimise external wiring.

While putting my build together I have realised that it's not going to be as functional and compact as I would like and it's very hard to manage the wires internally when doing 16 AC outlets + everything else :p

I'm now planning on doing 2x 8 outlet power bars, a remote PWM module (to go up in my hood with the LED lights) and then a main hub for everything else (Raspberry pi, probes and anything else in the future).

I've had to order a few new parts so my build is on hold for a month or two while they arrive but it gives me time to play with my new 3D printer and see if I can design and 3D print the enclosures I need :)

Just a couple of days ago I made the decision to go with RJ-45 connectors. They are compact, clean and once you have the special crimp they appear very easy to do (might even be able to wire multiple float switches to 1 RJ-45 plug?)

The special crimp required almost put me off but I found one on ebay with a cable tester for only $11 which is next to nothing considering it will enable me to quite cheaply make multiple cables of different lengths to suit my needs. Then I was able to get 20 PCB mount female RJ-45 sockets and 20 male plugs with boots for $12. This should be more than enough to get me set up with current Reef-Pi capabilities with a few more for future expansion.

I'll also be using a small 240V AC - 5V DC buck converter inside each power bar enclosure with 8 outlets so I can power the 5v for the relay from that and then I can use all 8 of the RJ-45 wires for the 8 relay signals. That way each power bar will only have 2 cables going to it (AC plug and RJ-45). If I was going to do all 16 relays in one I could just put 2x RJ-45 sockets on it.

I wouldn't discount them completely as after the minor one off purchase of the crimp they appear quite functional to me.

Don’t forget a return path / shared ground or your relay signals won’t do much :)

My personal preference is to always use a hardened serial bus and add local MCUs as needed. I see what you’re saying with that RJ45 setup though.
 
OP
OP
Ranjib

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
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).
I prefer 5v relays, just because they are easy to drive with pi (logic level), i guess for 12v relays I have to use a npn transistor. Is there any benefit to this (12v relay)?
 

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
I prefer 5v relays, just because they are easy to drive with pi (logic level), i guess for 12v relays I have to use a npn transistor. Is there any benefit to this (12v relay)?

Well, both (if we are talking about mechanical relays) would need much higher current drive than a Pi pin could handle. There is no major benefit to 12V vs 5V, except that 12V relays may have more variety available.

When switching loads on or off, and as the DC current goes up, I strongly suggest using N channel MOSFETs over the bipolar parts. Better efficiency and simpler operation (no base current).
 
OP
OP
Ranjib

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
Well, both (if we are talking about mechanical relays) would need much higher current drive than a Pi pin could handle. There is no major benefit to 12V vs 5V, except that 12V relays may have more variety available.

When switching loads on or off, and as the DC current goes up, I strongly suggest using N channel MOSFETs over the bipolar parts. Better efficiency and simpler operation (no base current).
I agree,logic level mosfets are lot safe.
Kessil draws very little current, i think around 20-60ma for control logic, hence I recommend normal n channel transistors.
Another place I think i heavily use bipolar/npn transistors are relay boards. Standard sainsmart relays recommend a 2n222 transistor while connecting GPIOs. Though I guess in most builds they are kinda omitted :-/
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,232
Rating - 0%
0   0   0
Don’t forget a return path / shared ground or your relay signals won’t do much :)
My personal preference is to always use a hardened serial bus and add local MCUs as needed. I see what you’re saying with that RJ45 setup though.

If I am powering the relay with 5v from within the power bar enclosure (with a buck converter) do I need a ground wire to go back to the Raspberry Pi? Each of my relays have 10 pins, 8 control wires (one for each channel, which I have going back to the Pi), one for V in and one for ground. At the moment I only have the relays hooked up to the Pi without outlets attached to them (just testing them out) and I have the 8 control wires going to the Pi but both of the V in and ground wires are going to a separate power supply and the relays are switching no worries. So I don't have a ground going back to the Pi, is this wrong?

I agree,logic level mosfets are lot safe.
Kessil draws very little current, i think around 20-60ma for control logic, hence I recommend normal n channel transistors.
Another place I think i heavily use bipolar/npn transistors are relay boards. Standard sainsmart relays recommend a 2n222 transistor while connecting GPIOs. Though I guess in most builds they are kinda omitted :-/
I am going to have a dedicated 240V - 5v 3A buck converter for each relay (8 channel, 5v relays), because there will be more than enough current does that mean a transistor won't be required? Or do they have other benefits? I didn't realise they were recommended so I wasn't going to use them in my initial build either (which didn't get that far before I decided to mix it up haha)
 

Gareth elliott

Read, Tinker, Fail, Learn
View Badges
Joined
May 7, 2017
Messages
5,468
Reaction score
6,935
Location
NJ
Rating - 0%
0   0   0
If I am powering the relay with 5v from within the power bar enclosure (with a buck converter) do I need a ground wire to go back to the Raspberry Pi? Each of my relays have 10 pins, 8 control wires (one for each channel, which I have going back to the Pi), one for V in and one for ground. At the moment I only have the relays hooked up to the Pi without outlets attached to them (just testing them out) and I have the 8 control wires going to the Pi but both of the V in and ground wires are going to a separate power supply and the relays are switching no worries. So I don't have a ground going back to the Pi, is this wrong?


I am going to have a dedicated 240V - 5v 3A buck converter for each relay (8 channel, 5v relays), because there will be more than enough current does that mean a transistor won't be required? Or do they have other benefits? I didn't realise they were recommended so I wasn't going to use them in my initial build either (which didn't get that far before I decided to mix it up haha)

They will each need a ground to complete the vcc circuit. Does not necessarily have to come from the pi, i grounded mine from the power supply for the relays. Only wire that went to the pi was gpio pin.
 
OP
OP
Ranjib

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
If I am powering the relay with 5v from within the power bar enclosure (with a buck converter) do I need a ground wire to go back to the Raspberry Pi? Each of my relays have 10 pins, 8 control wires (one for each channel, which I have going back to the Pi), one for V in and one for ground. At the moment I only have the relays hooked up to the Pi without outlets attached to them (just testing them out) and I have the 8 control wires going to the Pi but both of the V in and ground wires are going to a separate power supply and the relays are switching no worries. So I don't have a ground going back to the Pi, is this wrong?


I am going to have a dedicated 240V - 5v 3A buck converter for each relay (8 channel, 5v relays), because there will be more than enough current does that mean a transistor won't be required? Or do they have other benefits? I didn't realise they were recommended so I wasn't going to use them in my initial build either (which didn't get that far before I decided to mix it up haha)
Yes, the grounds of pi and relays’s buck converter has to be connected.

I think the transistor is required if you go for 12v relays.

I noticed that sauna mart recommends transistor as well, even for 5v relays, I guess to ensure minimal current draw from gpio pins
 
OP
OP
Ranjib

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
They will each need a ground to complete the vcc circuit. Does not necessarily have to come from the pi, i grounded mine from the power supply for the relays. Only wire that went to the pi was gpio pin.
That’s interesting, so pi gnd and relays,s psu gnd are not connected ?
 

MaccaPopEye

Well-Known Member
View Badges
Joined
Jan 5, 2016
Messages
697
Reaction score
1,232
Rating - 0%
0   0   0
Yes, the grounds of pi and relays’s buck converter has to be connected.
I think the transistor is required if you go for 12v relays.
I noticed that sauna mart recommends transistor as well, even for 5v relays, I guess to ensure minimal current draw from gpio pins
That’s interesting, so pi gnd and relays,s psu gnd are not connected ?

So soon I want my pi and relays to all have separate buck converters (3 total - 1 for the pi and 1 for each relay), all fed from separate AC power inputs.

Are you saying that they should all share a single ground? So the Pi, relay 1 and relay 2 all get V in from their separate buck converters but have their ground cables all join together even though the V in is separate?

Or can it all be completely separate from each other so the Pi would have it's own V in and ground connected to it's own buck converter fed by it's own AC source, and then relay 1 and relay 2 would each have their separate V in and ground connected their own buck converters each fed by their own AC source? This is how I was planning to do it but I can figure out another way if I need to.

Currently just to test it out I have the Pi being powered from one lm2596 and both relays are sharing another lm2596 and it is working fine like that (no outlets are connected but the relays open and close when told by ReefPi), but all of it is being powered by a single 12V power supply so I guess all the grounds go back to the same place in the end.

Sorry for the questions, I just want to make sure I understand it all :)
 
OP
OP
Ranjib

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
So soon I want my pi and relays to all have separate buck converters (3 total - 1 for the pi and 1 for each relay), all fed from separate AC power inputs.

Are you saying that they should all share a single ground? So the Pi, relay 1 and relay 2 all get V in from their separate buck converters but have their ground cables all join together even though the V in is separate?

Or can it all be completely separate from each other so the Pi would have it's own V in and ground connected to it's own buck converter fed by it's own AC source, and then relay 1 and relay 2 would each have their separate V in and ground connected their own buck converters each fed by their own AC source? This is how I was planning to do it but I can figure out another way if I need to.

Currently just to test it out I have the Pi being powered from one lm2596 and both relays are sharing another lm2596 and it is working fine like that (no outlets are connected but the relays open and close when told by ReefPi), but all of it is being powered by a single 12V power supply so I guess all the grounds go back to the same place in the end.

Sorry for the questions, I just want to make sure I understand it all :)
Dont apologize for the questions. I am not an expert, and these questions are the ways we all learning :) . So more is merrier to me.

Coming back to the original point, yes, I was under the assumption that the GNDs have to be connected across all the dc psu's. I am likely wrong here, I'll let @theatrus or someone more familiar with electronics to chime in for more concrete answers. If your setup has worked without this, then clearly this is not required. I dont know then if its a good thing to do or we can completely skip it. As part of 2.0 release I am going through each of our circuits and trying to figure out if they can be improved (best practices). Each of reef-pi's current circuit works, but that does not mean they follow the best practices, like the relay's can be drive straight from GPIO but the sainsmart docs recommend using transistor and couple of resistors : https://docs.google.com/file/d/0B5-HND9HJkXWSTQtYlFTZ3VyODA/edit

I can also see that we should recommend capacitors across all PSUs input/output (i.e. lm2596 should have a couple of capacitors in front and back). Since we are using breakout boards, not the IC directly, this might be offered by the board itself, and we dont have to use it (but if someone is using 7805/7810 style regulators directly, they have to).
Another thing I noticed, @theatrus mentioned about adding flyback diodes, I know what they do, but I was not sure if we need that for the relay or any other setup .

I think the point I am trying to address is the reef-pi circuits are working, but can be made better , by using some diodes/resistors/capacitors. They are like uniond, ball valves and gate valves. I know they are good, but I can quite grok when and exactly what values we need. But I am confident as a community we'll go through this and learn it in due process :)
 

Marc Kruithof

New Member
View Badges
Joined
Feb 16, 2018
Messages
14
Reaction score
15
Rating - 0%
0   0   0
So soon I want my pi and relays to all have separate buck converters (3 total - 1 for the pi and 1 for each relay), all fed from separate AC power inputs.

Are you saying that they should all share a single ground? So the Pi, relay 1 and relay 2 all get V in from their separate buck converters but have their ground cables all join together even though the V in is separate?

Or can it all be completely separate from each other so the Pi would have it's own V in and ground connected to it's own buck converter fed by it's own AC source, and then relay 1 and relay 2 would each have their separate V in and ground connected their own buck converters each fed by their own AC source? This is how I was planning to do it but I can figure out another way if I need to.

Currently just to test it out I have the Pi being powered from one lm2596 and both relays are sharing another lm2596 and it is working fine like that (no outlets are connected but the relays open and close when told by ReefPi), but all of it is being powered by a single 12V power supply so I guess all the grounds go back to the same place in the end.

Sorry for the questions, I just want to make sure I understand it all :)

Hi MaccaPopEye,
You can't drive a mechanical relay directly from the RPI. The RPI simpely can't give enought power. So YES you need transistors or FET's to drive relays. Also why do you want two seperate for the relays? is there a specific reason? Can't you make a small drawing for what you want to build? I am sure we can help more if you do. And about ground. As you described it, it looks like you need ground connected from the pi but I'm not sure about how you are planning circuit.
 
OP
OP
Ranjib

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
Hi MaccaPopEye,
You can't drive a mechanical relay directly from the RPI. The RPI simpely can't give enought power. So YES you need transistors or FET's to drive relays. Also why do you want two seperate for the relays? is there a specific reason? Can't you make a small drawing for what you want to build? I am sure we can help more if you do. And about ground. As you described it, it looks like you need ground connected from the pi but I'm not sure about how you are planning circuit.
@Marc Kruithof we are using relay board, which does some of this circuitry , https://www.sainsmart.com/products/8-channel-5v-relay-module
 

Creating a strong bulwark: Did you consider floor support for your reef tank?

  • I put a major focus on floor support.

    Votes: 57 39.6%
  • I put minimal focus on floor support.

    Votes: 33 22.9%
  • I put no focus on floor support.

    Votes: 49 34.0%
  • Other.

    Votes: 5 3.5%
Back
Top