-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DpsPowerSupply #5185
base: main
Are you sure you want to change the base?
DpsPowerSupply #5185
Conversation
❌ ERROR: Your submission meets all requirements. However, the pull request could not be merged. Please follow this guide to resolve a merge conflict: Once that is done, it will be merged automatically. |
Hi @arielzw. If you intended to submit a library, please check the instructions and update your pull request if necessary: |
❌ ERROR: Arduino Lint found errors with https://github.com/arielzw/DpsPowerSupply:
|
Thanks for your interest in contributing to the Arduino Library Manager index @arielzw After resolving the issue, trigger this check again by doing one of the following:
❗ NOTE: It is not necessary to open a new pull request. ❗ More information: |
I was change the url of the repository |
DPS Power supply control for Arduino
Control of Ruideng DPS power supply series throught serial port.
Supports writing and reading all parameters (voltage, current, power, protections, etc.) using a software or hardware serial port.
Code written using the work of https://github.com/AntaresAdroit as starting point.
IMPORTANT NOTE: For the interface to work, the DPS power supply must be the "Communication version" with USB or Bluetooth board INCLUDED (if it will never used) because the serial communication is disabled and connector removed in other versions.
Classes
The library consists of 3 functions:
Constructor:
DPS_psu psu(Stream, DeviceAddress);
Stream: Stream in which data is sent, can be any hardware or software serial port.
DeviceAddress: Device address, by default it is address 0x01;
Parameter writing:
Parameter: Any of the following options (see file in doc folder):
U_SET,
I_SET,
LOCK,
ONOFF,
B_LED,
Value: Value of the parameter to write
Example:
Parameter reading:
uint16_t psu.read(Parameter);
Parameter: One of the following options (see file in doc folder):
U_SET,
I_SET,
UOUT,
IOUT,
POWER,
UIN,
LOCK,
PROTECT,
CVCC,
ONOFF,
B_LED,
MODEL,
VERSION
Example:
currentUout = psu.read(UOUT); // Get the output voltage in centi Volts Serial.println(currentUout);
Simultaneous writing of voltage and current
This function is intended for speed up the writing of most commonly used parameters (see timming notes below).
Interface
The Arduino harware or serial port must be connected to the serial port connector of the DPS power supply, it is located in different places depending on the model:
Connection:
IMPORTANT NOTE: The DPS uses 3.3 V logic but the standard Arduino boards uses 5 V logic, the simplest way to translate the level is the following:
Default baud rate setting at DPS is 9600 but it can be changed pressing V button while power on.
Considerations about timming.
After sending each command from the Arduino to the DPS, as setting the output voltage for example, the DPS sends a reply with the same command for communication verification. This reply from the DPS may be delayed up to 0.5 s, in the mean time the program flow in the Arduino is stopped. Take in mind this behavior in your final application.