Reef-Pi Controllers: New all-in-one with power bar, and the original Pico

geekengineer

Active Member
View Badges
Joined
Feb 10, 2019
Messages
427
Reaction score
538
Location
South Aurora
Rating - 0%
0   0   0
Speaking of level sensors, I wanted to toy with the idea of making USB modules to expand Reef-Pi, base-board or not. I also wanted to experiment using pressure sensors to determine liquid level in arbitrary amounts (think ATO reservoir, 2-part, etc)

As part of the experiment, I knocked this up:
.....

I was just curious will there be enouph air pressure generated in the tube to detect change in water level? I haven't found an example of what you were planning on doing it so far. There is something similar but requires an input air source. I originally thought you would have to put the sensor at the bottom effectively touching the bottom of the water column. Which of course complicates life if the sensor isn't chemical/saltwater resistant etc..

There is another possibility that looked interesting to me that I came across here below is using a inserted displacer object with a force sensor tied to it.

https://www.sensorsmag.com/components/a-dozen-ways-to-measure-fluid-level-and-how-they-work
 
OP
OP
theatrus

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 was just curious will there be enouph air pressure generated in the tube to detect change in water level? I haven't found an example of what you were planning on doing it so far. There is something similar but requires an input air source. I originally thought you would have to put the sensor at the bottom effectively touching the bottom of the water column. Which of course complicates life if the sensor isn't chemical/saltwater resistant etc..

There is another possibility that looked interesting to me that I came across here below is using a inserted displacer object with a force sensor tied to it.

https://www.sensorsmag.com/components/a-dozen-ways-to-measure-fluid-level-and-how-they-work

Hydrostatic pressure is very small at the depths we are talking about, but there are dual port sensors sensitive enough for this (the listed sensor would for example be too sensitive for a garbage can depth!). The bubbler solution is a great way to ensure the whole system remains purged and accurate, but if the sensor and the tubing doesn't leak, it would not be required.

1 inch of water hydrostatic pressure is 0.03692 PSI subtracting the atmosphere, which the dual port sensor should accomplish easily.

I currently have an ATO running off this principle from Spectrapure, and its been very reliable for many years.
 

geekengineer

Active Member
View Badges
Joined
Feb 10, 2019
Messages
427
Reaction score
538
Location
South Aurora
Rating - 0%
0   0   0
Hydrostatic pressure is very small at the depths we are talking about, but there are dual port sensors sensitive enough for this (the listed sensor would for example be too sensitive for a garbage can depth!). The bubbler solution is a great way to ensure the whole system remains purged and accurate, but if the sensor and the tubing doesn't leak, it would not be required.

1 inch of water hydrostatic pressure is 0.03692 PSI subtracting the atmosphere, which the dual port sensor should accomplish easily.

I currently have an ATO running off this principle from Spectrapure, and its been very reliable for many years.

Thanks.. OK so the sensor has enouph sensitivity makes sense. I assume you would have to get a pressure sensor that is less sensitive then to measure a larger vessel.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
Since I'm running my base board with a 3B+ in an enclosure, I'm starting to look at fans for cooling. This one seems to have a good noise/CFM ratio, but my concern is the current, approx 180mA. Too much for the base board to source?
https://www.arrow.com/en/products/cfm-5010v-052-300/cui-inc
 
OP
OP
theatrus

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
Since I'm running my base board with a 3B+ in an enclosure, I'm starting to look at fans for cooling. This one seems to have a good noise/CFM ratio, but my concern is the current, approx 180mA. Too much for the base board to source?
https://www.arrow.com/en/products/cfm-5010v-052-300/cui-inc

The PSU is tested up to 2A on the 5V side - you may be up there overall in usage but I don't think this is going to be a problem.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
I am wondering if there's a problem with the board, or if I'm doing something wrong.

I am setting up a voltage divider with a 4.7k and 2.2k resistor. Before I connect the output to GP26 (taking into account the swapped labels), I measure 6.9k across the resistors. Once I connect to the GPIO connector, it drops to 5.8k (plus/minus).

Is there something on the board pulling down or up that would lead to this drop? Or a short?

Would 470 and 220 ohm resistors be better, if there is a pulldown?
 
Last edited:
OP
OP
theatrus

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 am wondering if there's a problem with the board, or if I'm doing something wrong.

I am setting up a voltage divider with a 4.7k and 2.2k resistor. Before I connect the output to GP26 (taking into account the swapped labels), I measure 6.9k across the resistors. Once I connect to the GPIO connector, it drops to 5.8k (plus/minus).

Is there something on the board pulling down or up that would lead to this drop? Or a short?

Would 470 and 220 ohm resistors be better, if there is a pulldown?

