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

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
Just for clarification please, is that "pin" number or "gpio" number?
@philshel i forgot to clarify, your question was around the pin number in reef-pi UI or in raspberry pi physical pinout?
In physical pinout its GPIO18 and 19 , i.e. when you wire things up use them ,as those are the two pins thats used for pwm.
In reef-pi UI, use 0 or/and 1 for pin number, and driver rpi. This is because linux kernel maps GPIO18 as pwm pin 0 and GPIO19 as pin 1(/sys/class/pwm/pwmchip0/pwm0 or /sys/class/pwm/pwmchip0/pwm1).
 
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
Do you have an example python script that I could use as a starting point that would update the PWM value to each channel every second? Thanks!
Code:
import requests
import time

# This script shows how to update a light using the api
# Lets assume we have a light with ID 1 and that light has only one channel controlled by pin 1 (pca9685)

light_id = "1"
pin = "1"
ip = "127.0.0.1:8080" # IP
auth= ("reef-pi", "reef-pi") #  username and password
u = "http://" + ip + "/api/lights/" + light_id

resp = requests.get(u, auth=auth)
light = resp.json()

for x in range(10):
    light["channels"][pin]["auto"] = False # change the light to fixed mode
    light["channels"][pin]["fixed"] = x * 10   # PWM value in percentage
    resp = requests.post(u, auth=auth, json=light) # update light
    time.sleep(1) # wait for a second

keep hacking!
 

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
Yes
B448D8B0-4C23-43D6-82AA-47C8D5541DEB.jpeg

1A92A16A-04B3-4573-AB66-EDC08623AE1F.jpeg

I am using adj 8 Chanel relay pack for this, which required 12v per channel on/off signal. The wiring is reverse (shared power and individual channel is sink ) because I had uln2803 which is a sink type darlington.
Power controller build with housing and without wiring
8A5214BA-F863-40C6-B4D6-AF53F84933E4.jpeg

With wiring
B10BDE45-29EF-484D-9A68-400A07578959.jpeg

The whole set with adj srp 2 , 8 channel power strip , connected by db9 cable
AC742520-1A5C-4A53-87EA-7139CE735487.jpeg

Could you get rid of the Junction box by using something like this?

https://www.monoprice.com/product?p...R23eExJQ7wzxbrWnA1GDhkh1kCd17jTcaAgfSEALw_wcB
 
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


Could you get rid of the Junction box by using something like this?

https://www.monoprice.com/product?p...R23eExJQ7wzxbrWnA1GDhkh1kCd17jTcaAgfSEALw_wcB
I dont think so. You are using the USB connector, but the powerstrip expects 12v on/off signal passed through the db9 connector. So, if you use this connector, you'll still need a junction box where you'll mount a usb breakout connector, and then pass the 12v signal. Pi is a 5v device, USB standard specs are all 5v based (A & B) https://www.beyondlogic.org/usbnutshell/usb2.shtml
 

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
I dont think so. You are using the USB connector, but the powerstrip expects 12v on/off signal passed through the db9 connector. So, if you use this connector, you'll still need a junction box where you'll mount a usb breakout connector, and then pass the 12v signal. Pi is a 5v device, USB standard specs are all 5v based (A & B) https://www.beyondlogic.org/usbnutshell/usb2.shtml

Has to be a easy way to setup the voltage.

StarTech.com USB to Serial Adapter – 1 port – USB Powered – FTDI USB UART Chip – DB9 (9-pin) – USB to RS232 Adapter https://www.amazon.com/dp/B004ZMYTYC/ref=cm_sw_r_cp_api_i_NqdiBbJSB8GB1
 
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, you want to do USB programming in Pi then connect this thing with Pi using USB, add another power supply (otherwise you wont get 12v) and then connect the power strip with this intermediate device?

I think this is way more complicated.. both on hardware as well as on software side. If you are up for coding the USB part, give it a shot and let us know how it went
 

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
So, you want to do USB programming in Pi then connect this thing with Pi using USB, add another power supply (otherwise you wont get 12v) and then connect the power strip with this intermediate device?

I think this is way more complicated.. both on hardware as well as on software side. If you are up for coding the USB part, give it a shot and let us know how it went

