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

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
I think that might be your problem there. The 12V pins direct from the Hat may not have the current to run your doser pump reliably. The Hat puts out low current 12V for relay switching purposes only, not designed for running equipment.

Try hook it up via a relay and proper 12V power supply and see if you still have the same problem.

Des
Good catch. To expand on this. On the goby hat if you are using the 12v section you are using the uln2803 to drive your motor. This isnt really what this chip is for. This chip is meant to drive small coils i.e. a relay board. It has built in diode suppression to prevent reverse current spikes thru a coil. Its not really meant to run motor loads.

A motor draws a large current spike for an instant until it starts moving then its current levels off. Without going into a long explanation on motor theory, depending on where exactly the motor stops, this starting current changes the next time the motor starts. You may be on the edge here where most times the motor starts but maybe not every time.

What are the specs on your doser pump?
Its a 12V pump but how much current does it take to run it reliably?

As @Des Westcott says the best way to do this is to have the hat drive a relay and have the relay switch a suitable 12v supply for the pump.
 
Last edited:

Phildago

Well-Known Member
View Badges
Joined
Oct 11, 2019
Messages
760
Reaction score
808
Location
Broad Channel
} 11
Good catch. To expand on this. On the goby hat if you are using the 12v section you are using the uln2803 to drive your motor. This isnt really what this chip is for. This chip is meant to drive small coils i.e. a relay board. It has built in diode suppression to prevent reverse current spikes thru a coil. Its not really meant to run motor loads.

A motor draws a large current spike for an instant until it starts moving then its current levels off. Without going into a long explanation on motor theory, depending on where exactly the motor stops, this starting current changes the next time the motor starts. You may be on the edge here where most times the motor starts but maybe not every time.

What are the specs on your doser pump?
Its a 12V pump but how much current does it take to run it reliably?

As @Des Westcott says the best way to do this is to have the hat drive a relay and have the relay switch a suitable 12v supply for the pump.
Okay, so it may be the issue. I certainly can't say it's not. I can say that it produces enough current to run all three pumps simultaneously though.

So then, is there any advantage to a 12 v relay VS 5 v for this purpose?
 

Des Westcott

Active Member
View Badges
Joined
May 29, 2018
Messages
479
Reaction score
802
Location
Durban - South Africa
} 11


Okay, so it may be the issue. I certainly can't say it's not. I can say that it produces enough current to run all three pumps simultaneously though.

So then, is there any advantage to a 12 v relay VS 5 v for this purpose?
@Michael Lane is the person best qualified to comment I guess

I run all 5V relays because that's what I had when I set mine up. I supply the "12V Input" with 5V to run them off that rail. i know @Bigtrout does the same FWIW
 

Phildago

Well-Known Member
View Badges
Joined
Oct 11, 2019
Messages
760
Reaction score
808
Location
Broad Channel
@Michael Lane is the person best qualified to comment I guess

I run all 5V relays because that's what I had when I set mine up. I supply the "12V Input" with 5V to run them off that rail. i know @Bigtrout does the same FWIW
Thanks for your input. Michael had actually recommended not using a relay for this purpose, but maybe you're right with the motor getting stuck in an area where it needs relatively high starting current.

I did a quick read and apparently 12 v supply helps relays work more efficiently. Less heat produced.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
Thanks for your input. Michael had actually recommended not using a relay for this purpose, but maybe you're right with the motor getting stuck in an area where it needs relatively high starting current.

I did a quick read and apparently 12 v supply helps relays work more efficiently. Less heat produced.
Do you have a volt meter?
If so you could prove this out.
Hook up the voltmeter in place of the doser.
Does it read 12v every time?

Which doser pump are u using?
 
https://www.omegasea.net/

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
@Michael Lane is the person best qualified to comment I guess

I run all 5V relays because that's what I had when I set mine up. I supply the "12V Input" with 5V to run them off that rail. i know @Bigtrout does the same FWIW
I do run 5v relays and they have been fine. I ran 5 volt relays because i didnt want a seperate 12v supply. Everything in my build runs at 5 volts.

It takes a set amount of power to pull in a coil. In the relay boards on amazon the 5v relays draw 36 miliamps. The power draw is 180 milliwatts The 12 volt relays using the same family of Songle relays draw 15ma and but still use 180 miliwatts.

Less current means smaller wire size and less resistance losses in connections. But the difference between 5v and 12v is not enough to worry about in most cases.
 

Michael Lane

Well-Known Member
View Badges
Joined
Aug 11, 2018
Messages
562
Reaction score
980
Thanks for your input. Michael had actually recommended not using a relay for this purpose, but maybe you're right with the motor getting stuck in an area where it needs relatively high starting current.

I did a quick read and apparently 12 v supply helps relays work more efficiently. Less heat produced.
@Phildago I'm sorry to hear that you are having trouble with dosing pumps. Either kind of relay will work fine as long as it can get the voltage and current it needs as Bigtrout described.

ULN2803 can be used for small dc motors, but it does depend on how much current the motor needs. It's rated up to 500 mA, but can possibly pass more (and burn up). Keep it under 300 mA or so, and it should be fine. It's also possible to combine pins if you need more current, but I'd recommend relays over combining outputs. Most of the DC peristaltic pumps I've tested run just under 150 mA.

Do you have any data about the pump you are using? I always trust advice from @Bigtrout and @Des Westcott. Running via a relay can rule out this problem.

I did have a problem that I thought was dosing pump related, but ended up being a problem with my SD card. It may not be the problem you are experiencing, but sharing won't hurt. My dosing pumps are scheduled to run every 30 minutes, and I noticed I didn't hear them run at all one night. For me, the whole system had stopped working and I had to power off and back on to get it to reset. The SD card had been corrupted, so it was difficult to track down since the logs weren't being written. I haven't had that problem since I upgraded to a quality SD card.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
@Phildago I'm sorry to hear that you are having trouble with dosing pumps. Either kind of relay will work fine as long as it can get the voltage and current it needs as Bigtrout described.

ULN2803 can be used for small dc motors, but it does depend on how much current the motor needs. It's rated up to 500 mA, but can possibly pass more (and burn up). Keep it under 300 mA or so, and it should be fine. It's also possible to combine pins if you need more current, but I'd recommend relays over combining outputs. Most of the DC peristaltic pumps I've tested run just under 150 mA.

Do you have any data about the pump you are using? I always trust advice from @Bigtrout and @Des Westcott. Running via a relay can rule out this problem.

I did have a problem that I thought was dosing pump related, but ended up being a problem with my SD card. It may not be the problem you are experiencing, but sharing won't hurt. My dosing pumps are scheduled to run every 30 minutes, and I noticed I didn't hear them run at all one night. For me, the whole system had stopped working and I had to power off and back on to get it to reset. The SD card had been corrupted, so it was difficult to track down since the logs weren't being written. I haven't had that problem since I upgraded to a quality SD card.
Great advice @Michael Lane id like to add one more thing to it. When you use a big darlington like the ULN2803 which is basically 8 darlington transistors you have a voltage loss which is current dependent. This is because of passing current thru the collector emitter junction. The higher the current the higher the voltage loss.
Specs on this show the saturation voltage at .7 to almost 2 volts depending on current. So your 12v motor may only be getting 10 to 11.3 volts depending on its running current. I have no idea how the darlington would pass a large split second starting current on a motor.

This is why power mosfets have become popular. Less voltage loss than an equivalent power transistor.

That being said the uln2803 is still a great old school chip. Cheap and reliable for what it does. It was originally designed to run print heads in old dot matrix printers.
 

Phildago

Well-Known Member
View Badges
Joined
Oct 11, 2019
Messages
760
Reaction score
808
Location
Broad Channel
Do you have a volt meter?
If so you could prove this out.
Hook up the voltmeter in place of the doser.
Does it read 12v every time?

Which doser pump are u using?
I do have a multimeter. Its a bit lower than 12v, I'm using a bit less because it was simply spinning to fast and with the full 12v. I have it set around 11 for the output. This voltage gives me very close to 1 ml/second. With 1 second being the smallest unti I could dose at. I'm positive that it is not a voltage issue.

@Phildago I'm sorry to hear that you are having trouble with dosing pumps. Either kind of relay will work fine as long as it can get the voltage and current it needs as Bigtrout described.

ULN2803 can be used for small dc motors, but it does depend on how much current the motor needs. It's rated up to 500 mA, but can possibly pass more (and burn up). Keep it under 300 mA or so, and it should be fine. It's also possible to combine pins if you need more current, but I'd recommend relays over combining outputs. Most of the DC peristaltic pumps I've tested run just under 150 mA.

Do you have any data about the pump you are using? I always trust advice from @Bigtrout and @Des Westcott. Running via a relay can rule out this problem.

