Author Topic: Variable voltage controled from arduino (0-5v output max 200ma)  (Read 3456 times)

0 Members and 1 Guest are viewing this topic.

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
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.

Regards

Steve
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14121
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #1 on: February 02, 2022, 12:49:42 pm »
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. LT3080 but if its got to both sink and source current, you'll need a power OPAMP or similar.
« Last Edit: February 02, 2022, 12:53:13 pm by Ian.M »
 

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #2 on: February 02, 2022, 01:32:08 pm »
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?

[Update] I have found these two MCP1824 + TPL0501 the TPL0501 can be used as a voltage dividor for the MCP1824 I think :-)

Regards

Steve
« Last Edit: February 02, 2022, 02:10:27 pm by scarr999 »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14121
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #3 on: February 02, 2022, 01:59:44 pm »
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.
 

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #4 on: February 02, 2022, 02:22:00 pm »
@Ian

Great think I have it in my head, can you confirm there is nothing wrong with my choice of AD5175 to use with the LT3080

Thanks
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14121
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #5 on: February 02, 2022, 03:00:13 pm »
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.
« Last Edit: February 03, 2022, 11:41:52 am by Ian.M »
 

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #6 on: February 02, 2022, 03:30:23 pm »
Hi,

Slowly getting confused ;D forgive 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
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 14121
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #7 on: February 02, 2022, 03:51:35 pm »
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.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11122
  • Country: fi
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #8 on: February 02, 2022, 03:58:23 pm »
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?
 
The following users thanked this post: Ian.M

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #9 on: February 02, 2022, 04:13:41 pm »
Hi, Siwastaja

It 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
 

Offline tszaboo

  • Super Contributor
  • ***
  • Posts: 9727
  • Country: nl
  • Current job: ATEX product design
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #10 on: February 02, 2022, 04:20:18 pm »
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.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11122
  • Country: fi
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #11 on: February 02, 2022, 04:35:09 pm »
It 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.

No, 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.
« Last Edit: February 02, 2022, 04:38:38 pm by Siwastaja »
 
The following users thanked this post: Ian.M, tooki

Offline Manul

  • Super Contributor
  • ***
  • Posts: 1405
  • Country: lt
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #12 on: February 02, 2022, 04:58:32 pm »
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.
 
The following users thanked this post: tooki

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #13 on: February 03, 2022, 08:27:44 am »
@Siwastaja I will try the bench PSU as you say better test first  ;D

@ everyone thanks for the help so far, I will be back I'm sure  :)
 

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #14 on: February 04, 2022, 12:41:23 pm »
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 completly
Lowering 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 up

Regards

Steve

« Last Edit: February 04, 2022, 12:43:59 pm by scarr999 »
 

Offline scarr999Topic starter

  • Contributor
  • Posts: 40
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #15 on: February 07, 2022, 11:23:49 am »
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 completly
Lowering 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 up
The 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.

Regards

Steve
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11122
  • Country: fi
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #16 on: February 07, 2022, 02:14:21 pm »
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...
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3671
  • Country: gb
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #17 on: February 07, 2022, 05:37:32 pm »
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.  It might work 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.
 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 11122
  • Country: fi
Re: Variable voltage controled from arduino (0-5v output max 200ma)
« Reply #18 on: February 07, 2022, 05:59:58 pm »
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.
« Last Edit: February 07, 2022, 06:01:46 pm by Siwastaja »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf