Smart Home Automation Forum
Questions about Analog Inputs KC868-A16 - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-A16 (https://www.kincony.com/forum/forumdisplay.php?fid=25)
+--- Thread: Questions about Analog Inputs KC868-A16 (/showthread.php?tid=7421)



Questions about Analog Inputs KC868-A16 - Decilitr - 01-19-2025

Hi all!
I received my KC868-A16 board and now experimenting with it. My goal is to use it for Home Assistant.
Digital inputs and outputs work fine, but there are some confusing points with analog inputs.
I would appreciate clarification.

1. I used the lines from the example .yaml file and it turned out that because of the lines
------------------------------------
    filters:
      - lambda:
          if (x >= 3.11) {
            return x * 1.60256;
          } else if (x <= 0.15) {
            return 0;
          } else {
            return x * 1.51;
          }
------------------------------------
the measured voltage values were greatly inflated. So I removed these lines from my .yaml file and the voltage values became correct.
What were these lines in the original example for anyway?

2. When the same voltage is applied simultaneously to all four analog inputs, the spread of readings between them is no more than 5%. This is very good accuracy, but can it be increased by changing the parameter "attenuation: 11db" ?

3. When connecting each of the analog inputs to ground, the voltage value is not 0V but 0.14V
Is there any way to fix this?

4. And the main problem. When the input voltage changes from minimum to 3.14V, its value is displayed correctly. However, when the input voltage increases from 3.14V to 5V, it stops changing and always shows 3.14V, which is obviously wrong.
What is the problem here?


RE: Questions about Analog Inputs KC868-A16 - admin - 01-19-2025

you can check with this video , how to config analog input ports for ESPHome.
https://www.kincony.com/forum/showthread.php?tid=3499


RE: Questions about Analog Inputs KC868-A16 - Decilitr - 01-30-2025

I bought two boards from Kincony - KC868-A6 and KC868-A16.
The analog inputs of these boards were configured identically in exact accordance with the video https://www.kincony.com/forum/showthread.php?tid=3499
However, they show the voltage value completely differently.
The KC868-A6 board shows absolutely correct input voltage values for all four inputs in the range from 0.1V to 5.0V.
The analog inputs of the KC868-A16 board show incorrect and overstated voltage values.
To understand the situation, here is a table of values:

Real input voltage      Voltage displayed by the board KC868-A16
1.2V -------------------- 1.84V
1.5V -------------------- 2.21V
2.0V -------------------- 2.94V
2.5V -------------------- 3.65V
3.0V -------------------- 4.37V
3.5V -------------------- 5.04V
4.0V -------------------- 5.04V
4.5V -------------------- 5.04V

As you can see, the board displays very high values of the input voltage.
However, starting from a value of about 3.2V, the displayed voltage is 5.04V and does not change further.
This situation occurs for all four inputs of the board KC868-A16.
What's the problem here?


RE: Questions about Analog Inputs KC868-A16 - admin - 01-31-2025

after our new year holidays, we will test, then feedback to you.


RE: Questions about Analog Inputs KC868-A16 - Decilitr - 01-31-2025

OK, thanks.
Moreover, I am not the only one with the same problem with the analog inputs of the board KC868-A16.
A very similar problem with the board KC868-A16 is described here:
https://www.kincony.com/forum/showthread.php?tid=7417
where with an input voltage of 1.5V the board displays a voltage of 2.01V


RE: Questions about Analog Inputs KC868-A16 - Decilitr - 02-02-2025

Well, I think I have fully understood the problem with the KC868-A16 board.
And it is a problem with the board hardware. With the current electrical circuit, this board cannot even theoretically measure input voltages in the range from 0 to 5V.
Let's look at a slightly simplified scheme of analog inputs 1, 2, 3, 4.
This is the actual scheme of my board and it matches the scheme in the description quite well.

   

And yes, inputs 1 and 2 of my board are current, and 3 and 4 are voltage.
As can be seen in the scheme, inputs 3 and 4 have a voltage divider - resistors R3 and R4. With these resistance values of these resistors, the coefficient of this divider is K=0.95. That is, if you apply a voltage of 2.0V to analog input 3 or 4, then the voltage of 2.0*0.95=1.9V will be supplied to the input of the operational amplifier U21, and when applying a voltage of 4.0V, we get 4.0*0.95=3.8V. Operational amplifier U21 is connected as a repeater, its gain K=1, which means the same voltage will appear at its output.
But assembly of two Schottky diodes BAT54S is connected to the output of the operational amplifier.
The Schottky diode has a forward voltage of about 0.4V. If the output of the operational amplifier is supplied with a voltage of 3.3+0.4=3.7V, the upper in the scheme Schottky diode will open and further increase in voltage will be impossible.
Thus, measuring the input voltage of the board's analog inputs with such element values is only possible for values no greater than 3.7V.
To fix this problem, you need to change the analog input divider circuit - replace the 510ohm resistor with a 5.1k resistor.
In this case, its division coefficient will be equal to K=0.66 and then when applying a voltage of 5.0V to the analog input, the voltage at the output of the operational amplifier will be 3.3V, that is, the Schottky diode will not open yet, the circuit will work correctly in the range up to the required 5V.
These resistors values are used on the board KC868-A6 that I also have and it measures input voltages in the range from 0 to 5V quite correctly.

   

But I am afraid that you have manufactured and sold many copies of the KC868-A16 board with incorrect analog input scheme. You should warn buyers about this. Or you can change the board description to indicate the input voltage range for analog inputs from 0 to 3.7V, where the board can work correctly.


RE: Questions about Analog Inputs KC868-A16 - admin - 02-03-2025

thanks for feedback ,YES, the CH1,CH2 on KC868-A16 work with 4-20mA signal. CH3,CH4 design for 0-5v signal.
the ESPHome ymal have support these two type of signal. About KCS firmware, we will update fix it in next version.
about the mistake on schematic have fixed, uploaded file at here: https://www.kincony.com/download/KC868-A16-schematic.pdf


RE: Questions about Analog Inputs KC868-A16 - Decilitr - 02-03-2025

Ok, as I understand it, in order for all four analog inputs of my KC868-A16 board to work in the voltage range from 0 to 5V, I need to install 5.1k and 10k SMD resistors according to the corrected schematic. I can do this.
No other changes to the electrical circuit are required?


RE: Questions about Analog Inputs KC868-A16 - admin - 02-04-2025

YES, you are right, only change two resistors for switch 4-20mA or 0-5v signal.


RE: Questions about Analog Inputs KC868-A16 - Decilitr - 02-04-2025

OK, thanks