{"id":13893808,"url":"https://github.com/RobTillaart/PERIPUMP","last_synced_at":"2025-07-17T08:30:55.671Z","repository":{"id":61368140,"uuid":"550953269","full_name":"RobTillaart/PERIPUMP","owner":"RobTillaart","description":"Arduino library for peristaltic pump DFR0523 and compatibles.","archived":false,"fork":false,"pushed_at":"2024-04-13T09:10:23.000Z","size":17,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T22:04:43.325Z","etag":null,"topics":["arduino","peristaltic","pump","servo"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RobTillaart.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"RobTillaart","custom":"https://www.paypal.me/robtillaart"}},"created_at":"2022-10-13T15:38:26.000Z","updated_at":"2024-08-20T11:00:52.000Z","dependencies_parsed_at":"2024-11-19T06:41:36.182Z","dependency_job_id":null,"html_url":"https://github.com/RobTillaart/PERIPUMP","commit_stats":{"total_commits":6,"total_committers":1,"mean_commits":6.0,"dds":0.0,"last_synced_commit":"3e3e54f09852c432b0fe6ecc129ff995488bf46a"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/RobTillaart/PERIPUMP","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FPERIPUMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FPERIPUMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FPERIPUMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FPERIPUMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RobTillaart","download_url":"https://codeload.github.com/RobTillaart/PERIPUMP/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RobTillaart%2FPERIPUMP/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265585277,"owners_count":23792712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","peristaltic","pump","servo"],"created_at":"2024-08-06T18:01:17.571Z","updated_at":"2025-07-17T08:30:55.429Z","avatar_url":"https://github.com/RobTillaart.png","language":"C++","funding_links":["https://github.com/sponsors/RobTillaart","https://www.paypal.me/robtillaart"],"categories":["C++"],"sub_categories":[],"readme":"\n[![Arduino CI](https://github.com/RobTillaart/PERIPUMP/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)\n[![Arduino-lint](https://github.com/RobTillaart/PERIPUMP/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/PERIPUMP/actions/workflows/arduino-lint.yml)\n[![JSON check](https://github.com/RobTillaart/PERIPUMP/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/PERIPUMP/actions/workflows/jsoncheck.yml)\n[![GitHub issues](https://img.shields.io/github/issues/RobTillaart/PERIPUMP.svg)](https://github.com/RobTillaart/PERIPUMP/issues)\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/PERIPUMP/blob/master/LICENSE)\n[![GitHub release](https://img.shields.io/github/release/RobTillaart/PERIPUMP.svg?maxAge=3600)](https://github.com/RobTillaart/PERIPUMP/releases)\n[![PlatformIO Registry](https://badges.registry.platformio.org/packages/robtillaart/library/PERIPUMP.svg)](https://registry.platformio.org/libraries/robtillaart/PERIPUMP)\n\n\n# PERIPUMP\n\nArduino library for peristaltic pump DFR0523 and compatibles.\n\n\n## Description\n\n**VERY EXPERIMENTAL - AVR (UNO) only for now** \n\nThe DFR0523 is a peristaltic pump which can be controlled by a PWM signal. \nThis PWM (Pulse Width Modulation) is provided by the Arduino Servo library.\nTo hide the details of the Servo library and provide an easy to use interface, \nthis PERIPUMP library gives control by setting the speed of the pump as a percentage\nranging from -100.0% .. 100.0%. \n\nThe Servo library allows 900 steps for 0..100% so **in theory** the precision is \napproximately around 1 decimal.\nIn my first tests however with a 5 volt lab power supply, the pump only started \nto run around 60% at 5 volt and around 50% at 6 volt.\nSince 0.1.1 the mapping from 0..100% is done on the upper 500 steps of the servo,\nto get the pump moving at lower percentages. This gives a practical precision of\naround 0.2 % which is still very nice. \nAlthough there might still be low percentages that does not work on 5V, they might \nwork on 6V, or when one goes from full speed to lower speed. (momentum differs).\nAt least there will be a larger \"active range\" for the percentages.\n\nNot measured if the behaviour is linear.\n\nThe actual flow depends on BOTH the voltage used and the percentage set.\n\nThe library provides also a minimalistic time registration. \nIt measures how long the pump has been running since the start of the sketch or \nsince the last call to **resetRunTime()**. \nThis run time does not take into account the speed of the pump, a feature that might\nbe implemented in the future.\n\nNote however that given that the pump only runs from 50-60% the output of **getRunTime()**\nis not accurate.\n\nFeedback on the library is welcome.\n\n\n## Hardware schema\n\nIn my first tests the DFR0523 pump drew a current between 330 -360 mA (5V) at full speed.\nThis implies an external power supply of 5 (or 6) volts is mandatory.\n\n```\n//  POWER SUPPLY       PROCESSOR       PUMP\n//\n//                        PWM----------PWM\n//            GND---------GND----------GND\n//\n//  5-6 Volts VCC----------------------VCC \n//\n```\n\n\n## Interface\n\n```cpp\n#include \"PERIPUMP.h\"\n```\n\n\n### Base\n\n- **PERIPUMP(uint8_t pumpPin)** constructor. pumpPin should be a PWM supporting pin.\n- **void begin(float percentage = 0)** initialize the internal variables.\nDefault percentage = 0% == stop.\n- **void stop()** set speed percentage to zero, effectively stop the pump.\nAlso stops the run time measurement counter.\n- **void forward()** 100% forward.\n- **void backward()** 100% backward.\n- **void setPercentage(float percentage)** sets speed as a percentage of the full speed.\n  - The percentage goes from -100.0 % .. +100.0 %.\n  - If percentage == 0, the pump stops. \n  - Negative values set the pump in reverse.\n  - Positive values set the pump in forward mode.\n  - low values might not work.\n- **float getPercentage()** returns set speed: -100.0 % .. +100.0 %.\n\n\n### Invert (experimental / test)\n\n- **void setInvert(bool flag = false)** inverts forward and backward to\neasy swap direction without rebuilding hardware setup.\nDefault = false.\n- **bool getInvert()** returns value invert flag.\n\n### RunTime\n\n- **float getRunTime()** returns total seconds running since last reset / start.\n- **float resetRunTime()** returns total seconds running since last reset / start.\nResets the internal time counter to zero again.\n\n\n## Operation\n\nThe examples show the basic working of the functions.\n\n\n## Future\n\n#### Must (next release)\n\n- documentation\n- investigate calibration process\n  - function to set the ranges for percentage.\n  - four values needed  500-VAR1    VAR2-2500\n  - defaults for these variables.\n  - could that be command line #defines?\n\n#### Should\n\n- test more\n- examples\n- investigate flow rate == (non) linear \n- investigate startup behaviour (had some hickups)\n\n#### Could\n\n- investigate flow support\n  - add **void setVolumePerSecond(float flow)** indication cm^3 / sec\n  - at full speed only?\n  - linear / non linear interpolatable (multiMap).\n\n#### Won't (for now lowest prio)\n\n- unit test possible?\n  - No servo.h include fails.\n  - compilation of examples works for UNO and RP2040 pico.\n- add **void pump_ml(int ml)**  auto stop after X ml? possible?\n- investigate difference per pump (one pump behaves different enough)\n  - calibration might solve this.\n- investigate flow-accounting?\n  - sum += time x speed - is that better?\n  - two counters needed, one per direction\n- **incr()** and **decr()** as they are direction dependant.\n\n\n## Support\n\nIf you appreciate my libraries, you can support the development and maintenance.\nImprove the quality of the libraries by providing issues and Pull Requests, or\ndonate through PayPal or GitHub sponsors.\n\nThank you,\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobTillaart%2FPERIPUMP","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FRobTillaart%2FPERIPUMP","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FRobTillaart%2FPERIPUMP/lists"}