ReefRhythm - Advance Stepper Motor Controller with OpenSource

OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
Kalk solution also benefits from a continuous dosing strategy.
Would it be feasible to dose 10ml/hour or even lower volumes? I believe this would be enough to dose kalk even in small pico-reefs.
10ml/h its 10ml/60 min=0.16ml min.
With this pump, at the lowest flow is around ~0.1ml/min, so you can even run it in continuous mode.

But you can go even lower. Because you can run half of the minute using a schedule feature.
For example, test dose is 0.05ml(1 drop) in 30sec from 10:00-11:00 with frequency 60.
The pump will work 30sec every minute and on average it will be 0.05*60= 3 ml/hour.

And for example, these heads come with 4*2mm tubes. I think it can be replaced with 4*1mm tubes and the slowest flow will go down to 0.025ml/min. 1.5ml/h in continuous mode!
 
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
How do you control 2 dosers on 1 0-10v
In the case of water change, it can be two dosing heads. One for drainage, another to fill the tank with new saltwater.
So you can choose both pump signal sources from the same pin of the ESP32.
So both pumps will work synchronously with the same flow rate (ml/min)
 

Attachments

  • Screenshot 2024-04-24 175005.png
    Screenshot 2024-04-24 175005.png
    46.5 KB · Views: 40
  • Screenshot 2024-04-24 174956.png
    Screenshot 2024-04-24 174956.png
    45 KB · Views: 35
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
Hi everyone.
I think before MQTT in v0.8, I'll roll out a few minor updates with support for some optional but necessary things:
1) Working in AP and WiFi mode simultaneously. Accordingly, if you need to switch the controller to another Wi-fi network, it will be possible to do it without a computer.
Currently you need to connect it to PC and edit config/wifi.json in soft like Thronny.
There is a platform limitation here: when WiFi and AP simultaneously works, the DHCP server does not work on AP, so you need to set IP manually.
2) Work in AP-only mode.

3) It follows from point 2 that it is necessary to take some time for the work of the schedule. This is mandatory. Now the work on the schedule is not even turned on until the time is synchronized in obvious reason.
4) I will try to support the Captive Portal feature so that when initializing and connecting to the AP, there is an automatic opening of the page of the controller.


Therefore, I will add support the RTC module for offline work.
I have a DS3231 module, so I think about it and add it.
I think the device will automatically pick up whether it is connected or not, so its will be an option to set time from UI.

I will also add some settings:
1) Analog control work period: 15/30/60/120 sec.
2)Setting the working currents of the motors. For 23mm, for example, it is optimal 1A, 30mm -1.2A, and 40mm -1.5A. The driver itself can go up to 3A.
Now there is a hard-coded 1A.
 
Last edited:
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
Release v0.8: MQTT integration

This is the basic functionality for now, but I will improve and expand it as I migrate my aquarium from reef-pi (R.I.P.) to Home Assistant.

1) Dosing with MQTT:
MQTT "Topic"/ReefRhythm/<unique id>/dose
For example:
/ReefRhythm/dcda0c29d2cc/dose

You can find the unique MQTT topic on the settings page.
Screenshot 2024-04-28 214258.png


Dozer accepts commands in JSON format:
{"id":1, "amount":2, "duration":60, "direction":1}
Where id: pump number 1–9
amount of volume in mL for dosing
duration: time for which it is necessary to dose
direction: 1 (clockwise), 0 (counterclockwise).


2) Calculating the pump using MQTT
/ReefRhythm/<unique id>/run: Run the motor at a specified RPM for a specified time.
Accepts commands in JSON format:
{"id":1, "rpm":2, "duration":60, "direction":0}
Where id: pump number 1–9
rpm - (motor speed) revolution per minute
duration: how long to rotate the motor
direction: 1-clockwise, 0-counterclockwise


2) Setting the operating voltage of stepper motors
The default is 1000 mA.
Recommended currents:
23mm motor, 1000ma
30mm motor, 1200ma
40mm motor, 1400ma


3) Setting of the analog control operation cycle (5–300 seconds).
Smaller time interval: more responsive operation of the pump to a 0–10V signal; longer; more inert and stable.

Screenshot 2024-04-28 214233.png
 
Last edited:
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
One more thing - v0.8 version has build In way to add 3-part extension to Web UI and back-end.
Just add extenstion.py in root directory of esp32.

Define non-blocking asyncio function as shown on these example and they will become part of the main program.
Web UI also can be extended.
This way doser firmware can be used for something more complex. Like Automatic alkalinity testing or Kalk stirrer with PH control in my case:
Extension_support_1.png
Extension_support_2.png


Extension_support_3.png

extension.py:
# import main module
import web


