Ok, sometimes I think to complicated.
It's a lot easier. There is a shaft inside until the cover.
On that shaft is a disc and this disc is just pinned. You can see the
disc in the image. The blue one with the red that is there to show
the heat. So i just need to drill a hole in the cover, remove the disc
and couple the potentiometer with a shaft coupling: ACHSKUPPLUNG 2: Achskupplung für Potentiometerachsen, gold bei reichelt elektronik
I make pictures when it's done.
But how is the calculation done.
It just turns 90°. So i think i need to open and close my valve and need to check the digital value (max and min) and at them to
the code.This is what i have for the hole range:
int valvePin = A0;
int valveValue = 0;
int valvePercentage = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
valveValue = analogRead(valvePin);
float voltage = valveValue * (5.0 / 1023.0);
valvePercentage = valveValue / 10 / 1.02;
// now print it
Serial.print("percentage: "); Serial.print(valvePercentage);
Serial.print(", volts: "); Serial.println(voltage);
delay(1);
}
But how do i set 400-800 as 100 percentage range?