Yeah, thats pretty much what I do,
https://learn.adafruit.com/reef-pi-power-controller/overview
https://learn.adafruit.com/reef-pi-power-controller/overview
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
@Ranjib I used used an lm2596 to drop voltage from 12v to 5v.should work just fine. I'd recommend using uln2803 in between pi GPIO and relay input pins, to keep the current draw from GPIO at minimal.
![]()
@Ranjib I used used an lm2596 to drop voltage from 12v to 5v.
1. If i connect 5v and ground from gpio together with power from lm2596 to the uln2803 the relays work fine
2. If i just connect 5v from gpio to the uln2803 and the ground from lm2596 to the relay board, the led light turns on but the relay doesnt trigger.
3. If i just follow the diagram exactly, nothing works.
BTW, i dont have a pi proto hat yet so i'm doing this all on a breadboard.
@Des Westcott Thanks a bunch. That worked out for me.I think the grounds need to be linked like here
https://www.reef2reef.com/threads/r...troller-based-on-raspberry-pi.289256/page-241
This is exactly Correct and his issue with lights and no action was happening to me in my testing.. Also the power supply power for the relay board does not have to be shared with the uln .They all just need a Common ground.. Using db9 i used the red wire as ground to uln on my pi hat board and then ran ground from relay board to the power supply for relay..I think the grounds need to be linked like here
https://www.reef2reef.com/threads/r...troller-based-on-raspberry-pi.289256/page-241
The python script seems to configure the IO with pull down instead of pull up. This makes it seem like the switch should be wired to 3v3 and GPIO.The circuit is in heatshrink but if I remember correctly it's a just a 10k resistor splitting the ground wire.
Here's the main bit of the python script...
Code:def my_callback(channel): if GPIO.input(8) == GPIO.HIGH: print('\n FLOAT at ' + str(datetime.datetime.now())) log = open("current_water_level.txt", "w") print (('OK | Last flipped at ' + str(datetime.datetime.now())), file = log) else: print('\n SINK at ' + str(datetime.datetime.now())) log = open("current_water_level.txt", "w") print (('Low | Last flipped at ' + str(datetime.datetime.now())), file = log) GPIO.setmode(GPIO.BCM) GPIO.setup(8, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) GPIO.add_event_detect(8, GPIO.BOTH, callback=my_callback)
It's run every few minutes via cron and the status is broadcast via mqtt to my home assistant server which can send out alerts & trigger the top off. I'd prefer getting it into reef-pi so I can trigger the top off directly.
@ranjib can you provide some direction on where I can learn to write such a script and how to apply it with reef pi?Yes, wavemaker is definitely a thing for 3.0 . Theres an existing issue on providing finer grain pwm (say 12bit) control as well. I have already mentioned there that we want to incremenet/decrement interval customizable as well. Together this two will allow us to generate any arbitrary pwm profile. I think we'll introduce a wave profile similar to light profile.
Even in 2.0 reef-pi will provide a jack control api , i.e. users can write a script to directly control the PWM values and generate pretty much anything. at that level (connectors), reef-pi does not really know its light or pump, user can do whatever they want.
That's correct. I misread my pinout. It's on the 3v3 not ground.The python script seems to configure the IO with pull down instead of pull up. This makes it seem like the switch should be wired to 3v3 and GPIO.
Welcome to reef2reef, you'll love it here :-) . We need bit more of the logs to understand why reef-pi is failing. Can you run:Hi,
I am new to the build , have thought looked and followed it for sometime. I am now starting my build and need a bit of help please.
How doe you restart the reef-pi?
Have run "sudo systemctl restart reef-pi.service"
But still getting
* reef-pi.service - raspberry pi based reef tank controller
Loaded: loaded (/lib/systemd/system/reef-pi.service; enabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2018-11-04 20:54:19 SAST; 11s ago
Process: 1509 ExecStart=/usr/bin/reef-pi -config /etc/reef-pi/config.yml (code=exited, status=1/FAILURE)
Main PID: 1509 (code=exited, status=1/FAILURE)
Nov 04 20:54:19 Tank systemd[1]: reef-pi.service: Unit entered failed state.
Nov 04 20:54:19 Tank systemd[1]: reef-pi.service: Failed with result 'exit-code'.
Running attest Noobs and reef-pi-2.0.0-beta-pi3.deb
journalctl -u reef-pi.service
Also share any details around the build you may have: like reef-pi version, pi version, circuit etc.Welcome to reef2reef, you'll love it here :) . We need bit more of the logs to understand why reef-pi is failing. Can you run:
Code:journalctl -u reef-pi.service
It gives a float value of 1, regardless of the actual float position.I don't see anything suspicious here. Things should work. Is is possible for you to check the log? Like, declare an inlet with GPIO 8 and associate it with an ATO, and set the check interval to 5 second (for example), and see what reef-pi says, when you put the float switch in and out of water
Code:journalctl -fu reef-pi.service
ReefControlPi reef-pi[25376]: 2018/11/04 14:27:07 ato sub-system: sensor Float1 value: 1
Here is an example of a feed mode macro from community member John Rudolph Lewis,@ranjib can you provide some direction on where I can learn to write such a script and how to apply it with reef pi?
This means reef-pi is reading it always on... I think its highly unlikely that we have a driver bug in reef-pi, and we are missing something else here, likely configuration related. Did you already shared your configuration screenshot? If not please do, connectors (inlet GPIO 8 ?? ) and ato details (check interval, control pump etc). I just tested ATO again with master (rc-2) release, and I could not find a bug. I am doing a whole lot of field testing now, and will hate to ship reef-pi with bugs like this (if it turns out) :-( . If your issue does not resolve, then I'll create a dedicated issue on this in github and I'll try to reproduce this with actual circuit. I have spare float switches, so no issue on getting this physically verified.It gives a float value of 1, regardless of the actual float position.
Code:ReefControlPi reef-pi[25376]: 2018/11/04 14:27:07 ato sub-system: sensor Float1 value: 1
(running 2.0.0-rc2)
Thank you. Yeah writing code is way outs my league. I'll sit tight and provide insight if I can.Here is an example of a feed mode macro from community member John Rudolph Lewis,
This means reef-pi is reading it always on... I think its highly unlikely that we have a driver bug in reef-pi, and we are missing something else here, likely configuration related. Did you already shared your configuration screenshot? If not please do, connectors (inlet GPIO 8 ?? ) and ato details (check interval, control pump etc). I just tested ATO again with master (rc-2) release, and I could not find a bug. I am doing a whole lot of field testing now, and will hate to ship reef-pi with bugs like this (if it turns out) :-( . If your issue does not resolve, then I'll create a dedicated issue on this in github and I'll try to reproduce this with actual circuit. I have spare float switches, so no issue on getting this physically verified.
This means reef-pi is reading it always on... I think its highly unlikely that we have a driver bug in reef-pi, and we are missing something else here, likely configuration related. Did you already shared your configuration screenshot? If not please do, connectors (inlet GPIO 8 ?? ) and ato details (check interval, control pump etc). I just tested ATO again with master (rc-2) release, and I could not find a bug. I am doing a whole lot of field testing now, and will hate to ship reef-pi with bugs like this (if it turns out) :-( . If your issue does not resolve, then I'll create a dedicated issue on this in github and I'll try to reproduce this with actual circuit. I have spare float switches, so no issue on getting this physically verified.
But it should still not make any difference right?The python script seems to configure the IO with pull down instead of pull up. This makes it seem like the switch should be wired to 3v3 and GPIO.
cat /sys/class/gpio/gpio8/value
Can you upgrade to rc-2? There were bugs where if you have pca9685 enabled but not present in circuit, reef-pi will crash fatallyHave a pi - 3 B and configured pin18 for equipment, just switching a led on and off.
Ran
sudo systemctl stop reef-pi.service
sudo rm -rf /var/lib/reef-pi/reef-pi.db
sudo systemctl start reef-pi.service
So it is up and running now
![]()
![]()