Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

programmable current source from a microcontroller

Status
Not open for further replies.

bajgik

New Member
Hi,

i need to build a programmable current source from a 8051 micro controller, that give an output current from 0 to 10mA maximun. Can you please help me what methods to use and what circuits to build?

10x :wink:
 
There are a few ways you can go about setting this up.

The first piece you will need is a current source which can easily be made with an op-amp. If you do a search on google you can find a number of these circuits and the formulas that apply to them. These circuits will give you a current output that is proportional to the voltage you feed it.

The next part of the equation is to make an analog voltage using your 8051. One approach would be to use an external chip like a D/A converter or a Frequency to Voltage (F/V) converter. With the D/A you directly program an output voltage to drive the current source. With the F/V converter, you can generate a clock signal using a single pin and vary its frequency to get your variable voltage output.

There are a number of other combinations you could use if you want to get creative. I've used the D/A into an op-amp setup to make precision coil drivers before and they work very well.

Good luck!
 
It would very hard to build a 0.1uA current source, not to mention a zero mA one. (Building a 0V voltage source is easy)

Firstly you must set a limit on how high the resistance of the load be as everything else depends on that single piece of information.

Edited: 0mA is just open circuit, small current value is difficult.
 
That is why the process control standard for analog values is a 4-20 mA current loop.
 
What resolution do you need? How many steps between 0 an 10ma's?

I mean if you only need 10 steps or so, I would think it's possible to use some kind of resistor ladder.
 
Hi,
To give a decent answer we need to know the accuracy and resolution you need, or if you are not sure, what are you using it for? An idea of your programming expertise and language used would be useful too.
I'm sorry to be pedantic but the reason for industrial current loop signals ranging between 4 and 20mA is not because it's hard to get a zero current. The 4mA minimum is because the remote sensor is (optionally) powered by the signalling (4-20mA) current. The the minimum was zero there would be no power to operate the sensor.
 
hi,

as i mentioned in the first post i am using the 8051. the mehtod that i was going to use was with pwm output and then convert to current by an external circuit. The steps that i am going to make is 0.5mA so from 0 to 10mA is 20 steps.

My question is that how would i build this external circuit if i am going to use the pwm from the uc. if not what other types of methods are used?
 
G8RPI said:
Hi,
To give a decent answer we need to know the accuracy and resolution you need, or if you are not sure, what are you using it for? An idea of your programming expertise and language used would be useful too.
I'm sorry to be pedantic but the reason for industrial current loop signals ranging between 4 and 20mA is not because it's hard to get a zero current. The 4mA minimum is because the remote sensor is (optionally) powered by the signalling (4-20mA) current. The the minimum was zero there would be no power to operate the sensor.
Hi G8RPI,
There are many 0-20mA control/instrumentation systems still in use although the standard of 4-20mA is more common as this system has the advantage of a "live zero". When the transducer measures zero pressure or zero level, 4mA still flows but if a fault developed (open circuit), no current would flow and so alerting the operator that a fault exists. As you could see the 0-20mA system is at a disadvantage in this situation, the data aquired would just show zero pressure or zero level, a wire break would not be evident.
The sensor/amplifier are powered by the "voltage" of the loop which remains the same, the resulting current is the signal.
Cheers,
Grant
 
bajgik said:
any help plss! :!: :!:

Do you have trouble understanding simple english?

eblc1388 said:
Firstly you must set a limit on how high the resistance of the load be as everything else depends on that single piece of information.
 
bajgik said:
hi,

as i mentioned in the first post i am using the 8051. the mehtod that i was going to use was with pwm output and then convert to current by an external circuit. The steps that i am going to make is 0.5mA so from 0 to 10mA is 20 steps.

My question is that how would i build this external circuit if i am going to use the pwm from the uc. if not what other types of methods are used?

i think best oprtion bajik is to avoid PWM since you'll need ot for programmle power supply, as Nigel Godwin told me its better to use the R-2R ladder , or els as somone said use voltage to current convertor.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top