I guess my thought is it would be much easier for the average person to do this. Once the coding was done. No soldering, no special boards. Just a power adapter, the power strip and a junction box. Also wonder if you had 4 what else you could do. Just a thought and I would need to understand the coding more.
 
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 guess my thought is it would be much easier for the average person to do this. Once the coding was done. No soldering, no special boards. Just a power adapter, the power strip and a junction box. Also wonder if you had 4 what else you could do. Just a thought and I would need to understand the coding more.
Probably I am overreacting, but I doubt it will be that trivial. You'll need an intermediate box (like the one you have specified) and power supply for that. I am still not sure if that box in turn can generate 12v on/off signal. Remember that this intermediate component pronises to let users convert USB to serial data, but the power strip does not quiet use the db9 connector for serial communication, its a mere connector that has 9 pin, and the powerstrip uses 8 of them to control 8 relay and another one for +ve. Its not used for data (i.e. there is no clock synchronization involved). There are other USB controlled poweroutlet as well (search for PowerUSB), but those are rather hard to resource, and not very opensource friendly (like we dont know whats the protocol to control them, no code is available in opensource).
 

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
Probably I am overreacting, but I doubt it will be that trivial. You'll need an intermediate box (like the one you have specified) and power supply for that. I am still not sure if that box in turn can generate 12v on/off signal. Remember that this intermediate component pronises to let users convert USB to serial data, but the power strip does not quiet use the db9 connector for serial communication, its a mere connector that has 9 pin, and the powerstrip uses 8 of them to control 8 relay and another one for +ve. Its not used for data (i.e. there is no clock synchronization involved). There are other USB controlled poweroutlet as well (search for PowerUSB), but those are rather hard to resource, and not very opensource friendly (like we dont know whats the protocol to control them, no code is available in opensource).

Nothing is ever simple...but I do like the power-bar. If it was possible to control 2-4 Db9 connections it could open up a lot of options.
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
I am completely lost as to what that star tech db9 box would do for us.. I have 4 Items powered and run thru db9 cables.. Each of the devices.. Relays, Lights, Dosing pump , Float and temp sensors... Each item such as the relays , Use there own power supply and only share a common ground with the Break out box and Pi..

Instead of integrating more things thru one Proprietary device There should be A Wide Focus on Optimizing the ability to Make your Controller (Individual users) More Module and each part independent of the other . This will give easier Trouble shooting of issues, Better code Bug workout, Easier integration of updated electronics Design and circuitry without rebuilding the whole controller. and A Much safer project with each item running under its own power source..

Just my Opinion.. Good Luck to everyone ..
 

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
I am completely lost as to what that star tech db9 box would do for us.. I have 4 Items powered and run thru db9 cables.. Each of the devices.. Relays, Lights, Dosing pump , Float and temp sensors... Each item such as the relays , Use there own power supply and only share a common ground with the Break out box and Pi..

Instead of integrating more things thru one Proprietary device There should be A Wide Focus on Optimizing the ability to Make your Controller (Individual users) More Module and each part independent of the other . This will give easier Trouble shooting of issues, Better code Bug workout and A Much safer project with each item running under its own power source..

Just my Opinion.. Good Luck to everyone ..

Always be pros and cons to everything.

The only thing I really going to have to disagree with is the more power sources. We are dealing with electricity and water, low voltage is a good thing but 5 modules and 5+ power supplies is not a good thing. Plus 8 + more plugs for equipment. By the time it is all said and done you have at least 14 spots where water can get in and cause a fire. Not to mention the space used for all the power bricks and any additional heat created .

I like my setups clean and this is just a equation for a rats nest of wires. Seems like a big con to me.

Cool project but a massive one at that. Got to give the guy props for all the hard work.
 

Erica-Renee

Valuable Member
View Badges
Joined
Oct 4, 2017
Messages
1,596
Reaction score
3,290
Location
lost
Rating - 0%
0   0   0
Always be pros and cons to everything.

The only thing I really going to have to disagree with is the more power sources. We are dealing with electricity and water, low voltage is a good thing but 5 modules and 5+ power supplies is not a good thing. Plus 8 + more plugs for equipment. By the time it is all said and done you have at least 14 spots where water can get in and cause a fire. Not to mention the space used for all the power bricks and any additional heat created .

I like my setups clean and this is just a equation for a rats nest of wires. Seems like a big con to me.

Cool project but a massive one at that. Got to give the guy props for all the hard work.

Its not a big bunch of power supplies..
My Relay module.. has a 120v to 5v power converter ...
My break out box
houses Lighting pwm , temp sensors , float switches, and sense wiring for Dosing pumps .
I have a 3v and a 5v power supply connector
then the pi itself has its own usb power supply..
The Dosing pump will have its own power supply
The Lights will have there own power supply
You can plug them into relay controlled outlets as a added layer of safety

