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

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
so far so good.. had to cut the power trace to the onboard ds18b20 and PCA9685 and solder in a wire to 3.3v.. (had it going to 5v)

The scope is connected to pin 2 on the PCA9685.. Seems working as planned. (power supply not connected, back powering the board from the pi, power supply tested good though.)

next up add the JST connectors and test the output on the mosfets for my light circuits and temp sensor inputs.

1643994552165.png
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Yeah it's not fun ordering parts these days. I order 50 or more at a time and look well before I'm out so luckily it's all worked out.

Here's some solder paste I highly recommend, I've gone throw a ton of it but the last year I've not needed it much, the great thing about it is the shelf life. I have a tube I use that's well over a year old and it's still comes out the original needle perfectly. If you order the small container on Mouser it'll turn to rock in less than a week. Keep this stuff in a zip lock in the fridge and you'll always have it. They have other listings of multiple tubes which is cheaper per tube.


If you get one of these the needles screw right on the solder tube and you can use a plunger to push it out. I use the black tips.


I use this to solder all my pca9685's, just did 4 tonight. I simply run a thin line across all the pads, then I place the pca9685 on the pad, nearly blind like yourself, make sure it's straight and hit it with the hot air. The part is floating and will straighten perfectly if close to begin with. Then I take my fine tipped soldering iron and do the drag soldering technique which removes all the bridges and leaves a perfect job. No flux required. Important to have a very clean solder tip when dragging. I drag one side, clean tip, drag again, then repeat on other side. Takes about 2 minutes per part.



I believe each 4 resistors in the array are 0603 but the array package is actually 1206. I don't think there's an 0603 4 pack array, at least not for general use.

Here's a video showing how to do it. :)



I’ve used the paste on board technique but somehow forget to try it all the time.

For general SMD assembly I’ve hard switched to Loctite GC10 (T4 size) paste. I do keep it stored refrigerated (next to all the super glue in one of those mini drink fridges), but it has amazing working time. I can stencil a board and place components a day later without issue. The smaller T4 size solder beads is amazing for not messing up smaller pitched QFNs and the like.

Thanks guys for all of the input, really great advice. Will pick up some solder paste and see what I can do, still looking for uln2803a but guess I will have to wait on those, no big deal. The one thing that I am trying to figure out with the hot air station is how to figure out the right temp to use plus airflow, need to find some pcb's in my recycle bin and practice i guess, any suggestions?
 

GaryE

Well-Known Member
View Badges
Joined
Mar 12, 2020
Messages
992
Reaction score
1,385
Location
Coatesville, Indiana
Rating - 0%
0   0   0
Thanks guys for all of the input, really great advice. Will pick up some solder paste and see what I can do, still looking for uln2803a but guess I will have to wait on those, no big deal. The one thing that I am trying to figure out with the hot air station is how to figure out the right temp to use plus airflow, need to find some pcb's in my recycle bin and practice i guess, any suggestions?

I might have one or two of those ULN2803A's laying around here somewhere...
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
I might have one or two of those ULN2803A's laying around here somewhere...
Yeah funny part is I only need 2 of them, I have 2 spare boards that I was going to build up. My other option is I am getting some PCB's made and they seem to have them, not sure how I could order a few extra as an add on, lol.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
Thanks guys for all of the input, really great advice. Will pick up some solder paste and see what I can do, still looking for uln2803a but guess I will have to wait on those, no big deal. The one thing that I am trying to figure out with the hot air station is how to figure out the right temp to use plus airflow, need to find some pcb's in my recycle bin and practice i guess, any suggestions?

Temp: Somewhere above the solder melting point. I'm all lead free, so 350-380C works well. Lower this for leaded. And don't dwell using the cheap FR4 material, it can't take those temperatures for any long period of time.

Airflow: Enough to heat things, not enough to blow parts across the board. Often, whatever is 50% is a good starting point.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
Temp: Somewhere above the solder melting point. I'm all lead free, so 350-380C works well. Lower this for leaded. And don't dwell using the cheap FR4 material, it can't take those temperatures for any long period of time.

