Variable voltage controled from arduino (0-5v output max 200ma)  - Page 1
Forum section: electronics / beginners

author: scarr999
author_rank: Contributor
timestamp: February 02, 2022, 12:09:55 pm
content: Hi All,Title says is all I think, I would like a variable voltage output, controled from arduino (0-5v output, max 200ma) a simple single chip solution would be great but ideally not PWM controlled as I have alreaady used all the PWM lines on the Nano.RegardsSteve

author: Ian.M
author_rank: Super Contributor
timestamp: February 02, 2022, 12:49:42 pm
content: In that case you need some sort of a DAC + a buffer that can output 200mA of current. If you don't need to change the output extremely fast, and don't need very high resolution, the DAC could be a digipot (digital potentiometer IC), or if you've got enough pins spare and don't need more than 5 or 6 bits resolution, a R-2R ladder. For the buffer, if its only got to source current, a LDO with nom. zero offset between its SET pin and its output might do the job (e.g.LT3080but if its got to both sink and source current, you'll need a power OPAMP or similar.

author: scarr999
author_rank: Contributor
timestamp: February 02, 2022, 01:32:08 pm
content: Thanks Ian,Whilst trying to understand your suggestion and looking at DAC's / Digipots I thought hmmm what about a Digipot with SPI/I2C interface and an adjustable voltage regulator? does this sound like a good idea? I have found these two MCP1824 + TPL0501 the TPL0501 can be used as a voltage dividor for the MCP1824 I think :-)RegardsSteve

author: Ian.M
author_rank: Super Contributor
timestamp: February 02, 2022, 01:59:44 pm
content: Yep. That's what I was proposing. Simply feed 5V and Gnd to the two track end pins of the digipot, and take its wiper to the LT3080 SET pin, via a smallish resistor to protect the digipot and the LT3080 if the output is shorted. 1K would limit the SET pin and digipot wiper current to under 5mA at the expense of a +0.01V output voltage offset If you want better performance add a unit gain OPAMP buffer between the digipot and the regulator, choosing a single supply RRIO OPAMP, and sticking a 560R resistor in series with its output inside its feedback loop to limit the SET pin current.

author: scarr999
author_rank: Contributor
timestamp: February 02, 2022, 02:22:00 pm
content: @IanGreat think I have it in my head, can you confirm there is nothing wrong with my choice of AD5175 to use with the LT3080Thanks

author: Ian.M
author_rank: Super Contributor
timestamp: February 02, 2022, 03:00:13 pm
content: The AD5175 is a two terminal digital rheostat not a three terminal potentiometer. Its max resistance is 10K, so it cant directly be used with a LT3080, as its SET pin control current is only 10uA, which would only give you a 0 to 0.1V output range. If you want to use it, you need to increase the effective set pin current by a factor of 50, which can be done by putting 1K in series with the SET pin and adding a 20.4 ohm resistor between the other end of the 1K resistor and the LT3080 output. The AD5175 can then act as the set resistance between that point and GND. It would have the advantage that accuracy would only be dependent on the two ICs and the two resistors, not the precise 5V supply voltage.

author: scarr999
author_rank: Contributor
timestamp: February 02, 2022, 03:30:23 pm
content: Hi,Slowly getting confusedforgive my ignorance, I picked that chip becuase it's 1024 positions this circuit is powering a small laser and I want to be able to make it as smooth as possible, I know this is a hard question but do you think 256 positions would look jerky based on 19ma steps. or does anyone know of a three terminal potentionmeter that has 1024 positions or more?Steve

author: Ian.M
author_rank: Super Contributor
timestamp: February 02, 2022, 03:51:35 pm
content: Maybe look at 12 bit DACs capable of 5V single supply operation (or really any DACs from 12 bit up to 16 bit)? That would give you 4096 (or more) levels. Prefer voltage output DACs with an internal buffer amplifier so you can connect the DAC output almost direct to the LT3080 SET pin with only the 1K protection resistor in-between.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 02, 2022, 03:58:23 pm
content: Laser, what laser? Laser diode? Complete module? Does it have a 0-5V dimming control input you plan to connect to? Or are you just expecting it works by adjusting supply voltage?

author: scarr999
author_rank: Contributor
timestamp: February 02, 2022, 04:13:41 pm
content: Hi, SiwastajaIt is a complete laser module that simply plugs into a USB power port and runs at full brightness, I want to be able to vary the brightness, I thought that just adjusting the voltage will adjust the brightness.Steve

author: tszaboo
author_rank: Super Contributor
timestamp: February 02, 2022, 04:20:18 pm
content: Dont use a digipot for something that is a DAC's job. You will run into nonlinearity, wiper resistance, scaling, and other issues. Just use a DAC.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 02, 2022, 04:35:09 pm
content: Quote from: scarr999 on February 02, 2022, 04:13:41 pmNo, it won't, except by luck, by unpredictable amount, over small range (like between 4V-5V). You can easily try with an adjustable lab power supply before designing anything. If you don't have an adjustable power supply, add a few diodes in series with the USB supply to drop the voltage by approx. 0.6V per each diode. Then you can short the desired number of diodes with a piece of wire and see if it affects the brightness.If you are lucky, the module is crappy enough that it does not have current regulation. OTOH, then it's also very sensitive to mishaps.This is a good example of an X-Y problem. Always tell us what you are actually building.

author: Manul
author_rank: Super Contributor
timestamp: February 02, 2022, 04:58:32 pm
content: Or if it has a proper constant current driver, or a driver with optical feedback, you will see no change in ouput power until you will reach a narrow range of input voltage where output power will drop like stone. Also there could be high temperature dependence or other instabilities in that narrow range.

author: scarr999
author_rank: Contributor
timestamp: February 03, 2022, 08:27:44 am
content: @Siwastaja I will try the bench PSU as you say better test first@ everyone thanks for the help so far, I will be back I'm sure

author: scarr999
author_rank: Contributor
timestamp: February 04, 2022, 12:41:23 pm
content: OK tested the laser module (for which I there is no datasheet as far as I know)Lowering the current lowers the voltage and the laser is irratic, however it did not go off completlyLowering the voltage it did nothing until about 2.8v then the light output dropped quickly until it hit about 1.8v (off) as the voltage dropped the current draw went upRegardsSteve

author: scarr999
author_rank: Contributor
timestamp: February 07, 2022, 11:23:49 am
content: So, now I have a lot more information and I have posted it can anyone help?To summarise, this is a circuit to control a laser modules light output using an arduino (no datasheet unfortunately) it is normally powered from a 5v USB connection.When testing with a PSU,Lowering the current lowers the voltage and the laser is irratic, however it did not go off completlyLowering the voltage had no effect until about 2.8v then the light output dropped quickly until it hit about 1.8v (off) as the voltage dropped the current draw went upThe module draws a maximum of 200ma full power.There have been a few sugestions and I am now a little unsure of the best path. however I have found a arduino library that give me more PWM pins so I can now use this method.RegardsSteve

author: Siwastaja
author_rank: Super Contributor
timestamp: February 07, 2022, 02:14:21 pm
content: The best path is to find a laser module which comes with a dimming input. I'm not sure if any is available cheaply.Another alternative is to design the laser drive circuitry yourself but this is not easy unless you know exactly what you are doing, in which case you wouldn't be asking...

author: mikerj
author_rank: Super Contributor
timestamp: February 07, 2022, 05:37:32 pm
content: Your laser module contains a constant current source that by its nature rejects changes in supply voltage which is what you see experimentally. The bottom line is your laser module is not suitable for dimming via voltage control. Itmightwork using PWM, but equally you might see other behavioural issues. As Siwastaja says, you best approach is to use a device that is designed for dimming.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 07, 2022, 05:59:58 pm
content: VERY slow PWM would obviously work, but then again it would flicker.The problem is, it will have filter capacitors and stuff like that, it might have limited number of life cycles, and turn-on time might be just too long as well. If you have to turn it on and off once a second, that can't be called "dimming" even with good will.But you can try PWMing at say 50Hz and hope it works and doesn't blow up after mere minutes or hours. To do this, a simple N-channel MOSFET driven by Arduino's GPIO pin would do the trick. Add some series resistance (maybe an ohm) to limit inrush current.