USER MANUAL ARDUINO I/O EXPANSION SHIELD Description: Sometimes Arduino Uno users run short of pins because there s a lot of projects that requires more than 20 signal pins. The only option they are left with is buying an expensive Arduino Mega or any other microcontroller with more pins. This shield provides a cheap solution to this problem by adding 18 signal pins to Arduino Uno. Arduino library associated with this shield makes it really easy to use the pins of this shield and perform basic input/output tasks. As there s no multi-threading feature, your Arduino Uno alone cannot perform two or more tasks simultaneously. This shield can be a way around to this issue as using this shield with Arduino Uno is like using two Arduino boards together. Advanced users can use this advantage by uploading their own program to the on-board atmega8 chip of this shield using Arduino Uno as ISP.
Specifications: Communication method with arduino board: I2C. No. of additional pins: 18. 4 additional ADC pins and 3 additional PWM pins. Dedicated arduino library for this shield. On-board microcontroller can be reprogrammed easily using arduino as ISP. L-shaped header helps using this shield when other shields are connected on top of it. Additional Pin Description: There are a total of 18 additional signal pins that this shield adds to Arduino Uno. They are labeled as 0-13, A0, A1, A2, & A3. Pin 9, 10 & 11 are the only PWM pins. You can use them to control a DC motors speed along with a motor controller. A0-A3 are the 4 ADC (analog to digital converter) pins. They can be used to read values from an analog sensor. There is also 5V and GND rails to help you power up multiple sensors and ICs using the power of Arduino Uno. The pins are arranged in two rows of female rail connectors. One is a standard flat rail and another is L shaped rail. The L shaped rail is useful when you ve placed another Arduino shield on top of this I/O shield (e.g.: LCD keypad shield). Two sets of connectors also helps you to connect 2 wires to a single pin. How it communicates with Arduino Uno: It s I2C communication that the shield uses to talk to Arduino. Arduino Uno pins A4 & A5 gets connected to the atmega8 A4 & A5 pins when this shield is attached. There s pull up resistors in this shield connected to the I2C buses. As pin A4 & A5 are used for communication, you cannot use them as digital/analog pins when you are using this shield. So, you ll have a total of 8 ADC pins (4 from Arduino Uno, 4 from the shield) when using this shield.
Library installation: This shield comes with its own Arduino library to make it really easy to use. There s also several example codes to get you started quickly. Download the.zip library from the document section of this product page of techshopbd. Open Arduino IDE (version 1.6 or higher), go to Sketch>Include library>add.zip library. Then browse to the IoExpansionShield.zip file that you just downloaded. To check if library is successfully installed, go to Sketch>Include library and check for IoExpansioShield. If you ve done everything correctly, you ll find it there. Go to File>Examples>IoExpansionShield and select one of the example codes to begin using the shield. As a reference, this video can help you if you haven t got it yet. Library Description: Currently the library supports the 5 basic arduino functions: 1. pinmode 2. digitalwrite 3. digitalread 4. analogwrite 5. analogread The structure of these functions are same as arduino core I/O functions. All you have to do is add an object of the ioexpansionshield class to distinguish them from similar arduino core functions. As an example, there s a modified blink code below. It will blink the Led of Arduino Uno pin 13 along with an LED connected to I/O Expansion shield pin 13. #include <IoExpansionShield.h> #include <Wire.h> IoExpansionShield shield; /*shield as object*/ void setup() { shield.pinmode(13,output); /*sets shield pin 13 as output*/ pinmode(13,output); /*sets Arduino Uno pin 13 as output*/ }
void loop() { shield.digitalwrite(13,high); /*sets shield pin 13 High*/ digitalwrite(13,high); /*sets Arduino pin 13 High*/ delay(500); shield.digitalwrite(13,low); /*sets shield pin 13 Low*/ digitalwrite(13,low); /*sets Arduino pin 13 Low*/ delay(500); } As you can see there s a lot of similarities between Arduino core I/O functions and the library functions of this shield. Advanced Usage: Note: Only advanced users are intended to do what s discussed in this section. As we won t provide the code that has been flashed to the Atmega8 microcontroller of this I/O Expansion Shield, users are advised not to upload a new code to it. They should remove this Atmega8 from the shield, keep it aside for future usage and connect their own Atmega8/ Atmega328 to this shield in case they want to upload their own code. We won t take any responsibility of any damage done to this product due to the usage described in this section. Suppose, you are about to build a robot that has both high precision wheel encoder and a servo motor driven robotic arm. You ll see the servo motor failing to maintain its position as soon as your arduino starts to read from wheel encoders (using external interrupts). This happens because your arduino doesn t have multi-threading e.g.: it cannot perform two or more tasks together. What you need in such case are two microcontrollers working asynchronously while maintaining occasional communication between them. This can be done by using this I/O expansion shield. There s a lot of similar cases you might face that requires using two or more microcontrollers. Remove the on-board Atmega8 chip from the shield for future usage and connect your own Atmega8 / Atmega328. You can program this microcontroller by using your arduino Uno as ISP when the shield is attached.
Process: 1. First connect Arduino Uno pin 11, 12, 13 to Shield pin 11, 12, 13 Arduino Uno pin 10 to Shield reset pin (any of the 2 white male connectors) 2. Connect Arduino Uno to PC, Open arduino IDE, go to File>Examples>ArduinoISP>ArduinoISP, go to Tools>Board>Arduino/Genuino Uno, select correct COM port and upload the sketch. 3. If you ve connected an Atmega328p to I/O Expansion shield, keep the board as Arduino Uno. If you ve connected an Atmega8, go to Tools>Board>Arduino NG or older and Tools>Processor>Atmega8. 4. Go to Tools>Programmer>Arduino as ISP. 5. Now write your code and upload it using programmer by pressing Ctrl+Shift+U or going to Sketch>Upload using programmer. Code will be uploaded to your Arduino Uno rather than the shields MCU if you accidentally press the upload button. 6. Once you ve uploaded a code to your Arduino Uno, you cannot use it to upload code to the shields microcontroller unless you repeat Step 2.