Electronic Design

  
Reprints     Printer-Friendly    Email this Article    RSS        Font Size     What's This?


[Ideas For Design]
Microcontroller Interface Delivers Standard 4- To 20-mA Output

R. Jayapal  |   ED Online ID #17297  |   October 25, 2007


Voltage-to-current converters that feed grounded loads are common in industrial measurement and control applications. The conventional "textbook" circuit uses both positive and negative supply rails.

An earlier article by this author titled "Voltage-To-Current Converter Works From A Single Supply Rail" (Electronic Design, Feb. 17, 2003, ED Online 2985) described a circuit that could power grounded loads and needed only a positive supply rail. In a microcontrollerbased application, a designer can use a digital-to-analog converter (DAC) to convert the digital data into an analog voltage and use it to create a 4- to 20-mA current output.

But Figure 1 shows a better way to generate an industry-standard 4- to 20-mA current output from 8-bit data (00â??FF) in a microcontroller-based system. This simple circuit uses a digital potentiometer (AD5260) driven by the microcontroller's serial peripheral interface (SPI) output.

Under ideal conditions, the voltages at the LM124 op amp's inputs (inverting and non-inverting) are the same:

where i is the current through the ground-referenced load; I is the current through the digital potentiometer as set by constantcurrent source; and RV is the potentiometer resistance between the wiper and one end.

Solving for i:

In the example, I is selected as 0.08 mA, R1 is 100 Ω, and R2 is 5000 Ω. Also, the AD5260 digital potentiometer's total resistance is 20 kΩ.

Hence:

Using a routine in the microcontroller, load 00 to the digital potentiometer through the SPI, which drives the wiper to one end so that RV is zero.

That makes:

Load FF into the digital potentiometer and the wiper goes to the other end so that RV is 20 kΩ. Therefore:

As a result, for the data 00 to FF, the load current varies linearly from 4 mA to 20 mA.

However, the digital potentiometer's wiper resistance is significant even when RV is low, which introduces an error. To eliminate this error, the digital potentiometer is connected as a voltage divider, with the wiper resistance in series with the op amp's non-inverting input.

If a 0.08-mA current source isn't readily available, you can use a National Semiconductor LM134 three-terminal adjustable current source and a potentiometer (VR1) to precisely set I at 0.08 mA (Fig. 2). Similarly, if a precise 5000-Ω resistance is unavailable for R2, a 10-kΩ multi-turn potentiometer can be employed.

The advantage of this circuit is its simplicity and the fact that it uses only three of the microcontroller's port lines (SPI), unlike a DAC, which requires eight port lines for the 8-bit data. The circuit uses only a positive supply rail for operation. Digital potentiometers also are available with I2C interfaces, with integrated op amps, and with different resistance values. Designers can adapt this circuit for use with these digital potentiometers.


Reprints   Printer-Friendly  Email this Article  RSS    Font Size   What's This?


  • Cadence Comes At Power From Two Perspectives
  • Collaboration Results In First IEEE 1149.7 cJTAG Semiconductor IP Core
  • Yield Enhancement Software To Aid Solar Cell Fabs
  • Audio Engine Codec Library Expands With Dolby Pro Logic Additions
  • Accellera Rolls New Version of Analog, Mixed-Signal Standard
  • 45-nm Via-Programmable ASICs Add High-Speed I/O Transceivers To Feature Mix
  • Verification Evolves Into Lean, Mean Bug-Stomping Machines
  • User Advisory Group To Guide Open Verification Methodology’s Evolution
    1) Build A Smart Battery Charger Using A Single-Transistor Circuit
    (305 views today)
    2) Use Inexpensive Components To Create An Infrared Close-Object Alert Circuit
    (209 views today)
    3) Easily Convert Decimal Numbers To Their Binary And BCD Formats
    (157 views today)
    4) Narrow-Shift Digital Discriminator Detects Differential GPS Corrections
    (155 views today)
    5) Embedded: FPGA Toolkit Supports Hard And Soft Processor Designs
    (137 views today)
    ALL TOP 20



    POST YOUR COMMENTS HERE
    Name:

    Email:
    Your Comments:

    Enter the text from the image below


    Please refresh the page if you have trouble reading this text.

    Search Electronic Design
         
      
     
    Email Newsletter
    Sponsored By:
    The Find Power Products monthly newsletter brings you the most important new developments within the world of power design. The newsletter includes exerpts from industry leader Sam Davis's exclusive blog, as well as overviews of the latest new products.

    Enter Email to Subscribe
      
    Web Seminar
    Sponsored By:
    Title: Exploring How Good GUIs Drive Adoption in the Digital Power Management Space
    Speakers: Don Tuite Deepak Savadaatt
    Date: 10/24/07
    Register: 

    Electronic Design Europe Electronic Design China EEPN Power Electronics Auto Electronics Microwaves & RF RF Design
    Schematics Find Power Products Military Electronics Featured Vendors EE Events Free Design Resources