Skip to content
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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

DpsPowerSupply #5185

wants to merge 5 commits into from

Conversation

arielzw
Copy link
Contributor

@arielzw arielzw commented Oct 2, 2024

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:

psu.write(Parameter, Value);

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:

psu.write(U_SET, 600); // Set output voltage to 6.00 V

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).

void psu.writeVoltageCurrent(uint16_t centiVolts, uint16_t centiAmps);

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:
imagen

imagen

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:

imagen

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.

@github-actions github-actions bot added the topic: submission Add library to the list label Oct 2, 2024
Copy link
Contributor

github-actions bot commented Oct 2, 2024

ERROR: Your submission meets all requirements. However, the pull request could not be merged.

Please follow this guide to resolve a merge conflict:
https://docs.github.com/github/collaborating-with-issues-and-pull-requests/resolving-a-merge-conflict-on-github

Once that is done, it will be merged automatically.

@github-actions github-actions bot requested a review from per1234 October 2, 2024 00:03
Copy link
Contributor

github-actions bot commented Oct 2, 2024

Hi @arielzw.
Your pull request has been detected as something other than a Library Manager submission.
A maintainer will need to review it before it can be merged.

If you intended to submit a library, please check the instructions and update your pull request if necessary:
https://github.com/arduino/library-registry/blob/main/README.md#instructions

@github-actions github-actions bot added topic: modification Change existing list entry and removed topic: submission Add library to the list labels Oct 2, 2024
@github-actions github-actions bot removed the request for review from per1234 October 2, 2024 00:13
Copy link
Contributor

github-actions bot commented Oct 2, 2024

ERROR: Arduino Lint found errors with https://github.com/arielzw/DpsPowerSupply:

Linting library in DpsPowerSupply
ERROR: Library name DpsPowerSupply not found in the Library Manager index. Library names are not allowed to change after
       being added to the index.                                                                                        
       See: https://github.com/arduino/library-registry/blob/main/FAQ.md#how-can-i-change-a-librarys-name               
       (Rule LP018)                                                                                                     

Linter results for project: 1 ERRORS, 0 WARNINGS

-------------------

Linting sketch in DpsPowerSupply/examples/DPS_Library

Linter results for project: no errors or warnings

-------------------

Linter results for projects: 1 ERRORS, 0 WARNINGS

Copy link
Contributor

github-actions bot commented Oct 2, 2024

Thanks for your interest in contributing to the Arduino Library Manager index @arielzw
Please resolve the error(s) mentioned in the previous comment.

After resolving the issue, trigger this check again by doing one of the following:

  • Commit the required change to the branch you submitted this pull request from.
  • Comment here, mentioning @ArduinoBot in the comment.

NOTE: It is not necessary to open a new pull request. ❗

More information:
https://github.com/arduino/library-registry/blob/main/README.md#if-the-problem-is-with-the-pull-request

@github-actions github-actions bot requested a review from per1234 October 2, 2024 00:13
@arielzw
Copy link
Contributor Author

arielzw commented Oct 2, 2024

I was change the url of the repository
Previous: DPS-Power-Supply-library-for-Arduino
Now: DpsPowerSupply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: modification Change existing list entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant