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

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
I'm planning on a small "nano" (I'm calling it a mini) build, and have been looking at what I'd like to monitor from a Reef-Pi perspective on that smaller system. Right now, my main 90g is "hard plumbed" (its actually a reservoir in the garage + a Spectrapure Peristaltic ATO pump) for automatic top-off, which means I only have to move water around when I need to do a water change (though one day I may make that easier too ;)). Its also run on a Calcium reactor. Neither of these would work with space or plumbing in the mini tank's location.

I love automation and I suck at remembering to do things as simple as emptying the skimmer cup, and ATO water and replacing 2-part solutions would also be a thing oft forgotten. To that end, I'd like to monitor and alert on levels of these liquids.

Inspired by the Spectrapure ATO pump, I realized using a pressure sensor with a rigid tube immersed in the reservoir (full of air) would be a fantastic method of measuring liquid level. I'm going to try to experiment a bit with this, and it adds another sensor type to Reef-Pi (analog level).

Specifically, I'm looking at this sensor:

https://www.digikey.com/product-detail/en/nxp-usa-inc/MPXV7002DP/MPXV7002DP-ND/1168436

Its cheap, its differential (or else you also make a barometer as well!), and the signal range would allow you to measure up to 20cm of depth. Subbing out a different sensor gives more depth capability as the range increases.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
@Ranjib can I use this instead of point to point wiring your circuit for the doser?

Motordriver-500x500.jpg
Yes absolutely ...
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I only have 2 lights that have the dimmers so I could go with the pi for now and if I upgrade the other light expand at that time. If I use the pi where do I need to connect it to and then how do i control it with reef-pi, where should I start with my testing number wise for the pwm control?

I actually think this may be easier than I first thought, i understand from looking at the wiring on th transistor how that fits into the circuit just not sure how to tie it into the pi from the pwm stand point. I will need to feed it 12v from the pi, thats easy and then tie it into the pwm circuit. Will go and see if I can figure out which pins are for pwm.

One additional question, I guess if I end up driving both led's from the pi, my current ps is 2.5amps, I am guessing I will need to beef that up, your thoughts? i have lots of power supplies since I do a lot of building of things, I think I have one that will put out 5amps at 12v if needed, just bigger brick to hide, lol.

Thanks :)
In Raspberry Pi GPIO18 and 19 is used for pwm, in reef-pi you'll declare them as pin 0 (gpio18) and pin 1 (gpio 19), with driver "rpi". Use https://reef-pi.github.io/guides/electronics/ to understand the physical positions of GPIO18 and 19.
You will not feed the transistor from pi, but from your power adapter (12 V). Pi will be fed 5v generated from an LM2596 that feeds from 12V and converts it into 5V for Pi's consumption, does that make sense?
If you dont have lm2596, then use two different power supply, 5v for pi and 12v for npn transistor's collector pin. Make sure to connect the GND's of both power supply in your circuit. You should not need more than 12V 1A for the whole thing (pi + control circuit)
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,244
Location
Columbia MD
Rating - 0%
0   0   0
@Ranjib can I use this instead of point to point wiring your circuit for the doser?

Motordriver-500x500.jpg

This will work. I am doing something similar. Vcc2 will be the source voltage for whatever your motors require, pwm inputs will be pins 18 and 19 (don’t forget to enable pwm in in the config file), and the other inputs will be 4 unused GPIO pins of your choosing. You will set the polarity of the motors with the virtual outputs in reefpi like in the guide.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Thank you, I'll order up the components, I have most parts ready from a failed arduino (it worked, apart from the rtc,5 modules later I gave up) build so hopefully should be straight forward. I'll start a build thread once I'm ready.
Awesome. Keep us posted, and thank you for giving reef-pi a try
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I'm planning on a small "nano" (I'm calling it a mini) build, and have been looking at what I'd like to monitor from a Reef-Pi perspective on that smaller system. Right now, my main 90g is "hard plumbed" (its actually a reservoir in the garage + a Spectrapure Peristaltic ATO pump) for automatic top-off, which means I only have to move water around when I need to do a water change (though one day I may make that easier too ;)). Its also run on a Calcium reactor. Neither of these would work with space or plumbing in the mini tank's location.

I love automation and I suck at remembering to do things as simple as emptying the skimmer cup, and ATO water and replacing 2-part solutions would also be a thing oft forgotten. To that end, I'd like to monitor and alert on levels of these liquids.

Inspired by the Spectrapure ATO pump, I realized using a pressure sensor with a rigid tube immersed in the reservoir (full of air) would be a fantastic method of measuring liquid level. I'm going to try to experiment a bit with this, and it adds another sensor type to Reef-Pi (analog level).

Specifically, I'm looking at this sensor:

