Illuminated Momentary Button with Reef-Pi

wizzlebippi

New Member
View Badges
Joined
Jan 8, 2022
Messages
12
Reaction score
19
Location
United States
What state or country do you live in
Kansas
Rating - 0%
0   0   0
I'm working through a more integrated build for reef-pi and have run into something I'm struggling to find information on. Previously, I used a raspberry pi touchscreen to view status and control my system, but that's been up close and personal with water many times and I'd like to retire it. The only thing I really need a local control for is a button to turn off the pump and heater for 10 minutes to feed the fish. Ideally, I'd like this to be an illuminated momentary button with the logic of light on = fish not fed today, blinking is feed fish macro active, and light off is fish have been fed.

How would a momentary button be integrated into reef-pi?
Is there a way to monitor if a macro has ran today?

Thanks
 
I'm working through a more integrated build for reef-pi and have run into something I'm struggling to find information on. Previously, I used a raspberry pi touchscreen to view status and control my system, but that's been up close and personal with water many times and I'd like to retire it. The only thing I really need a local control for is a button to turn off the pump and heater for 10 minutes to feed the fish. Ideally, I'd like this to be an illuminated momentary button with the logic of light on = fish not fed today, blinking is feed fish macro active, and light off is fish have been fed.

How would a momentary button be integrated into reef-pi?
Is there a way to monitor if a macro has ran today?

Thanks
I could be wrong, someone please correct me if I am, but I don't believe a momentary switch will work as the system is continually monitoring it so you would need to keep the button held for the full duration.
 
I could be wrong, someone please correct me if I am, but I don't believe a momentary switch will work as the system is continually monitoring it so you would need to keep the button held for the full duration.
I've seen some evidence that reef-pi can sample an input at up to 1Hz, so the input only needs to be active for 1 second. A 555 timer can stretch a momentary input for a few seconds, so this shouldn't be a problem.
 
I am looking into this - I am looking into using a PyPortal Pynt to present a Screen with temp and ph and a button to feed. But you need(or could use a physical button) to communicate with the reef-pi API.
From my understanding, you basically need to craft a macro in reef-pi, then use an API call to invoke that macro (let’s call the macro “feed fish” and turns off pumps for 10 mins - it has a macro if of “1”)

we’d need to have an arduino or microcontroller that activates on button push and sends an HTTP request to reef-pi’s API to start macro #1.

that’s it, it’s actually straightforward if you know your way around the buttons and arduino stuff already.
 
So far, I've setup a macro that turns the pump and heater off for 10 minutes, and I bought a 555 timer IC. Setting up the 555 IC in a monostable one shot configuration, with a 22uF capacitor and 100k ohm resistor will apply an approximately 2.4 second pulse to a pin.


I then added an inlet, created a macro to blink the aquarium light off for 5 seconds, and set up ATO to watch that pin every 2 seconds. When I pressed the button, the light turned off about a second later.
 
I am looking into this - I am looking into using a PyPortal Pynt to present a Screen with temp and ph and a button to feed. But you need(or could use a physical button) to communicate with the reef-pi API.
From my understanding, you basically need to craft a macro in reef-pi, then use an API call to invoke that macro (let’s call the macro “feed fish” and turns off pumps for 10 mins - it has a macro if of “1”)

we’d need to have an arduino or microcontroller that activates on button push and sends an HTTP request to reef-pi’s API to start macro #1.

that’s it, it’s actually straightforward if you know your way around the buttons and arduino stuff already.
Yup. this is the best way i can think of. I think you can use a small python script to monitor a gpio pin and trigger the macro using api accordingly. You'll need some hysteresis (like 2-5s ) to avoid double trigger. But this will result in instantaneous trigger.
 
After some soldering, troubleshooting, and realizing a stupid mistake, I've added the illuminated momentary button to my system.

For the timer, the Texas Instruments TLC555 chip I ordered required that the reset pin be connected to power, and in the guide I posted that pin is not connected to anything. Also, the TLC555 requires at least 5V to operate, so a voltage divider was needed to keep the output voltage below 3.3V to not damage the raspberry pi.

The momentary button I had needed 12V for the LED, so I added a transistor to work as a switch for the LED.

Here's a picture of my perma-proto hat. You might recognize this from the adafruit power controller guide, or at least that's where it started. The TLC555 timer is the small chip on the right, and the transistor to control the LED is on the bottom left.

IMG_20220320_144410.jpg
 
Looks awesome. Is it working as expected? This is an awesome example of 555 timer usage and some basic electronics (transistor controlled 12v gating)
 
Looks awesome. Is it working as expected? This is an awesome example of 555 timer usage and some basic electronics (transistor controlled 12v gating)
Thanks. I prefer hardware solutions for things that shouldn't change.

To configure reef-pi, I added the inlet, built a non-reversible macro (very important), and added an ATO function to watch the pin every 2 seconds.

I did have to make one additional change to make this work reliably outside of reef-pi. I pulled the read pin low at boot by adding gpio={pin number}=pd to /boot/config.txt.

I'd still like some way to track if my feed fish macro has been ran today, but there's no obvious way to log macro usage that I've found.

In other news, my webcam is back online as a part of this mod: http://feedingfrenzy.ddns.net
 
Last edited:

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%

New Posts

Back
Top