Emonlib only some inputs are working

Hello,
I have designed a little board to read 4 SCT-013 60A/1V Sensors. All wired up like this. Board is an Arduino Nano.

I now have the strange behavoir, that the values of two inputs work fine, but the other two not. I have read the analog inputs directly to see if there is something wrong but for me all looks ok.
Do you have any Idea why input 3 und 4 (gree and yellow) work and 1 and 2 (blue and red) not?
1 and 2 have a little lower voltage, but I don't think that should be a problem.

Thank You

Here are the plots.
Analog inputy read directly without load

Code.
When I set DEBUG to false I get the output of Emonlib, if I set it to true I get the direct readings

#include "EmonLib.h"
EnergyMonitor emon1,emon2,emon3,emon4;

#define DEBUG false

#define ADC_INPUT1 1
#define ADC_INPUT2 2
#define ADC_INPUT3 3
#define ADC_INPUT4 4

void setup()
{
  Serial.begin(500000);

  if (!DEBUG)
  {
  emon1.current(ADC_INPUT1, 111.1);             
  emon2.current(ADC_INPUT2, 111.1);             
  emon3.current(ADC_INPUT3, 111.1);             
  emon4.current(ADC_INPUT4, 111.1);             
  }
}

void loop()
{
  if (not DEBUG)  
  {
    double Irms1 = emon1.calcIrms(1480);  
    double Irms2 = emon2.calcIrms(1480);  
    double Irms3 = emon3.calcIrms(1480);  
    double Irms4 = emon4.calcIrms(1480);  
    
    Serial.print(Irms1);           
    Serial.print(" ");
    Serial.print(Irms2);           
    Serial.print(" ");
    Serial.print(Irms3);           
    Serial.print(" ");
    Serial.print(Irms4);           
    Serial.println();               
  }
  else
  {
    Serial.print(analogRead(ADC_INPUT1)); 
    Serial.print(" ");
    Serial.print(analogRead(ADC_INPUT2)); 
    Serial.print(" ");
    Serial.print(analogRead(ADC_INPUT3)); 
    Serial.print(" ");
    Serial.print(analogRead(ADC_INPUT4)); 
    Serial.println();
  } 
}

I found the problem! The PINs for A1 and A2 where not soldered properly. Oddly enough they returned values but only if I read A3 too. Nevermind now its working fine :slight_smile:

Haha. When explaining the problem the fault is often found. Your description sounded like hardware error.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.