Airflow: Enough to heat things, not enough to blow parts across the board. Often, whatever is 50% is a good starting point.
I am pretty noobish, what is FR4 material?
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
PSA:

If you are relying on a PCA9685 for your dosers, it might be wise to incorporate a couple safeties.

If your I2C wiring is susceptible to interference and other problems at all, the signal to start up a pump might be sent through fine, while the signal to stop it might be lost or corrupted. Resulting in the pump running non-stop until the next command is send to the PCA9685.

Had it happen 5 times so far in a couple years (that i know of). Twice it emptied my alk reservoir, once my calcium reservoir.

Steps to mitigate this:

1: Create a dummy doser in the reefpi ui that controls a pin on the PCA9685 where nothing is connected. Run that "doser" every minute for a second or so. I didn't go through the code so I don't know whether this works 100% of the time, but to me, running another doser for a second seems to help the previous lost command go through or resets the pwm or something.

2: I have my pumps connected to the PCA9685 and to power via L298N modules. Previously, i had the pins that control direction hardwired to 3.3V. What you can do instead, is connect than pin to a GPIO and only enable it in the timeframe dosing should happen. I have it set to only activate for a window of 30 seconds at each time dosing should happen. This solution relies on just a voltage or lack thereof and no complicated communications that could be subject to interference. I have the relevant direction pins of all pumps wired together to a single GPIO. Now if everything goes wrong and the first safety fails too, the motor driver is only powered for a couple seconds longer than it is programmed to run normally, instead of potentially minutes to hours until the next scheduled dose.

If the second method fails too, that means reef-pi is hung up entirely, not sure how to fix that without introducing more complexity that can fail, but this has never happened to me.

Great discussion - this is actually why I made a timeout to stop running pumps after 5 seconds on my USB doser project:

Version number two is right up the line of thinking - try to use another signal or wire to an enable pin if it exists.

