I'm pretty much a beginner with hands on electronics so I've decided to throw myself in at the shallow end with an arduino uno r3.
I've started a project and am happy dealing with leds, lcd displays and simple buttons but the project uses a home phone keypad that has 8 pins which, depending on the combination of pins bridged tells you which button has been pressed.
For example, if power is applied to pin 1 - if pin 5 has power then button 4 is pressed - if pin 6 has power then button 1 is pressed - if pin 7 has power then button 7 is pressed - if pin 8 has power then button * is pressed
My plan is to use 4 digital output pins and 4 digital (/ analog?) input pins. I'll set the first digital pin to high and check the value at each of the 4 inputs. Then move onto the second output and so on.
Am I going to blow some pins up on the arduino by connecting an output to an input? If not I'll continue.
Or, is there a better way?
Thanks in advance.
Each I/O pin is both an input and an output and can be used as both at the same time. Input pins are used to read the outside world and output pins are used to control the outside world.
1 - Yes the pin can be an output and an input at the same time. Meaning that you can read whatever you are driving on the pin.
Properties of Pins Configured as INPUT This means that it takes very little current to move the input pin from one state to another, and can make the pins useful for such tasks as implementing a capacitive touch sensor, reading an LED as a photodiode, or reading an analog sensor with a scheme such as RCTime.
An input/output pin, or I/O pin, is the interface between a microcontroller and another circuit. In the Arduino, you configure whether a pin is an input or output using the pinMode() function. Output pins. An output pin provides VDD or 0 V, by making a connection to VDD or ground via a transistor.
You are fine. The Arduino input pins cannot damage its own output pins. Here is why:
All the numbers you need are in the "DC Characteristics" section of the chip data sheet, with 28.1 "Absolute Maximum Ratings" being what everyone should pay attention to.
Voltage
Any pin can be damaged if you put an excessively high or low voltage on it. From 28.1:
Voltage on any Pin -0.5 V to Vcc+0.5V
Because the Arduinos run at 5 V, that means -0.5 to 5.5 V is safe. Since the chip only has 5 V, there is no ability for it to damage itself by exceeding this limit. If you had a 9 V battery and connected that to one of the IO pins, then you would damage the pin.
Current
An output pin will be damaged if you draw too large a current. From 28.1:
DC Current per I/O Pin = 40.0 mA
One of your output pins will be connected straight to an input pin when you press a button. So the question becomes "how much current will an input pin draw?".
An ideal input pin consumes zero current. The arduino pins consume pretty close to zero. From section 28.2:
Input Leakage Current I/O Pin low = 1 uA
Input Leakage Current I/O Pin high = 1 uA
But, you may turn on the internal pull up resistors (strike may -- you are going to, correct?). Those are in the same section:
I/O Pin Pull-up Resistor 20 - 50 kOhm
These pull up resistors contained in the input pin are the main load. So a logic 0 output will be loaded to 0.25 mA (=5 V / 20 kohm). A logic 1 output will be loaded 0 mA. In other words, completely safe.
So you see now, you are very much within the safe operating area. These specifications for current and voltage are the first items you want to understand before connecting things together.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With