Question regarding 4-20mA current loop input

Discussion in 'Analog & Mixed-Signal Design' started by RamanathanR, Sep 3, 2016.

  1. RamanathanR

    Thread Starter New Member

    Sep 3, 2016
    4
    0
    Hi,

    I am programming a c8051F850 to take in both a potentiometer and a 4-20mA current loop input through a ADC (0-3.3v mapped to 0-1023 10-bit range). However not being a electronics/board design engineer i would appreciate some help on the following circuit (see attached schematic). I read P1.3 with potentiometer input (from J12 with pin 2 not being used) and everything works ok. However i am not quite clear on how the current loop input (from J11) gets mapped to my expected 0-1023 range within the program. As i understand from the schematic, the 4-20mA input is sent over a 10ohm resistor thus converting it to a 40-200mV range (subset of the 0-3300mV range the ADC is configured for) and thence to a subset of the 0-1023 range to pin P1.0. Is my understanding correct? What then is the circuit on P1.1? How is it related to the circuit on P1.0?

    --Ram
     
  2. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,881
    373
    The 4-20mA passes through R15, 120Ω, which gives 0.48V - 2.4V. R14/C15 is a low pass filter but doesn't affect the DC voltage.
     
  3. RamanathanR

    Thread Starter New Member

    Sep 3, 2016
    4
    0
    Thank you. Is this (mapped to subset within 0-1023 ADC range) what i get from P1.0? What is P1.1 then? J12 has note saying "+ Switch" so i am wondering as to how that interacts with J11 (if any).
    Appreciate any and all insights/suggestions. Our hardware guys are all gone and hence the software guy (i.e. me) is now learning electronics to get this to work. I have got everything working other the current loop input :)
     
  4. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,881
    373
    P1.1 and P1.3 are signals from that box labelled 'variable resistor + switch'. As I have no information on the connections inside that box what follows is my best guess.
    P1.1 is 0 - 3V from the potentiometer
    P1.3 is 0V or 3V depending on the position of the switch.
     
  5. RamanathanR

    Thread Starter New Member

    Sep 3, 2016
    4
    0
    J12 (pin 2 is unused) is just a potentiometer connector. I read my MCU ADC via pin P1.3 in code for potentiometer state and process accordingly. This works. The confusion is w.r.t. J11. I think i need to read P1.0 for the current loop ADC. If so, what is the voltage range it is mapped to?
     
  6. AlbertHall

    Well-Known Member

    Jun 4, 2014
    1,881
    373
    P1.0 will give 0.48V - 2.4V for input currents of 4mA - 20mA. If your ADC is using a 3,3V reference that will give you readings of 149 - 744 from the ADC
     
  7. RamanathanR

    Thread Starter New Member

    Sep 3, 2016
    4
    0
    Thanks you.


    I got It to work by reading P1.0. 4-20mA over 120ohms gives me 480-2400mv. I configured ADC to range between 0-2.4v and adjusted the lower bound of 10-bit ADC from 0-1023 to 205-1023 in code.


    Still don't understand the schematic but that can only be learned in time :)
     
Loading...