As for the total loss, there are a number of ideas that could work. The simple solution is often "just add firmware to an MCU", but thats complicating the Reef-Pi DIY scene quite a bit (now you're dealing with firmware and processors and such). Instead, you can maybe make a "dead man's switch" using some discrete logic (thinking a flip flop pair) and a 555 timer chip in one shot mode. The idea would be to require toggling a GPIO every N seconds in Reef-Pi, which then feeds the flip-flop and restarts the 555 timer. Once the 555 timer elapses since it didn't get reset, it can disconnect power to a section of your circuit either via a load switch/PFET or enable pins to various parts. You might not even need the flip-flop, its possible a 555 will do it just fine. You could do the same thing to the Raspberry Pi its self, with the caveat you probably want to wait _minutes_ between timer resets for the whole thing to boot.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
I am pretty noobish, what is FR4 material?

The fiberglass PCB substrate. The cheap Chinese (and US) manufacturers will give you a low temperature grade (Tg130), and let you upgrade to higher grades (Tg150, 170, etc). The Tg is roughly the sustained degrees C it will tolerate before, well, burning up.

Higher Tg is lower chance it will turn black and then stink up everything with the beautiful smell of burned epoxy (really, its an awful smell, please use some sort of fume extractor), which means its more forgiving to rework with hot air.

The cheap stuff survives going through a lead free reflow process "ok" (its pushing its limits) - it also means being careful holding hot air in one spot for too long (more than a minute it probably a bad idea).
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
I wonder if there’s a circuit /hardware based solution for this. I’ll think through what we can do on the software side.
over the years I realized I don’t need software control of speed for most dosing use cases. I just use a hardware based driver to change and set speed of the dosing pump (Dc) and let reef-pi just turn it on/off with a timer.
next version of reef-pi brings stepper integration, that may offer another approach to this

IIRC, the Reef-Pi driver only sends the PCA9685 register updates when they change state? Perhaps a simple reliability improvement is to periodically just refresh the last known software state to the hardware.

I don't remember if the PCA9685 has glitching problems, but I think it just reloads the new PWM value when the current cycle is done, not immediately reset the count when reloaded.
 

bishoptf

Valuable Member
View Badges
Joined
Jan 1, 2019
Messages
1,349
Reaction score
1,724
Location
Missouri
Rating - 0%
0   0   0
The fiberglass PCB substrate. The cheap Chinese (and US) manufacturers will give you a low temperature grade (Tg130), and let you upgrade to higher grades (Tg150, 170, etc). The Tg is roughly the sustained degrees C it will tolerate before, well, burning up.

Higher Tg is lower chance it will turn black and then stink up everything with the beautiful smell of burned epoxy (really, its an awful smell, please use some sort of fume extractor), which means its more forgiving to rework with hot air.

The cheap stuff survives going through a lead free reflow process "ok" (its pushing its limits) - it also means being careful holding hot air in one spot for too long (more than a minute it probably a bad idea).
Another learning moment, I could have upgraded that on these boards that I am having made, doh! That is good to know, would't be an issue normally I have them add the components but with me doing it might have been a good idea to upgrade that, lol. I will have to figure out which way I want to do them, good information, thanks.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
Another learning moment, I could have upgraded that on these boards that I am having made, doh! That is good to know, would't be an issue normally I have them add the components but with me doing it might have been a good idea to upgrade that, lol. I will have to figure out which way I want to do them, good information, thanks.

Try it and see. Most of the time its not worth the cost.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
IIRC, the Reef-Pi driver only sends the PCA9685 register updates when they change state? Perhaps a simple reliability improvement is to periodically just refresh the last known software state to the hardware.

I don't remember if the PCA9685 has glitching problems, but I think it just reloads the new PWM value when the current cycle is done, not immediately reset the count when reloaded.
We do that already for lights. For doser I have to think of . I was thinking to remove the dc motor support from doser altogether, and just have stepper support. Dc motor control can be done by simple timer, rest everything (speed control) can be done outside reef_pi with hardware,
 

robsworld78

Well-Known Member
View Badges
Joined
Feb 14, 2020
Messages
985
Reaction score
1,325
Location
Edmonton, Canada
Rating - 0%
0   0   0
We do that already for lights. For doser I have to think of . I was thinking to remove the dc motor support from doser altogether, and just have stepper support. Dc motor control can be done by simple timer, rest everything (speed control) can be done outside reef_pi with hardware,
It is possible to read the state of a pin on a pca9685. This library shows how to do it, I've confirmed it works great. If say a second or two after a pump is stopped reef-pi can check the state of pin to verify it is off, if not try again.

 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
It is possible to read the state of a pin on a pca9685. This library shows how to do it, I've confirmed it works great. If say a second or two after a pump is stopped reef-pi can check the state of pin to verify it is off, if not try again.


Correct, suggest this goes at the PCA9685 driver level, not much harm in doing a quick back and forth transaction to verify setpoints were.. set.
 

theatrus

Valuable Member
View Badges
Joined
Mar 26, 2016
Messages
2,223
Reaction score
3,632
Location
Sacramento, CA area
Rating - 0%
0   0   0
We do that already for lights. For doser I have to think of . I was thinking to remove the dc motor support from doser altogether, and just have stepper support. Dc motor control can be done by simple timer, rest everything (speed control) can be done outside reef_pi with hardware,
I'm less opinionated on the topic here, but I think there is value in having nouns for the type of function you want, as it steers people to the functionality to solve a problem.

That said, the ATO module, for example, doesn't use the same interface for controlling the pump (a Jack), so its already a bit confusing and not isomorphic to equipment if you had a dosing pump performing that function.
 
OP
OP
Ranjib

Ranjib

7500 Club Member
View Badges
Joined
Apr 16, 2016
Messages
9,848
Reaction score
17,081
Location
Pleasant Hill, Concord
Rating - 0%
0   0   0
I'm less opinionated on the topic here, but I think there is value in having nouns for the type of function you want, as it steers people to the functionality to solve a problem.

That said, the ATO module, for example, doesn't use the same interface for controlling the pump (a Jack), so its already a bit confusing and not isomorphic to equipment if you had a dosing pump performing that function.
Agree. We have a long way to go in terms of UX
 

HAVE YOU EVER KEPT A RARE/UNCOMMON FISH, CORAL, OR INVERT? SHOW IT OFF IN THE THREAD!

  • 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%
Back
Top