Activity › Forums › Questions & Troubleshooting › Mini Digital I/O not measuring up.
-
Mini Digital I/O not measuring up.
-
I’m using a 24 VDC supply with the following setup and loop to test why another (more complex) program isn’t working.
Setup:
pinMode(CONTROLLINO_D0, INPUT);
pinMode(CONTROLLINO_D1, OUTPUT);
pinMode(CONTROLLINO_D2, OUTPUT);Loop:
digitalWrite(CONTROLLINO_D1, HIGH);
digitalWrite(CONTROLLINO_D2, LOW);
digitalRead(CONTROLLINO_D0);With nothing attached, I read about 10.5V on D0, 24V on D1, and 10.5V on D2. As I understand a LOW should read 7.2V max with a 24V supply. The input I could see floating.
If I jumper D1 to D0, they both read 24V (but the D0 indicator LED on the unit doesn’t light up). If I jumper D2 to D0, they both read 20V. Same if I replace the jumper with a 33k Resistor.
There’s something simple I’m missing, right?
-
Hello Jarod997,
1) The digital outputs on the screw terminals are OUTPUTS. No INPUTS. Behind there is a digital high-side switch. Only on the pinheader pins you can use the IO as input or output … and only on 5V.
2) A high-side switch is an electronic switch. You are measuring something that is “not” there. Since an electronic switch NEVER cuts off 100% … you always have some nA or uA flowing. So, if we can agree that you would never use an output without a load … even a 100k resistor will perfectly pull the output to ground. You only can read a voltage because you a measuring with a Multimeter with some Giga-Ohm input resistance.
regards
Marco
Log in to reply.