having problems with Digital Inputs.

I have a input directly wired through a button with a 12VDC supply. My terminals are marked D30 to D37. I have the button wired to D30 and 12VDC- to COM. with a multimeter I am reading 12VDC between COM and D30 when the button is pressed and nothing when the button is up.

what I am trying to do is verify that the Digital input is receiving the signal through the serial.print method. any insight into what I am doing wrong? There isn't a clear definition that I can find that pinpoints the PIN # and the Digital input terminal position.

int PB = 2;

void setup() {

Serial.begin(9600); pinMode(PB,INPUT); }

void loop() {

int PBState = digitalRead(PB); if (PBState == HIGH) Serial.print("ON"); else Serial.print("OFF"); Serial.print(" ");

delay(3000); }

What kind of Arduino are you using?

12V is far too much for the input pins of most Arduino boards.

You're in danger of causing permanent damage.

Yes, if you connected +12v directly to ann Arduino input you have damaged your controller.

If there was no connection fron the GND of the 12 supply to the Arduino, consider yourself very very lucky.

On a 5 volt Arduino, inputs must only go between 0-5 volts.

.

documentation shows 3-24 volts

http://www.digital-loggers.com/plc.html

• USB programming. Full Arduino compatibility • WiFi with external long range antenna • Color LCD touch screen and speaker • Six fused DPST power relay. • Eight protected digital outputs with 500mA open collector drivers • Eight protected & isolated digital inputs 3-24V AC/DC • Eight protected 10-bit ADC inputs • Clock calendar & battery for scheduling • RS-232 for long distance wired comm • Expanded 128Mb & 4GB FLASH • DIN rail or panel mount

When you come to the Arduino forum for help with something that isn't a normal Arduino, don't you think it would be a good idea to let us know what you have up front so we don't waste time thinking it is something else? That just seems like common sense to me. Maybe sense just isn't common anymore.

Are there any other details you've left out that maybe you should get out there before you waste any more of our time?

First time dealing with it so i don't know if its normal or not. Its programmed with Arduino and this is where it referred me to go. So sorry to have taken your precious time.

If the digital pin you're connecting to is laballed D30, I think

int PB = 30;

might be a good first guess for pin number.

thank you for your reply, already tried pin 30 with no luck.

I think he's talking about a PLC input module.

Hi, Are you trying to interface the PLC to an Arduino micro or maybe your are in the wrong web side forum?

From the documentation: "The terminal names on the PLC match the legends on the Aurdino 2560 board, so it's easy to program the PLC using the default Arduino-compatible environment."

Maybe post a pic of how you have it wired?

756E6C: I think he's talking about a PLC input module.

tauro0221: Hi, Are you trying to interface the PLC to an Arduino micro or maybe your are in the wrong web side forum?

No, he's talking about a PLC based on an Arduino Mega2560

What'll they think of next? :o