1

I have a programmable power supply, which has serial communication port. If I send a string "VSET1:11.00" then power supply will be set to 11.00V. But, I need to write a program which will increase the voltage of power supply by 0.10V For ex from 0V to 11.00V in incrementing steps of 0.10V. Also, power supply needs a fixed data frame format like Parity bit, Data bits, stop bit. So, how to create a data frame structure and send from arduino.

Do I need to use Software Serial library?

PS. I'm new to arduino, so may sound foolish.

3
  • 1
    That sounds like the same PSU that I have. Mine's badged as TENMA though I have seen what looks like the same one badged by other people... – Majenko Nov 1 '20 at 15:28
  • One thing I really find annoying with this PSU is that as soon as you send anything over the serial port it completely locks out the front panel for a while. – Majenko Nov 1 '20 at 15:41
  • Yes that's right. It is TENMA power supply. – Hrishikesh Dixit Nov 1 '20 at 15:43
3

First you will need a TTL to RS-232 adaptor. These are most commonly known as the "MAX232" and is available as a little module.

This will convert the 0-5V TTL signal the Arudino produces into the ±10V signal that RS-232 uses. There's plenty of tutorials online about how to use them.

Then you need to generate the signal. Yes, for the Arduino UNO the SoftwareSerial library is what you want. Again there's plenty of tutorials on using it.

To actually send the instructions it may be something like:

#include <SoftwareSerial.h>

SoftwareSerial PSU(10, 11); // RX, TX

void setup() {
    PSU.begin(9600);
}

void loop() {
    for (int i = 0; i < 11000; i += 100) { // I'm working in millivolts here.
        PSU.print("VSET1:");
        PSU.println(i / 1000.0, 2); // Convert millivolts into volts with 2 DP
        delay(10); // 10ms delay
    }
}

I haven't tested it, but that should give you 0-11v rising at 0.1v per 10ms.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.