News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

ADC with 7000 steps

Started by shantanu@india, Dec 05, 2022, 08:40 AM

Previous topic - Next topic

shantanu@india

Hi,
I have to design /assemble/test/deliver a 4-20mA digital indicator with a range of -3500 to +3500 within 3 days. What's the best ADC choice?
Regards
Shantanu

keytapper

Ignorance comes with a cost

Ivano

In some post, I don't remember where, Les spoke of oversampling at 13...14...16 bits with maximum 12-bit pic adc.
I don't know if it can be useful, otherwise you should find some 13-bit or greater adc to manage with a PIC

top204



John Lawton

I've used the Microchip MCP3561 device which is a very high resolution ADC.
https://www.microchip.com/en-us/product/MCP3561
It has an SPI interface. It is fair to say that it took me quite a while to get it working as it as the interface is complex. Three days is a very ambitious schedule for any project, and I wish you good luck.

John


keytapper

As I posted, I supposed that 14 bits would accomplish the request.
Ignorance comes with a cost

ken_k

#8
Hi Shantanu
I guess you are 1/3 of the way through this project by now. :)
I have a friend that swears by ADS115's they have a 16 bit ADC with a PGA, I2C coms. Many ADS115 boards are made as Arduino modules and may be available at your local electronics store.
I have had success with oversampling in the past and have no doubt a oversampled PIC would do the job.
Ken K

https://ww1.microchip.com/downloads/en/appnotes/doc8003.pdf

keytapper

I just recall that a hx711 has a good resolution for ADC sampling.
Ignorance comes with a cost

shantanu@india

Hi Ken,
Thanks for your input. No I'm not trying oversampling and would prefer 14/16 bit adc. The 3 day limit just went for a sixer!!
Keytapper.... HX711 had entered my mind but I'm not sure whether it can be used for non-bridge applications. I had used HX711 for load cells and they have excellent linearity. Can they be used to amplify the potential drop across a 4-20mA burden resistance? I have some in stock?
Regards
Shantanu

keytapper

#11
Quote from: shantanu@india on Dec 06, 2022, 12:03 PMCan they be used to amplify the potential drop across a 4-20mA burden resistance? I have some in stock?
Sorry I just thrown the idea as they have these two ADC channels. The module just has a little implemented what the IC manufacturer suggests. So at certain point it's a matter to have a look to the datasheet. In theory the primary channel is taking the measurement from a Wheatstone bridge. The second channel it can be used for a battery monitoring, but it has lower resolution.

Well this is what I can remember.

EDIT
I found the datasheet. Herein attached
Ignorance comes with a cost

Stephen Moss

Quote from: shantanu@india on Dec 05, 2022, 08:40 AMHi,
I have to design /assemble/test/deliver a 4-20mA digital indicator with a range of -3500 to +3500 within 3 days. What's the best ADC choice?
Is the high count required because you need the accuracy in general or just because the resulting voltage drop is likely to be so small you need that resolution to be able to measure it at all?
If the latter then did you consider using a differential amplifier to amplify the voltage drop across your burden resistor (one input tied to each end of the resistor) to a voltage that could be read with enough accuracy by a lower count ADC?

shantanu@india

Not a question of low voltage drop Stephen, it is the engineering range. This 4-20mA is being generated by a torque transducer that has a range from -3500Nm to +3500Nm
Regards
Shantanu

top204

If it is not required for absolute accuracy at a specific resolution, then the oversampling should work, if it is fast enough for the changes seen in the protocol.


rick.curl

I just saw this article: Dithering can eliminate quantization distortion, Which states that adding noise can actually improve the performance of an ADC. This is part of the reason that oversampling works.

-Rick

ken_k

Rick regarding the quantization distortion article, it is worth a read.

Re 4 to 20mA devices.
4 to 20mA devices have always fascinated me for their simplicity and durability.
This link is to an interesting device a loop powered digital LCD meter.
https://www.electricburst.com.au/products/4-20ma-loop-powered-lcd-meter-with-led-backlighting-dpm-742-bl?currency=AUD&variant=49410330575&utm_medium=cpc&utm_source=google&utm_campaign=Google%20Shopping&gclid=Cj0KCQiA1sucBhDgARIsAFoytUtRj5oooIPtps_I7wRRZTFy6hy4NYuhpcfDNSGSYzgalZqPFdTFIUMaAoaWEALw_wcB

Loop powered means no power supply is required and it could be inserted anywhere in a working loop. It has a 5 to 5.6V loop voltage drop, it is surprising somebody is not marketing a little programmable loop powered LCD or coloured e-paper display that could be programmed to display say loop current, loop faults <4mA and >20mA, pressure, temperature, RPM, speed etc.
The entire device would have to run on <3.5mA at <=5V; this should be quite doable with some of the devices available today.
 

shantanu@india

#17
Ken,
Loop powered displays are very much in the existence for the past 30 years! Just look at Emerson/Honeywell pressure transmitters with built-in LCD process display. The industrial loop power voltage is 24V by default.
I had designed loop powered valve position 4-20mA trasnmitters using LM10 metal packages. Those were amazing opamps which consumed a very low quiescent current and had a operating voltage of 3-45V!!!
Regards
Shantanu

top204

#18
I tried adding small pseudo random values to the ADC samples in my oversampling code, and it made very little difference to the final outcome. See the listing below for an ADC reading procedure that adds a small pseudo random value to the result:

'-------------------------------------------------------------------------------------
' Read the 10-bit ADC directly on a PIC18F26K22 device
' Input     : pChan holds the ADC channel to read
' Output    : Returns the 10-bit ADC value
' Notes     : Adds a pseudo random value into the first 2 bits of the ADC result
'           : This is for the oversampling
'
Proc ADC_Read10(pChan As Byte), Word
    Dim wADRES As ADRESL.Word                   ' Create a 16-bit SFR from ADRESL and ADRESH
    Dim bRand As Byte                           ' Holds the pseudo random number
   
    ADCON0 = 0b00000001                         ' Clear the channel bits and enable the ADC peripheral
    pChan = pChan << 2                          ' Move the channel bits into the correct position for ADCON0               
    ADCON0 = ADCON0 | pChan                     ' Or the channel bits into ADCON0
    bRand = Random                              ' Get a pseudo random value
    bRand = bRand & 0b00000011                  ' Mask out all but the first 2 bits
    ADCON0bits_GO_DONE = 1                      ' \ Wait for the ADC to complete its reading
    Repeat : Until ADCON0bits_GO_DONE = 0       ' /
    Result = wADRES                             ' Load the result with the ADC value  
    Result = Result | bRand                     ' Or in the pseudo random value bits
EndProc

I even tried it with true random values using my "really random" procedures that use an open ADC channel to gather bits for a random byte or word, and it made very little difference, but it is worth a try to see if it makes a difference for you.

On the 8-bit microcontrollers, the best way to get random noise is to use a clock for the ADC that is actually a little too fast, or use the FRC setting, so it is not as accurate.