https://www.digikey.com/product-detail/en/nxp-usa-inc/MPXV7002DP/MPXV7002DP-ND/1168436

Its cheap, its differential (or else you also make a barometer as well!), and the signal range would allow you to measure up to 20cm of depth. Subbing out a different sensor gives more depth capability as the range increases.
I think its an awesome idea. Very early version of reef-pi (then called as reefer) had mcp3008 based etape integration , which also gave similar information. But I didnt see whole lot of initial use case, and SPI is more wires.. so i dropped those bits
 

Kampo

Active Member
View Badges
Joined
Dec 19, 2017
Messages
349
Reaction score
327
Location
South West Michigan
Rating - 0%
0   0   0
I remember reading some mention that there was talk in adding support for dc wavemakers and pumps. what brand were you going to start with? I know the jabeo line can be run with a brusless dc motor contorller with PWM+24V so techinically could almost control them now, just need the logic added for the wavemaker, and prolly the pump as well.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
In Raspberry Pi GPIO18 and 19 is used for pwm, in reef-pi you'll declare them as pin 0 (gpio18) and pin 1 (gpio 19), with driver "rpi". Use https://reef-pi.github.io/guides/electronics/ to understand the physical positions of GPIO18 and 19.
You will not feed the transistor from pi, but from your power adapter (12 V). Pi will be fed 5v generated from an LM2596 that feeds from 12V and converts it into 5V for Pi's consumption, does that make sense?
If you dont have lm2596, then use two different power supply, 5v for pi and 12v for npn transistor's collector pin. Make sure to connect the GND's of both power supply in your circuit. You should not need more than 12V 1A for the whole thing (pi + control circuit)

I have a better idea trying to make my shopping list, on your builds with the break out boards you are using resistors, will I need any resistors when using the 2 pi pwm outputs? My thoughts are that I will purchase a small proto board for the npn transistors feeding that 12v from my existing pi ground controller circuit and then output to female jacks. What I am not sure about is will I need any resistors like you are using in the diagrams with the adafruit pwm breakout boards.

Here is my shopping list if anyone can chime in will be leaving soon for the store:

npn transistors <70ma
resistors 10k, 1k, 2.2k (will grab some not sure if needed)
5.5/2.1 dc power plug(s) for jumpers to lights
small proto board

I already have 5.5 female power plugs
jumper cables etc...

Anything else that I might need to complete the build?

Thanks:)
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
646
Location
United States
Rating - 0%
0   0   0
I have a better idea trying to make my shopping list, on your builds with the break out boards you are using resistors, will I need any resistors when using the 2 pi pwm outputs? My thoughts are that I will purchase a small proto board for the npn transistors feeding that 12v from my existing pi ground controller circuit and then output to female jacks. What I am not sure about is will I need any resistors like you are using in the diagrams with the adafruit pwm breakout boards.

Here is my shopping list if anyone can chime in will be leaving soon for the store:

npn transistors <70ma
resistors 10k, 1k, 2.2k (will grab some not sure if needed)
5.5/2.1 dc power plug(s) for jumpers to lights
small proto board

I already have 5.5 female power plugs
jumper cables etc...

Anything else that I might need to complete the build?

Thanks:)

I can't answer your questions, but I'm jealous that you live close enough to a hobby electronics store to make a trip. The nearest to me is almost an hour away. These are the days I miss Radio Shack.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I have a better idea trying to make my shopping list, on your builds with the break out boards you are using resistors, will I need any resistors when using the 2 pi pwm outputs? My thoughts are that I will purchase a small proto board for the npn transistors feeding that 12v from my existing pi ground controller circuit and then output to female jacks. What I am not sure about is will I need any resistors like you are using in the diagrams with the adafruit pwm breakout boards.

Here is my shopping list if anyone can chime in will be leaving soon for the store:

npn transistors <70ma
resistors 10k, 1k, 2.2k (will grab some not sure if needed)
5.5/2.1 dc power plug(s) for jumpers to lights
small proto board

I already have 5.5 female power plugs
jumper cables etc...

Anything else that I might need to complete the build?

Thanks:)
Get few 4.7k resistor, couple of logic level power mosfets for backup
 

b4tn

Valuable Member
View Badges
Joined
Jun 17, 2015
Messages
1,673
Reaction score
2,244
Location
Columbia MD
Rating - 0%
0   0   0
I have a better idea trying to make my shopping list, on your builds with the break out boards you are using resistors, will I need any resistors when using the 2 pi pwm outputs? My thoughts are that I will purchase a small proto board for the npn transistors feeding that 12v from my existing pi ground controller circuit and then output to female jacks. What I am not sure about is will I need any resistors like you are using in the diagrams with the adafruit pwm breakout boards.

Here is my shopping list if anyone can chime in will be leaving soon for the store:

npn transistors <70ma
resistors 10k, 1k, 2.2k (will grab some not sure if needed)
5.5/2.1 dc power plug(s) for jumpers to lights
small proto board

I already have 5.5 female power plugs
jumper cables etc...

Anything else that I might need to complete the build?

Thanks:)

I got this
https://www.amazon.com/gp/product/B01N1T1GSP/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1
It was cheap enough to justify probably never ruinning out of resistors for my small projects.

That being said there are to many unknown variables to determine which resistor to use. You need the gain (hFE) of the transistor, the amount of current you want to pass, and need to calculate from there. The minimum current at the base is the collector current divided by the gain. So just for example if you are passing 40mA at the collector and the transistor gain is 35 it would be 40/35=1mA. So the base resistor needs to pass 1mA to operate with one end at 3v3 (pi PWM Voltage but could be different if using the PCA 9685) and the other at 0.7v (the base-emitter junction voltage) so 2.6v across it. Using ohms law that resistor should be 2k6. However because gain varies greatly and its not going to hurt to throw a little more current at it a 1k resistor should work to make sure the transistor is saturated with more than 1mA.

I am learning as well so sorry if thats a confusing explanation.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I remember reading some mention that there was talk in adding support for dc wavemakers and pumps. what brand were you going to start with? I know the jabeo line can be run with a brusless dc motor contorller with PWM+24V so techinically could almost control them now, just need the logic added for the wavemaker, and prolly the pump as well.
Yes I wanted to do this for 2.0 but didn’t get enough time . It is slated for 3.0 and we know a lot more now (bldc drivers , control signals for different jebao pumps etc) than before. But this still needs software works and field testing. I ll be working on a feature related to custom profiles (ability to define arbitrary wave forms) before the wave maker . I have a bldc driver board from drok, and I think that’s all I need (profile + bldc driver ) and reuse everything that exists ( pca9685/rpi integration, lights ui ) for field testing at least
 

crusso1993

7500 Club Member
View Badges
Joined
Oct 21, 2018
Messages
8,671
Reaction score
44,651
Location
SW, FL, USA
Rating - 0%
0   0   0
I can't answer your questions, but I'm jealous that you live close enough to a hobby electronics store to make a trip. The nearest to me is almost an hour away. These are the days I miss Radio Shack.

No doubt that many, many people miss Radio Shack!
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,077
Location
Gambrills
Rating - 0%
0   0   0
Finally got my ribbon cable, and I'm updating all the software now. I was on reef-pi 1.0 for pi3, now I'm taking it to 2.0, and updating the OS as well. I was unable to add any outlets when I fired everything up, so either the ribbon cable is backward, my db-9 cable is the wrong one, or it simply needed to be updated. I'll know soon enough.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
Finally got my ribbon cable, and I'm updating all the software now. I was on reef-pi 1.0 for pi3, now I'm taking it to 2.0, and updating the OS as well. I was unable to add any outlets when I fired everything up, so either the ribbon cable is backward, my db-9 cable is the wrong one, or it simply needed to be updated. I'll know soon enough.
Unfortunately, you have to re-create everything in 2.0
 

DirtDiggler2823

If I can't break it, it doesn't exist
View Badges
Joined
Jul 31, 2018
Messages
1,667
Reaction score
2,077
Location
Gambrills
Rating - 0%
0   0   0
Unfortunately, you have to re-create everything in 2.0

I loaded all the software previously when I first started, months ago, but I had no ancillary hardware on the machine until today. I've just added all of the connectors, and I got an error on the J3 rpi jack.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I can't answer your questions, but I'm jealous that you live close enough to a hobby electronics store to make a trip. The nearest to me is almost an hour away. These are the days I miss Radio Shack.

Yeah I am fortunate to have a local store and its a great store, its near my work which is 30min away but they have anything you could possibly want, Gateway Electronics, see pictures, hard to do it justice but aisle and aisles of stuff! :)

Also attached are my non reef aquariums, nothing near as nice as what you guys have but what I am going to use reefpi for...

IMG_20190102_131412(1).jpg


IMG_20190102_135550.jpg


IMG_20190102_142959.jpg


00100dPORTRAIT_00100_BURST20190102114522022_COVER.jpg


00100dPORTRAIT_00100_BURST20190102114934090_COVER.jpg


00100dPORTRAIT_00100_BURST20190102114952991_COVER.jpg
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Get few 4.7k resistor, couple of logic level power mosfets for backup

I purchased everything on my list including the mosfets, I think I understand the basic idea of how to hook thinks up, I have a bread board and will use that initially to work things up. I purchased a small proto board that I can transfer things permanently once I have things worked out. Looking at your guide I understand how things are laid out for the most part but not sure about the resistors, if I will need one and if so what size.

If anyone has some thoughts on how to proceed, I would welcome the input. :)
 
Back
Top