I want to move the needle of the speedometer using arduino. I have connected the wire from the speedometer to one of the PWM pin. The arduino code is:
int pin = 9; //PWM pin
int speed = 100; // value to be written to the speedometer
void setup() {
// declare pin 9 to be an output:
pinMode(pin, OUTPUT);
}
void loop() {
// set the pin to the speed
analogWrite(pin, speed);
}
The problem is that when i set the speed value to anything below 140, the needle does not move at all whereas if i set the speed value to greater or equal to 140 the needle rotates fully to the maximum value on the speedometer. I want the needle to rotate to 100 if i set the pin to value 100. How can this be achieved? Any ideas.
We need a description of your speedometer, is it a simple DC Voltmeter? If so what is the full scale voltage?
Can you post a link or brand name / part number?
Actually earlier we were driving the speedometer through PLC. But now we want to do the same thing through Arduino.
In PLC, the following statement was driving the speedometer: