Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
Thread Tools Display Modes
Old 30th October 2007, 08:53 AM   (permalink)
Smile MCU Programable constant Current Source

Hi,

I am designing multiple channel programable constant current source for LED light source of Camera.

From previous help from here,
Possible method is using V to I , a shift register CD4094 output connect to R2R (DAC) generate a V, input to opamp (buffer), and output to MOSFET to control current. ( a lot of component count)

I like to have an alternative solution, can I use LM317?
LM317 can be configure as constant Current mode, but can I control the current by using PIC MCU, i have no idea on how to interface it.

Any idea? or other possible method?

Thank you,
VictorPS is offline   Reply With Quote
Old 30th October 2007, 01:12 PM   (permalink)
Default

That's why PWM is popular for controlling light levels.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 30th October 2007, 01:24 PM   (permalink)
Default

hi Victor,
What constant currents levels do you require? also must the current levels be fully variable or would a 'range' of currents be acceptable?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 30th October 2007, 03:57 PM   (permalink)
Default

Hi ericgibbs,

The current is from range about >0.01A to 0.5A (max), prefer with 8bit resolution, 256 step.

I now is hard to start from 0mA, but start from 10mA will be acceptable.

Kindly suggest any possible alternative method.

Thank you
VictorPS is offline   Reply With Quote
Old 30th October 2007, 03:59 PM   (permalink)
Default

Quote:
Originally Posted by blueroomelectronics
That's why PWM is popular for controlling light levels.
PWM is flickering, even with high freq, it may not accept for high speed camera light source.

If can, I will use DMX to control the brightness.
VictorPS is offline   Reply With Quote
Old 30th October 2007, 04:04 PM   (permalink)
Default

Quote:
Originally Posted by VictorPS
Hi ericgibbs,

The current is from range about >0.01A to 0.5A (max), prefer with 8bit resolution, 256 step.

I now is hard to start from 0mA, but start from 10mA will be acceptable.

Kindly suggest any possible alternative method.

Thank you
Hi,
I was thinking of this type of constant current source, 255 CC combinations.
refer attached pdf.

If the Vce sat of the ULN transistor is is too high, they could be FETs or power BPTs.


EDIT: A variant of this circuit would be to have a fixed value emitter resistor and drive the Vref from the PWM output of a PIC.
The PWM signal would be filtered/smoothed before controlling the transistor/FET CC.
Attached Files
File Type: pdf CC4LED1.pdf (8.3 KB, 12 views)
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 7th July 2008 at 11:22 AM.
ericgibbs is online now   Reply With Quote
Old 31st October 2007, 12:54 AM   (permalink)
Default

Hi Eric,

Thanks for the drawing and the variant of circuit.
Now I have 3 methods for the design.

The design are base on either R2R DAC, PWM DAC, or resistor switching.

Is it possible that I use shift registor to generate multiple PWM? If I stream fast enough..., also will the programming become complicated?

Choosing Shift register is because it can cascade and expand easily .
The PIC software PWM may have limitted channel and low freq.
VictorPS is offline   Reply With Quote
Old 31st October 2007, 04:54 AM   (permalink)
Default

You could use a digital potentiometer with the LM317?

http://ww1.microchip.com/downloads/e...Doc/21940A.pdf
http://ww1.microchip.com/downloads/e...Doc/22017a.pdf

I *think* its SPI controlled, which means a small micro controller could handle it (software SPI, or hardware with a larger micro). To get the full range form it would just require you to calculate the value of a resistor in series with it.


And if you're really after accuracy.....use a current sense resistor...with an opamp, and an ADC in the microcontroller to get a feedback loop.

But of course, a micro with PWM (through a low pass filter) would do just fine. 8-bit PWM isn't that tricky to do, some PIC's have hardware modules which will do it for you, but for software, its just counting.

I believe the PIC's hardware PWM (CCP module) can run pretty fast...more than fast enough to generate a varying DC voltage with a small low pass filter.

Some more idea's there..

I'm doing this myself, but with 'step range' as in only 3 values of current needed, and I'm using a 12F675 and a logic level MOSFET (with biasing transistor).

Blueteeth
__________________
Inconsistency is the key to flexibility!
Blueteeth is offline   Reply With Quote
Old 31st October 2007, 01:13 PM   (permalink)
Default

currentsouce.gif
This is one way of getting a programable current source from a microcontroller.

R1 = 30khm:
R3 = 10khm:
R2 will have a maximum of 1.66 V across it and you set the maximum LED current by the value of R3.
You can put several LEDs in series, depending on the supply voltage.

You can daisy-chain several LT1257s if you want.

The brightness works the wrong way round, in that 000 to the D/A is full on and FFF is off, but it is linear for current.

You might be able to find a more suitable D/A as the LT1257 is 12 bit, and it needs a high voltage supply to swing to 5V output.

Multiple PWM with a PIC is very difficult, unless they have hardware modules to do it. The problem is that the program can only change one output at a time and if there are several outputs opperating at different times it is difficult to devise code to do it all at the right times. You could do it with multitasking code if you don't mind it not being very accurate.

The circuit that I have suggested will also work with a PWM feeding a smoothing circuit, which then feeds the R1, and the A/D is not needed.
Diver300 is offline   Reply With Quote
Old 31st October 2007, 01:24 PM   (permalink)
Default

If you only need a handful of level setting the Analog VREF output on most PICs with comparators has about 32 settings.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 31st October 2007, 02:03 PM   (permalink)
Default

Quote:
Originally Posted by VictorPS
Hi Eric,

Is it possible that I use shift registor to generate multiple PWM? If I stream fast enough..., also will the programming become complicated?

Choosing Shift register is because it can cascade and expand easily .
The PIC software PWM may have limitted channel and low freq.
The TPIC6595A S/R has a number of useful features.

www.datasheetarchive.com
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 31st October 2007, 02:33 PM   (permalink)
Default

Quote:
Originally Posted by Diver300
Can I use LM317 instead of MIC29152?
VictorPS is offline   Reply With Quote
Old 31st October 2007, 02:39 PM   (permalink)
Default

It is use for industrial machine, for vision inspection test, each test need at least 4 channel light source at different angle and brightness, for quad test, it will need 16channel.

http://www.electro-tech-online.com/m...nt-source.html
VictorPS is offline   Reply With Quote
Old 31st October 2007, 04:55 PM   (permalink)
Default

Quote:
Originally Posted by VictorPS
Can I use LM317 instead of MIC29152?
Sorry, but no.

That design needs a voltage regulator that controls the feedback pin to 1.2V or so to ground.

The LM317 controls the feedback pin to 1.2V less than the output.
Diver300 is offline   Reply With Quote
Old 1st November 2007, 03:34 PM   (permalink)
Default

hi Victor,

Looking at the constant current range you require for the LED's, how are you planning to connect the LED's to the CC source?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Current source GagoX Electronic Projects Design/Ideas/Reviews 13 12th January 2008 06:32 PM
Generation n Divsn of Const. Current Source naveensmk Electronic Projects Design/Ideas/Reviews 0 12th June 2007 05:29 AM
LM 317T Constant current charging problem Suraj143 General Electronics Chat 11 4th June 2007 06:22 PM
Current and Conductivity ElectroMaster Electronic Theory 1 2nd February 2007 12:49 PM
programmable current source from a microcontroller bajgik General Electronics Chat 11 30th April 2006 10:48 AM



All times are GMT. The time now is 08:27 AM.


Electronic Circuits  |  Electronics Wiki
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.