I did have a problem that I thought was dosing pump related, but ended up being a problem with my SD card. It may not be the problem you are experiencing, but sharing won't hurt. My dosing pumps are scheduled to run every 30 minutes, and I noticed I didn't hear them run at all one night. For me, the whole system had stopped working and I had to power off and back on to get it to reset. The SD card had been corrupted, so it was difficult to track down since the logs weren't being written. I haven't had that problem since I upgraded to a quality SD card.
My issue sounds exactly like yours. Zero output from the board. I know this because I was manually triggering the equipment and getting nothing. Once I rebooted my pi it was suddenly working again. The issue is, this has been occurring over the course of a few days. My order has been test alk levels, adjust pump settings, reboot.

This time I happened to stumble on the problem because I tested the pump, saw no output, tested the alk, adjusted the pump, still no output, rebooted, retested, and finally had it working again.

My suspition is that it's been failing every day and I just haven't known it because I've been rebooting it before I make my adjustments.

Regardless, I'm going to be getting a relay and power supply because even though I don't think the chip is my issue now, I don't want to overload it.

My pumps are jebao motors, small and although I'm not sure about the mA, I don't think it would do much heat production running for 1 second.

How did you solve your sd card issue? Total factory reset and reinstall or was there something that could be repaired?

I think @Phildago also said he's running 3 x peristaltic pumps. If they come on at the same time they could be too much. Maybe stagger times?
There are three. Each on a different pin/channel. I stagger them so they don't run at the same time: however I have tested that they can run all at the same time without issue. I like to play it on the safe side, so I know they can run together, but don't actually do it at any point in the automated schedule
 

lmm1967

Active Member
View Badges
Joined
Sep 12, 2017
Messages
412
Reaction score
486
Location
North Georgia
Can anyone point me to a doc or general direction on the prometheus setup? The prometheus box is checked in the UI - I point Grafana to ../x/metrics as a data source - get a connection - but then queries don't seem to work.

I'm assuming I'm missing a step somewhere.
 

raketemensch

Ape That Likes Fish
View Badges
Joined
Oct 13, 2019
Messages
375
Reaction score
460
Location
Northwest CT
Can I get a sanity check before I plug this in and test it?

I'm just verifying with a single outlet right now. The brown wire from the relay is going into the "hot" side of the plug, and the white wire is going into the... well, the one labeled for the white wire :]

IMG_2477.jpeg
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
Can I get a sanity check before I plug this in and test it?

I'm just verifying with a single outlet right now. The brown wire from the relay is going into the "hot" side of the plug, and the white wire is going into the... well, the one labeled for the white wire :]

IMG_2477.jpeg
That looks ok...the relay is wired to break or make the "hot" side of the plug. The white or neutral goes right to the plug and is not switched.
Make sure you ground the outlets too!
 

raketemensch

Ape That Likes Fish
View Badges
Joined
Oct 13, 2019
Messages
375
Reaction score
460
Location
Northwest CT
I'm using Michael Lane's goby board, and appear to have everything wired correctly -- gnd to gnd, v5v to vcc, and everything in the middle is just a gpio pin to a pin on the relay board.

I added 2 outlets in Configuration -> Connectors on pins 20 and 21 (first and third on the goby board)

Driver is Raspberry Pi.

I went to Equipment and mapped a Name -> Outlet

Turning them on and off in the UI doesn't change any lights on the relay board, though.

I tried restarting the service and have rebooted the pi, but I still can't control them.

Am I missing a step? I don’t think the goby needs a driver...

Oddly, on boot, one of the relays turns on automatically.
 
Last edited:
https://www.omegasea.net/

MangroveCorals

Member
View Badges
Joined
Jan 5, 2020
Messages
14
Reaction score
25
This is super duper cool @Schreiber . I am so happy to see this board coming into life. I hope this will help the community building reef-pi controller easily. Thank you for all your hard work and perseverance. I recall those initial bumpy days in the beginning. Very inspiring, and thank you for sharing
Was curious to make sure Ranjib supported this project before boundlessly donating ! Ranjib pioneered the opensource frontier for reef controllers and happy to see the community supporting each other with endeavors of our own! Thanks to both of you guys! Still working on my first build of reef-pi and enjoying the ideas and builds!
 

raketemensch

Ape That Likes Fish
View Badges
Joined
Oct 13, 2019
Messages
375
Reaction score
460
Location
Northwest CT
Gah, and now I'm getting completely random values for the ato, I'm using a 2-wire float switch.

Like, at the moment there isn't a float switch attached to the wires at all, while trying to troubleshoot. The plug for ATO1 is connected to nothing, but it's still changing constantly:

