01-19-2025, 08:00 PM
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?
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?