This project is a programmable encoder because its functionality depends on an Arduino Uno and its suitable code. Since the project is an encoder generates the numbers from 0 - 9, it'll also need a common cathode display and some switches for showing its practical use. Because this programmable encoder is ideal if you want to learn to manipulate switches in an Arduino environment, it'd be recommended its lecture and analysis so that you can better your projects with this new knowledge if this knowledge is unknown for you. Also, knowing about coding switches give you an extra skill for developing much more projects and ideas that you have. Then, for uploading the code, go to: http://pastebin.com/b6iUs1bh
If your project is dependable switches one, this this project is a good option so that you can begin or continue learning about manipulating switches in an Arduino environment.
What you will need:
Soldering Iron Solder
Wire #22 (5m)
9 Volt Battery
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: List of Materials
1 Arduino MEGA Protoboard PCB (Rev3)
1 Arduino Uno R3 DIP Edition (Revision 3)
1 Red Common Cathode Display 697nm LHDP/RHDP
7 Resistor Carbon Film 220 Ohm 1/4 Watt 5%
11 Resistor Carbon Film 10k Ohm 1/4 Watt 5%
11 Switch Push Button Tactile Single Pole Single Throw Off Momentary (On)
1 Connector Unshrouded Header 40 Position 2.54mm Straight Thru-Hole
1 ABS Plastic Enclosure for Arduino Boards - Fits UNO or MEGA
1 Cable USB2.0 A/B 3 Feet Black USB-A Male To USB-B Male
1 9V Battery Snap with 2.1mm Barrel Plug
Step 2: Schematic Diagram
The schematic diagram shows clearly how to connect the switches and the common cathode display to the corresponding Arduino pins.
Step 3: Identifying the Common Cathode Display
This step shows the corresponding CC display pins from A to G.
Step 4: Installing the Common Cathode Display
Once installed the CC display in the PCB, identify the corresponding pins form A to G so that you can connect them correctly later.
Step 5: Connecting the Resistors to CC Display
Connect the 7 resistors of 220 Ohm to your common cathode(CC) display and Arduino Uno respectively and according to the connections showed in the photo. That is, the resistors are connected between Arduino Uno and the CC display pins and you shouldn't also forget the connection to GND from CC display pin 16.
Step 6: Install 10 Resistors of 10k
Install 10 resistors of 10K without forgetting the common connection to GND while leaving free the remaining leads of those resistors installed.
Step 7: Install the 11 Switches
Once installed the 11 switches, define and mark each switch with its respective number so that you can identify them. That is, you will have a keyboard from 0 to 9 and Clear.
Step 8: Connecting the Switches to +5V
Each switch should be connected to +5V, so you need to take a pin of each switch to be connected to +5V while the remaining pin of each switch will be connected to an Arduino pin and a resistor of 10K respectively.
Step 9: Connecting the Switches: Clear, 9, and 8
Connect the switches marked with a clear, 9, and 8 to D3, D4, and D5 Arduino pins respectively.
Step 10: Connecting the Switches: 7, 6, 5, and 4
Connect the switches marked with the numbers: 7, 6, 5, and 4 to D6, D7, D8, and D9 Arduino pins individually.
Step 11: Connecting the Switches: 3, 2, 1, and 0
Connect the switches labeled with a 3, 2, 1, and 0 to D10, D11, D12, and D13 Arduino pins respectively.
Step 12: Connecting the 11th Resistor of 10K
Once connected the 11th resistor of 10K and without forgetting the connection to GND also, draw connections from the remaining leads of the 11 resistors of 10K now to D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, and D13 Arduino pins individually.
Step 13: Preparing the Pins
Prepare the 6, 6, 7, and 2 pins for your project.
Step 14: Insert the Pins in Your Arduino
Insert the pins previously prepared in your Arduino so that you can solder them later.
Step 15: Soldering the Pins Previously Inserted in Your Arduino
Solder the pins previously inserted inside your Arduino so that you can join them with the PCB of your project.
Step 16: Uninstall Your PCB Completed
Uninstall your PCB completed so that you can observe its backside and check if its connections are correct.
Step 17: Reinstall the PCB Newly
Reinstall newly the PCB on the Arduino so that you can present your project completed.
Step 18: Install the Project Completed Inside Your Arduino Enclosure
Now, it's time of installing your project completed inside your Arduino enclosure so that you are prepared to upload the code.
Step 19: Upload the Code
For uploading the code, go to: http://pastebin.com/b6iUs1bh
Step 20: Install the Clip 9V Battery
Installing the clip 9 volt battery, you can use your 9V battery.
Step 21: Using the Project
Once uploaded the code of your project, you can use it. Just press any switch and a number will appear in the display, except when you press clear.