I have tested plugging my Dosing pump power supply into a outlet Controlled by a ATO Switch . Set this switch a bit higher then your normal running water level.. If the pumps run the outlet will be turned off there for stopping over dosing..

You can also add a low water level switch and connect to your return pump. Shutting off the water in if your ATO Fails.
I have a Reeflo hammerhead pump . it has not logic at at in it..

So some things can share a common power supply .Some its best to not do so...

Thanks
 

Trickman2

Well-Known Member
View Badges
Joined
Jan 31, 2018
Messages
576
Reaction score
483
Location
Poway, Ca
Rating - 0%
0   0   0
Its not a big bunch of power supplies..
My Relay module.. has a 120v to 5v power converter ...
My break out box
houses Lighting pwm , temp sensors , float switches, and sense wiring for Dosing pumps .
I have a 3v and a 5v power supply connector
then the pi itself has its own usb power supply..
The Dosing pump will have its own power supply
The Lights will have there own power supply
You can plug them into relay controlled outlets as a added layer of safety

I have tested plugging my Dosing pump power supply into a outlet Controlled by a ATO Switch . Set this switch a bit higher then your normal running water level.. If the pumps run the outlet will be turned off there for stopping over dosing..

You can also add a low water level switch and connect to your return pump. Shutting off the water in if your ATO Fails.
I have a Reeflo hammerhead pump . it has not logic at at in it..

So some things can share a common power supply .Some its best to not do so...

Thanks

Well that is a common power source...not individual. Which is good to hear. I wonder if there is a site that can print some of these boards out for the modules on demand. Soldier in components into the printed circuit board and 3D print a module box. That would be pretty awesome.
 

LionHeart2017

Active Member
View Badges
Joined
Sep 13, 2017
Messages
185
Reaction score
321
Location
Lincolnshire
Rating - 0%
0   0   0
I'm going to pickup a broken Sony PS2, strip it and see what it can house, hopefully 8 controlled IEC sockets, temp sensor or two, pi3, pi zero for control of the 8 sockets
And go from there, I'm looking for more of a monitor than full control of everything.
 
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
Nothing is ever simple...but I do like the power-bar. If it was possible to control 2-4 Db9 connections it could open up a lot of options.
As of now, it should be ok to control two power strips using two db9 connector, and total 16 outlets . I have plans to work on adding support for mcp23017 after 2.0 release. That will unlock the use of many more of pins. But I doubt we practically need more than a couple
 
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 am completely lost as to what that star tech db9 box would do for us.. I have 4 Items powered and run thru db9 cables.. Each of the devices.. Relays, Lights, Dosing pump , Float and temp sensors... Each item such as the relays , Use there own power supply and only share a common ground with the Break out box and Pi..

Instead of integrating more things thru one Proprietary device There should be A Wide Focus on Optimizing the ability to Make your Controller (Individual users) More Module and each part independent of the other . This will give easier Trouble shooting of issues, Better code Bug workout, Easier integration of updated electronics Design and circuitry without rebuilding the whole controller. and A Much safer project with each item running under its own power source..

Just my Opinion.. Good Luck to everyone ..
I like your opinions. Keep them coming :)
 
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
Always be pros and cons to everything.

The only thing I really going to have to disagree with is the more power sources. We are dealing with electricity and water, low voltage is a good thing but 5 modules and 5+ power supplies is not a good thing. Plus 8 + more plugs for equipment. By the time it is all said and done you have at least 14 spots where water can get in and cause a fire. Not to mention the space used for all the power bricks and any additional heat created .

I like my setups clean and this is just a equation for a rats nest of wires. Seems like a big con to me.

Cool project but a massive one at that. Got to give the guy props for all the hard work.
I have always pondered about using an computer power supply (ATX SMPS) .. but my tanks being nano and pico, never really needed that many pieces of equipment. At most I need 6-8 equipment per tank, and that fits pretty nicely with AIO build with a single power strip. But I can see that this is not enough for larger tank. But I also wonder if you really need light and few other equipment to be controlled by power outlet.. they are rarely switched off and can be put on manual switched outlets (like the ones trip lite sells)
 

When to mix up fish meal: When was the last time you tried a different brand of food for your reef?

  • I regularly change the food that I feed to the tank.

    Votes: 44 21.2%
  • I occasionally change the food that I feed to the tank.

    Votes: 72 34.6%
  • I rarely change the food that I feed to the tank.

    Votes: 69 33.2%
  • I never change the food that I feed to the tank.

    Votes: 19 9.1%
  • Other.

    Votes: 4 1.9%
Back
Top