One of the most underused features of Arduino are the Pull-Up Resistors of the Digital pins. We all know that they are there, and yet we keep forgetting that we can use them, and keep adding external resistors when they are not needed. In this Tutorial, I will show you how easy it is to use them in Visuino - an easy to use graphical development environment for Arduino.
The Pull-Up Resistors are most often used when working with digital switches, and one of the simplest, and easily available switch of them all is just 2 wires, so...
Step 1: Components- One Arduino compatible board (I use Arduino Nano, because I have one, but any other will be just fine)
- 2 Male-Female jumper wires
- Connect one wire(Black wire) to the Ground pin of the Arduino (Picture 1)
- Connect the other wire(White wire) to the Digital pin 2 of the Arduino (Picture 1)
- Picture 2 shows where are the Ground, and Digital 2 pins of the Arduino Nano
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/ .
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Tutorial will not work!
The Visuino: https://www.visuino.com also needs to be installed.
- Start Visuino as shown in the first picture
- Click on the "Tools" button on the Arduino component (Picture 1) in Visuino
- When the dialog appears, select Arduino Nano as shown in Picture 2
- Connect the "Out" pin of the Digital[ 2 ] channel of the Arduino component to the "Digital" input pin of the Digital[ 13 ] channel of the Arduino component as shown on Picture 1
- In the Object Inspector expand the "Digital" property, then the Digital[ 2 ] sub property, and set the value of the IsPullUp sub property to True (Picture 2)
- In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
- In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)
On Picture 1 you can see the complete Visuino diagram.
If you run the project, when the wires are not connected the Pin 13LED will be ON(Picture 2), if you connect the wires, the LED will turn OFF (Picture 3)
Congratulations! You have learned how to use the Pull-Up Resistor functionality of the digital pins of your Arduino.
Also attached is the Visuino project, that I created for this Tutorial. You can download and open it in Visuino: https://www.visuino.com
Comments