Let's see if you can tell me? :grinning-face-with-smiling-eyes: :face-with-tears-of-joy: :rolling-on-the-floor-laughing:Nice, can you elaborate on why you need that extra resistor ? Change the amplification on the OP-Amps ?
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.
Let's see if you can tell me? :grinning-face-with-smiling-eyes: :face-with-tears-of-joy: :rolling-on-the-floor-laughing:Nice, can you elaborate on why you need that extra resistor ? Change the amplification on the OP-Amps ?
Well, you basically measure the voltage between the probe‘s contacts. Since this voltage can also be negative you have to bias this voltage to a point between VCC and GND. This bias point should be identical for pH and ORP, but might be different if you are only interested in specific value ranges.Let's see if you can tell me? :grinning-face-with-smiling-eyes: :face-with-tears-of-joy: :rolling-on-the-floor-laughing:
www.reef2reef.com
Exactly how I would have said it. :rolling-on-the-floor-laughing: I had a feeling it was due to the negative voltage, couldn't remember exactly though but knew you would know and you did. :)Well, you basically measure the voltage between the probe‘s contacts. Since this voltage can also be negative you have to bias this voltage to a point between VCC and GND. This bias point should be identical for pH and ORP, but might be different if you are only interested in specific value ranges.
This means if you are for example not interested to measure pH symmetrically around 7.0 you can shift this by using a different bias that’s not the exact middle of VCC and GND.
this resistor does basically that, it moves this bias to pretty much the middle, ensuring a symmetrical measurement range for ORP.
Awesome as usual I went to Tropic Marin all for reef and that way all I have to dose is one thing....works really well but man your tanks always look so much better than mine, lol...if you want to ship any of those SPS frags I will gladdly pay for shipping :)One of my tank. Now the sps are growing at a rate and has passed a size that I can sustainably frag a few (green slimer, forest fire digitata , red milli pora, strawberry shortcake ) for testing in pico tank![]()
Here is a close up of the green slimer colony . I have to frag it, otherwise it will shade the other acro frags glued beneath![]()
strawberry shortcake colony
![]()
Pink stylo
![]()
I really want to test a minimal reef-pi setup that can keep at least some of these across. I am able to keep green slimer and monti right now. Without any dosing . But over the last few months I have sourced pretty awesome 12v brushless motor that generates ample flow, and now that dosing systems are tested with all for reef based alk/ca supplement , I think i have all the things needed. I am really excited about this. It will be so cool to have a pico tank with a sizable sps colony as the center piece , all grown out with reef-pi in a very affordable and open setup. That will be an awesome milestone
Hmm, can‘t quite elaborate on the hysteresis with certainty, but I think it should work like your first thought, e.g. shut down on target and turn on below target-hysteresis.So 5.2 has a pesky issue with the hysteresis and controlling a heater, threshold under value error. I was able to find a bug in git and figured out a workaround but wondering if that bug was corrected in 5.3. I think 5.3 was the latest 5.x build?
Another topic can someone explain how hysteresis is supposed to work, I thought I knew but was getting some odd variation with my heater. The way I thought it worked is you could provide some float around the setting that you are using, say I set my heater threshold for 79deg and a hysteresis of 1deg then it would float the temp down to 78deg before turning back on or is it I have threshold set to 79deg and hysteresis set to 1deg it will float from 79 to 80 before shutting off...I had it set like the first example and it was turning off at 79 but as soon as it hit 78.9 turning back on even though I had hysteresis set to 1deg. Maybe i forgot to reload after changing it, doing some more testing.
PSA, i thought my temp probes were close enough but ive had some heaters failing and finally got another temp gauge that would take a temp reading and even testing it against a cup of ice water was off 1.5deg. Bottom line get a calibrated handheld temp gauge that you can ensure is calibrated to then adjust your reef-pi temp probes, I had been running my tank much higher than I thought...
Wait what? I have always thought it was the other way around, with the default being that all heaters and coolers are OFF and the thresholds being the value at which they turn ON, heat/cool for a temperature difference of the hysteresis, then turn OFF again.Hmm, can‘t quite elaborate on the hysteresis with certainty, but I think it should work like your first thought, e.g. shut down on target and turn on below target-hysteresis.
Hm, if it has always worked as expected for you then maybe I'm wrong.Wait what? I have always thought it was the other way around, with the default being that all heaters and coolers are OFF and the thresholds being the value at which they turn ON, heat/cool for a temperature difference of the hysteresis, then turn OFF again.
Thats why it's called threshold, not target, isn't it?
Maybe I'm wrong but it has always worked as expected for me
As a side note, it would be nice to be able to set separate hystereses for heaters and coolers, flickering 12V fans is fine, flickering mains relays not so much
Found it, you were right.Wait what? I have always thought it was the other way around, with the default being that all heaters and coolers are OFF and the thresholds being the value at which they turn ON, heat/cool for a temperature difference of the hysteresis, then turn OFF again.
Thats why it's called threshold, not target, isn't it?
Maybe I'm wrong but it has always worked as expected for me
As a side note, it would be nice to be able to set separate hystereses for heaters and coolers, flickering 12V fans is fine, flickering mains relays not so much
| Temp | < | Heater threshold | => | Heater goes on | ||
| Heater threshold | < | Temp | < | Heater threshold + Hysteresis | => | Heater stays on |
| Heater threshold + Hysteresis | < | Temp | => | Heater turns off |
| Cooler threshold | < | Temp | => | Cooler goes on | ||
| Cooler threshold - hysteresis | < | Temp | < | Cooler threshold | => | Cooler stays on |
| Temp | < | Cooler threshold - hysteresis | => | Cooler turns off |
case h.pastTarget == downerTarget && math.Abs(o.Value-h.config.Max) < h.config.Hysteresis:case h.pastTarget == downerTarget && h.config.Max - h.config.Hysteresis < o.Value:case h.pastTarget == upperTarget && o.Value < h.config.Min + h.config.Hysteresis:Looking over the ESP32 code it doesn't look like it, yet. This gave me an idea however: there are convenient Arduino libraries for running a stepper motor on an ESP32:On another node, I haven't looked at the esp integration, or esp itself at all yet, does that support stepper motor dosers right now?
And if so, how does it work, is the dosing schedule sent via wifi to the esp and saved there, or is each individual "dose 10ml right now" command sent over wifi? And how does it work for DC doses, can the same issue as with the pca9685 happen where the "stop turning the motor now“ command is separate and can get lost?
I think this is what you meant, on the last line when Heater Threshold + Hysteresis is greater than temp (you had less) it shuts off, right?Found it, you were right.
@Tom Bishop I was incorrect:
Temp < Heater threshold => Heater goes on Heater threshold < Temp < Heater threshold + Hysteresis => Heater stays on Heater threshold + Hysteresis < Temp => Heater turns off
Same the other way arround for the cooler:
Cooler threshold < Temp => Cooler goes on Cooler threshold - hysteresis < Temp < Cooler threshold => Cooler stays on Temp < Cooler threshold - hysteresis => Cooler turns off
@Ranjib Found a possible technical issue.
In the code you check for
case h.pastTarget == downerTarget && math.Abs(o.Value-h.config.Max) < h.config.Hysteresis:
when the cooler = downer should continue. However, when the temperature rises faster than the hysteresis within the check period it turns off immediately. This will make the cooler turn periodically on and off, when the hysteresis and/or period is too small. Same for the heater, which might not be desireable, since you are in that case already way past the threshold and definitely dont want the heater/cooler to fluctuate.
I would suggest to change this to:
case h.pastTarget == downerTarget && h.config.Max - h.config.Hysteresis < o.Value:
and
case h.pastTarget == upperTarget && o.Value < h.config.Min + h.config.Hysteresis:
respectively.
I was thinking whether this has some security feature when the sensor crashes, but this would immeditely switch the Heater/Cooler on the next period again anyway. So I think it might be usefull to program this kind of "bad sensor" error mode more effectively.
Looking over the ESP32 code it doesn't look like it, yet. This gave me an idea however: there are convenient Arduino libraries for running a stepper motor on an ESP32:
ESP-StepperMotor-Server - Arduino Reference
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.www.arduino.cc
@Ranjib I haven't looked at them myself yet, but it might be very easy to incorporate Stepper Motor functionality that way.ESP-FlexyStepper - Arduino Reference
The Arduino programming language Reference, organized into Functions, Variable and Constant, and Structure keywords.www.arduino.cc
Security wise I'm afraid it is currently the same as with the PCA9685: if the ESP32 doesn't get an off command due to WiFi or Raspberry issues, it doesn't change its state. That should be easy to fix though:
- The quick and dirty method would be to manually define maximum runtimes in the ESP32 code, either generally for all jacks (even if it is used for a light) or specifically for the jack that the doser is connected to.
- The proper way would require an additional feature in the Reef-Pi ESP32 driver and doser handling and establishing a separate method in the ESP32 code for "dose with PWM power x for interval y"
| Temp | < | Heater threshold | => | Heater goes on | ||
| Heater threshold | < | Temp | < | Heater threshold + Hysteresis | => | Heater stays on |
| Heater threshold + Hysteresis | > | Temp | => | Heater turns off |
Howdy, folks. First post in this thread, I've been poking my head in periodically to see what's been going on.Welcome to the development thread of reef-pi, an open-source, affordable, modular DIY reef-tank controller based on Raspberry Pi...
You came at the right time, update 6.0 does something like that:Howdy, folks. First post in this thread, I've been poking my head in periodically to see what's been going on.
As someone whose business is dependent on Raspberry Pi availability, I'm wondering if @Ranjib and the dev team have been frustrated by the lack of availability of Pi units on the market. I'm given to understand that the Pi Foundation has prioritized OEM partners and dialed back on making units available for retail distributors servicing the hobbyist market by allocating supply so tightly that resellers allow only one per customer.
I'm just wondering how easy it might be to port the code from a Raspberry Pi to, say, a Rock Pi, Jetson Nano or other such board to keep the project alive and flourishing in the face of supply chain constraints. Those boards may be more expensive at list price, but given the scarcity of Pi4 units selling for upwards of $150 each for the 4GB model, it might be a good strategy to not 'put all the eggs in one basket' by considering another platform.
Just curious... thanks for reading.
Another thing I just noticed: I'm not sure if those two 100nF capacitors after the OP-Amp have currently any effect, apart from generating a high-frequency load on that OP-AMP and increasing power draw.Let's see if you can tell me? :grinning-face-with-smiling-eyes: :face-with-tears-of-joy: :rolling-on-the-floor-laughing:
Thanks, those were suggested when the extra resistor for ORP was added, maybe I'll just remove them as I'm happy with the performance without them. During my tests they didn't seem to do anything anyways but thought I would leave them.Another thing I just noticed: I'm not sure if those two 100nF capacitors after the OP-Amp have currently any effect, apart from generating a high-frequency load on that OP-AMP and increasing power draw.
If you want to use those capacitors as a filter you need a resistor between them and the OP-Amp.
True, they would filter out noise with a resistor, but that would limit your ability to average the ADC measurement below the ADC resolution, since you need noise for that.Thanks, those were suggested when the extra resistor for ORP was added, maybe I'll just remove them as I'm happy with the performance without them. During my tests they didn't seem to do anything anyways but thought I would leave them.