MCP3428 12 Channel Board Inconsistent Readings



I have been trying to read a typical PT100 4-20mA temperature sensor (-50 to 150c) with the 12 channel board and the ESP32. I am probably doing something terribly wrong here but I am seeing very large jumps between readings.

I made a quick loop just on one channel and that is when I noticed the huge swings. The sketch comes from an example I got off github from controleverything.

My concern isn’t the slapdash attempt to convert this to current or Celsius but the raw readings are all over the place. The signal I am getting is unusable in its current form. Is this something wrong with my hardware or am I doing something wrong here? The 4-20mA loop is currently working with an Industruino and has been rock solid for about a year now.

Output example;
Analog: 13487 Current: 9.30603 Temp: 16.32537
Analog: 13374 Current: 9.22806 Temp: 15.35075
Analog: 13088 Current: 9.03072 Temp: 12.88400
Analog: 12721 Current: 8.77749 Temp: 9.71863
Analog: 12530 Current: 8.64570 Temp: 8.07125
Analog: 12588 Current: 8.68572 Temp: 8.57150
Analog: 12905 Current: 8.90445 Temp: 11.30562
Analog: 13252 Current: 9.14388 Temp: 14.29850
Analog: 13516 Current: 9.32604 Temp: 16.57550
Analog: 13687 Current: 9.44403 Temp: 18.05038
Analog: 13791 Current: 9.51579 Temp: 18.94737
Analog: 13802 Current: 9.52338 Temp: 19.04225
Analog: 13747 Current: 9.48543 Temp: 18.56787
Analog: 13684 Current: 9.44196 Temp: 18.02450
Analog: 13614 Current: 9.39366 Temp: 17.42075
Analog: 13523 Current: 9.33087 Temp: 16.63587
Analog: 13477 Current: 9.29913 Temp: 16.23913
Analog: 13435 Current: 9.27015 Temp: 15.87687
Analog: 13349 Current: 9.21081 Temp: 15.13513
Analog: 13183 Current: 9.09627 Temp: 13.70337
Analog: 12938 Current: 8.92722 Temp: 11.59025
Analog: 12712 Current: 8.77128 Temp: 9.64100
Analog: 12570 Current: 8.67330 Temp: 8.41625

Arduino code below;

Distributed with a free-will license.
Use it any way you want, profit or free, provided it fits in the licenses of its associated works.
This code is designed to work with the MCP3428_I2CADC I2C Mini Module available from

#include <MCP3428.h>
#include <Wire.h>

MCP3428 MCP(0x6F); // Declaration of MCP3428: A2, A1, A0 bits (000, 0x68)

void setup() {
// Start serial communication and set baud rate = 9600
Serial.println(“MCP3428 Analog to Digital Converter”);

double mapf(double x, double in_min, double in_max, double out_min, double out_max) {
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;

void loop() {

MCP.SetConfiguration(1, 16, 1, 2);

// Note that the library waits for a complete conversion
long raw = MCP.readADC();

double current = raw * 0.00069;
double temp = mapf(current, 4.0, 20.0, -50.0, 150.0);
//double f = ((temp * 9.0 / 5.0) + 32.0);

// print results
Serial.print("Analog: “);
Serial.print(” Current: “);
Serial.print(current, 5);
Serial.print(” Temp: ");
Serial.println(temp, 5);




I have changed the power supply. I changed ports I am reading from. I checked the 4-20mA device itself with a multimeter. It just seems to be a very unstable analog read. It definitely has a sine wave quality to it though. Does NCD have somebody to help us or is just us toadies down here on the forums?

When I get a chance I will hook up my Drok signal generator and see what happens then.



I will recommend doing this
take ADC readings at

  1. 4mA
  2. 12mA
  3. 20mA
    Take an average of the values and use that as your 4-20mA multiplier.
    The board parts have a 2% tolerance so there will be an error in the readings but using the above method you will be able to get quite accurate readings.


Thanks for the reply @Bhaskar. I will do that. But that 2% doesn’t explain the sine wave like up and down I am read from the unit. 2% error would be like noise and this has a very apparent sine wave.

I will get the Drok SG-02 on it and post an update later today. Right now I have to make a call and just push the product as it stands. My client isn’t happy with the number of units or the Ethernet cables he has to string all over the plant. The 12 channels per unit and wireless would have been great. Certainly much cheaper money and time wise :frowning:



@Bhaskar After hooking up the Drok SG-02 signal generator it did just what if had been doing before.

I unhook it and use any of the other equipment that reads 4-20mA and I read as close to a stable output as one could get it. At this point something is terrible wrong with this device. It is unusable in this condition.

Does NCD read these forums or do I have to file a tech support ticket?



Try 12bit resolution.
can you share the ADC values at

  1. 4mA
  2. 12mA
  3. 20mA

What kind of power supply are you using. if its a noisy power supply it will skew the ADC values.




The power supply on the test bench is a Siglent Technologies SPD3303X-E. It drives both the 12 volt and 24 volt line. It isn’t the best power supply but it would not produce the sine wave I see in the readings because I checked with an oscilloscope. That was all last week, eliminating myself and my bench before I started complaining.

I did try the 12 bit readings as well. I did not record them.

So the NCD hardware is off the bench. I will have to revisit on my own time. Right now I have to make up for the lost time and get the software finished or I won’t have any money come May!



99% time this kind of readings show up when there is noise either on the input lines or the power lines. You can add 10uF at the 4-20mA inputs.

here is a user who was having similar noise issues and they had to ADC avg in order to get stable readings.

when you get a chance try using two different power supply one for the board and one for the 4-20mA sensors.



Sorry if I wasn’t clear earlier, the test bench power supply is a Siglent and the installation is all Mean Well. I even tried a 12 volt supply from the LED lighting system over the bench. The issue was present in all. I will have no control over the power supply because it is existing system that I am adding too.

The application is to drive phase angle fired SCRs attached to an array of resistive heating elements. If noise is a problem on the test bench I think the NCD equipment will not be suitable for this project because of the simple fact the environment will only get nosier in production, not less.

This was always a gamble. I bet and lost, it happens. At some point I will revisit and figure out the real problem. Right now I have to recover the time spent.

Thank for your time!

1 Like


I have the same issue with my MSP3428 4-channel 4mA-20mA device. I get a clear sinusoidal pattern from the ADC. I have a circuit with a resistor and a power supply. I have but a fluke scope to measure the current that is stable at 5.97mA. But get readings that go from 0 to 1450 and then back to 0 again.
I use the lib provided by zaphod-42.
Running 12bit convertions with resolution gain set at 2. And doing continus conversions.
Any help would be fantastic



Update! It was I who was the culprit!
I hade - and + reversed in to the board… When I got that right it worked…