There is a 2.2k pulldown. Honestly too strong and I’ll revise that upwards later.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
@theatrus I'm trying to use the dtovervlay for gpio-shutdown (on a pin other than I2C), and I'm not seeing the state change on the pin when I push my power button. A continuity check shows it short when the button is pressed (it's a momentary button). But I don't see the state of the GPIO change at all. Based on 'raspi-gpio', then pin is always at 1, even when I short to ground. Any ideas? (I've tried using GPIO17 and GPIO19)

Code:
Name: gpio-shutdown
Info: Initiates a shutdown when GPIO pin changes. The given GPIO pin is configured as an input key that generates KEY_POWER events. This event is handled by systemd-logind by initiating a shutdown. Systemd versions older than 225 need an udev rule
enable listening to the input device:
ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \
SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \
ATTRS{keys}=="116", TAG+="power-switch"

This overlay only handles shutdown. After shutdown, the system can be powered up again by driving GPIO3 low. The default configuration uses GPIO3 with a pullup, so if you connect a button between GPIO3 and GND (pin 5 and 6 on the 40-pin header),
you get a shutdown and power-up button.

Load: dtoverlay=gpio-shutdown,<param>=<val>

Params: gpio_pin GPIO pin to trigger on (default 3)

active_low When this is 1 (active low), a falling edge generates a key down event and a
rising edge generates a key up event. When this is 0 (active high), this is reversed. The default is 1 (active low).

gpio_pull Desired pull-up/down state (off, down, up) Default is "up".
Note that the default pin (GPIO3) has an external pullup.[code]
 
Last edited:

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
@theatrus I'm trying to use the dtovervlay for gpio-shutdown (on a pin other than I2C), and I'm not seeing the state change on the pin when I push my power button. A continuity check shows it short when the button is pressed (it's a momentary button). But I don't see the state of the GPIO change at all. Based on 'raspi-gpio', then pin is always at 1, even when I short to ground. Any ideas? (I've tried using GPIO17 and GPIO19)

Code:
Name: gpio-shutdown
Info: Initiates a shutdown when GPIO pin changes. The given GPIO pin is configured as an input key that generates KEY_POWER events. This event is handled by systemd-logind by initiating a shutdown. Systemd versions older than 225 need an udev rule
enable listening to the input device:
ACTION!="REMOVE", SUBSYSTEM=="input", KERNEL=="event*", \
SUBSYSTEMS=="platform", DRIVERS=="gpio-keys", \
ATTRS{keys}=="116", TAG+="power-switch"

This overlay only handles shutdown. After shutdown, the system can be powered up again by driving GPIO3 low. The default configuration uses GPIO3 with a pullup, so if you connect a button between GPIO3 and GND (pin 5 and 6 on the 40-pin header),
you get a shutdown and power-up button.

Load: dtoverlay=gpio-shutdown,<param>=<val>

Params: gpio_pin GPIO pin to trigger on (default 3)

active_low When this is 1 (active low), a falling edge generates a key down event and a
rising edge generates a key up event. When this is 0 (active high), this is reversed. The default is 1 (active low).

gpio_pull Desired pull-up/down state (off, down, up) Default is "up".
Note that the default pin (GPIO3) has an external pullup.[code]

When I use the GPIO pins directly on the Pi, I get the intended behavior. I'm guessing the pulldowns (or more likely, pullups, since i can never get the pin to go to ground) are again interfering in some way? Is there a way around this (minus getting a hat so that I can get access to the pins directly?
 
Last edited:
OP
OP
theatrus

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
When I use the GPIO pins directly on the Pi, I get the intended behavior. I'm guessing the pulldowns (or more likely, pullups, since i can never get the pin to go to ground) are again interfering in some way? Is there a way around this (minus getting a hat so that I can get access to the pins directly?

The I2C pins? You would have to isolate them from the board (cut the pins or ribbon). There are a lot of active components on the bus.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
Also, any way to get a power LED 'exported' so that it can be visible outside an enclosure? I've noticed all pins on the board are still powered even when the Pi itself is shutdown...
 
OP
OP
theatrus

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
OP
OP
theatrus

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
Also, any way to get a power LED 'exported' so that it can be visible outside an enclosure? I've noticed all pins on the board are still powered even when the Pi itself is shutdown...

If the Pi is in a half state, it still has power applied (though hopefully the core is in a sleep state). I don’t think the Pi has any power control over its USB ports? If it does, that may provide a handy indicator.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
19 is not connected to anything on the Pico board. 17 and 27 run to an output buffer but have no other pull ups or downs.

https://github.com/blueacro/reefpi-pico/blob/master/reefpi_pico_v2.pdf

You’ll need to map Px names on page 2 over to page 5
Hmm that's odd about 17. Why am I seeing it at a logical 1 on the Pico board? (From doing a raspi-gpio get 17 via ssh)

After doing further testing on just the Pi, it looks like the only way to get a button to do both startup and shutdown is to use GP3, which is going to be used for the pH probes. Using another pin only gets shutdown capability...which might be ok. Just gotta get it working.
 

dmolavi

Well-Known Member
View Badges
Joined
Jan 3, 2015
Messages
509
Reaction score
644
Location
United States
Rating - 0%
0   0   0
Got the power off working:
Code:
dtoverlay=gpio-shutdown,gpio_pin=19,active_low=0

I then have my momentary switch between 19 and 3.3v on a rail (provided by the 1wire connection).

It doesn't do power on, but that's ok.

WRT an LED - The 5V outputs on the Pico board are always hot, it looks, since power to the Pico is independent of the state of the Pi. This is actually good info - means that even if the Pi shuts down/reboots, stuff will stay on.

Are there any pins on the Pico that are tied to Pi power at all? I can go the USB route, but space is tight to get a connector in there
 

Algae invading algae: Have you had unwanted algae in your good macroalgae?

  • I regularly have unwanted algae in my macroalgae.

    Votes: 39 34.2%
  • I occasionally have unwanted algae in my macroalgae.

    Votes: 23 20.2%
  • I rarely have unwanted algae in my macroalgae.

    Votes: 9 7.9%
  • I never have unwanted algae in my macroalgae.

    Votes: 8 7.0%
  • I don’t have macroalgae.

    Votes: 31 27.2%
  • Other.

    Votes: 4 3.5%
Back
Top