Jan 18 22:32:40 reefpi reef-pi[294]: 2020/01/18 22:32:40 ato sub-system: sensor Sump value: 0
Jan 18 22:32:43 reefpi reef-pi[294]: 2020/01/18 22:32:43 ato sub-system: sensor Sump value: 1
Jan 18 22:32:46 reefpi reef-pi[294]: 2020/01/18 22:32:46 ato sub-system: sensor Sump value: 0
Jan 18 22:32:49 reefpi reef-pi[294]: 2020/01/18 22:32:49 ato sub-system: sensor Sump value: 1
Jan 18 22:32:52 reefpi reef-pi[294]: 2020/01/18 22:32:52 ato sub-system: sensor Sump value: 0
Jan 18 22:32:55 reefpi reef-pi[294]: 2020/01/18 22:32:55 ato sub-system: sensor Sump value: 0
Jan 18 22:32:58 reefpi reef-pi[294]: 2020/01/18 22:32:58 ato sub-system: sensor Sump value: 1
Nothing is changing physically or electrically, but the return value seems almost random.

Even with nothing plugged into the socket for ato1 I get random 0 or 1 values.
 
Last edited:

Phildago

Well-Known Member
View Badges
Joined
Oct 11, 2019
Messages
760
Reaction score
808
Location
Broad Channel
Just an update for today. I left my alk tube in a container outside of my tank and checked the output when i got home. From the looks of it, the pump has been running as triggered by reef pi. I got my alk back up to 7.7, and am going to leave the tube back in my sump for tonight. I'm hoping to see some stability in my alk over night tonight.

I haven't actually done anything to fix the issue yet, but the plan is to flash a new sd, add a seperate 12 v power supply and use some pwm/12v motors controllers to drive the doser. This way I tackle all possible causes of failure at once and dont need to keep opening up and disconnecting/reconnecting wires (possibly causing another issue is something breaks).

Last time I tried the motor controllers the output voltage was too low to properly use the doser. I troubleshot that and figured out that theres a voltage differential between a ground from the uln2803 and the pwm output of 2.5 v when the pwm should be producing 3.3v at 100%.

I have six wires soldered and ready to go from my enclosure to doser. I plan The outputs as 12 v + and ground from external power supply, 3 pwm outputs and 1 pin for direction control which i plan to split into three since I only need to control the motor in one direction.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
Gah, and now I'm getting completely random values for the ato, I'm using a 2-wire float switch.

Like, at the moment there isn't a float switch attached to the wires at all, while trying to troubleshoot. The plug for ATO1 is connected to nothing, but it's still changing constantly:



Nothing is changing physically or electrically, but the return value seems almost random.

Even with nothing plugged into the socket for ato1 I get random 0 or 1 values.
With nothing plugged in and no pull up/down resistors the raspberry pi input is "floating".

Its not grounded at 0 volts or pulled up to a voltage...therefore its floating in between. This explains the strange behavior you see.
 

Bigtrout

Valuable Member
View Badges
Joined
Dec 16, 2018
Messages
1,056
Reaction score
2,573
Just an update for today. I left my alk tube in a container outside of my tank and checked the output when i got home. From the looks of it, the pump has been running as triggered by reef pi. I got my alk back up to 7.7, and am going to leave the tube back in my sump for tonight. I'm hoping to see some stability in my alk over night tonight.

I haven't actually done anything to fix the issue yet, but the plan is to flash a new sd, add a seperate 12 v power supply and use some pwm/12v motors controllers to drive the doser. This way I tackle all possible causes of failure at once and dont need to keep opening up and disconnecting/reconnecting wires (possibly causing another issue is something breaks).

Last time I tried the motor controllers the output voltage was too low to properly use the doser. I troubleshot that and figured out that theres a voltage differential between a ground from the uln2803 and the pwm output of 2.5 v when the pwm should be producing 3.3v at 100%.

I have six wires soldered and ready to go from my enclosure to doser. I plan The outputs as 12 v + and ground from external power supply, 3 pwm outputs and 1 pin for direction control which i plan to split into three since I only need to control the motor in one direction.
You can connect the grounds from all power supplies together to provide a common groubd reference for all voltages in your build
 

Do we test our water too much and for too many things nowadays?

  • Yes

    Votes: 146 32.6%
  • No

    Votes: 220 49.1%
  • Not Sure

    Votes: 76 17.0%
  • Other (please explain)

    Votes: 6 1.3%

Online statistics

Members online
959
Guests online
2,982
Total visitors
3,941
Top