# define async functions here
async def test_extension():
# Web UI extensions also can be added to main web.py module
@web.app.route('/test')
async def test(request):
return "Hello world"

print("Test extension")
# Control main module from extension:
web.mac_address = 1111444


# Define extension async tasks here
extension_tasks = [test_extension]

# Define navbar extension here
extension_navbar = [{"name": "Test", "link": "/test"}]
 

Paulo Hanashiro

Community Member
View Badges
Joined
Jun 4, 2013
Messages
56
Reaction score
29
Location
Sydney/Australia
Rating - 0%
0   0   0
Another question, do you have watchdog timer enabled to prevent unwanted issues/overdosing? (e.g.: ESP commands the stepper to run and then hungs, allowig the pump to keep dosing "forever").
 
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
Another question, do you have watchdog timer enabled to prevent unwanted issues/overdosing? (e.g.: ESP commands the stepper to run and then hungs, allowig the pump to keep dosing "forever").
I say no, but this issue is prevented by design.
You need to understand that a stepper motor can't move without active control.
And this doser does not use PWM to control the stepper motor. All dosing is calculated into steps; only these steps will be made.
If controller will hang -pump will just finish last job normally and stop.

For more control I will add mqtt publications of dosing. So you will be able to record what's going on.
And maybe I will also add some statistics page in web UI, controller still have plenty of RAM to use
 
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
About future versions:
1)v0.9, I'm planning to add some interfaces in the Web UI with the Python scripting language to add programming logic to Doser.
For example, if you want to run some checks before dosing, even over a network (web API, MQTT).

2)v0.8.2 - publications of dosing on the MQTT broker for statistics

And I'm open minded to other functionality requests
 
Last edited:

Danchik

Community Member
View Badges
Joined
Jul 17, 2018
Messages
54
Reaction score
2
Location
UA
Rating - 0%
0   0   0
About future versions:
1)v0.9, I'm planning to add some interfaces in the Web UI with the Python scripting language to add programming logic to Doser.
For example, if you want to run some checks before dosing, even over a network (web API, MQTT).

2)v0.8.2 - publications of dosing on the MQTT broker for statistics

And I'm open minded to other functionality requests
Hi,
Is it possible to specify the volume, calculate how many days it will last in relation to the dosing program... as well as a message about when to replenish the liquid when it runs out, for example, less than 10% of the total volume?
 
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
Hi,
Is it possible to specify the volume, calculate how many days it will last in relation to the dosing program... as well as a message about when to replenish the liquid when it runs out, for example, less than 10% of the total volume?
It's possible with some limitations:

- receive adnoid/ios push notification. You need to have an app on your phone that will subscribe to this.
Some solutions exist, but I'm not a big fan of installing a 3-part app just for notification.

- On the other hand, if you are using Home Assistant, you can easily set this up on your dashboard, and you can enable Android and iOS app notifications.
But this is HA functionality; you just need to use it properly.

///
Alternative e-mail notifications and some easy-to-implement APIs like Telegram can be added.
 

robinm

Active Member
View Badges
Joined
Feb 21, 2021
Messages
101
Reaction score
69
Location
Louth
Rating - 0%
0   0   0
It's a buck converter, converts the 12v input voltage used to drive the stepper to 3.3v used by the ESP32.

Edit: Actually looking at the whole picture it looks like a step-up converting a 5v input voltage to 12v for the stepper. The second picture has a buck converter going the other way. The second is preferable as it needs a lower amperage source.
 
Last edited:

zerokewl

Community Member
View Badges
Joined
Feb 21, 2023
Messages
29
Reaction score
3
Location
Mississippi
Rating - 0%
0   0   0
These ? I don't think the above link worked
 

Attachments

  • Screenshot_20240501_153638_Chrome.jpg
    Screenshot_20240501_153638_Chrome.jpg
    129.1 KB · Views: 45
OP
OP
yury88

yury88

Active Member
View Badges
Joined
Oct 21, 2023
Messages
209
Reaction score
160
Location
indo-pacific
Rating - 0%
0   0   0
These ? I don't think the above link worked
Hi, you can find the list here

About converter on photo- esp32 has onboard linear stabilizer 5v-3.3v.
Analog read is more stable when its powered from linear stabilizer, thats why its connected to 5v.
But powering by dc-dc 3.3v more efficient.

For controller - for this project you need
ESP32-S3 N16R8 Controller. Its has dual type-c interface
Purple one is better quality:
Screenshot_2024-05-02-10-00-53-77_3aea4af51f236e4932235fdada7d1643.jpg
Screenshot_2024-05-02-10-02-27-94_2abacf34316c15a12c3cebabd203d65f.jpg
 

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