Sunday, November 17, 2013

Build Your Own Arduino Board

5 comments:



Need more Arduino board? Do not spend more money for another one. Why not try to build your own DIY Arduino board? It is easy and simple.












atmega328p


















                                                            atmega328p







DIY Arduino Step 1
Get an Atmega328–PU or Atmega328P-PU (with bootloader inside).
A brief introduction on the Atmega328 chip:
  • 8-bit MCU
  • 32kB Flash Memory
  • 1kB EEPROM
  • 2kB SRAM
  • 23 general purpose IO lines
  • 6-channel 10 bit ADC
  • SPI and I2C capabilities
Make Your Arduino Step 2
Connect the circuit as below:












arduino breadboard schematic



TAKE NOTE
In this post, I will talk about uploading sketches using FTDI programming port. In the next post, I will talk more about uploading sketches and burning bootloader using the ICSP programming port. Get one FTDI programmer here.
Build Your Arduino Step 3
Using FTDI programmer:
Now I will address one of the issues of making your own Arduino. On the Uno boards, there’s an IC which is responsible as a USB to serial converter and it makes it possible to program the Arduino and also communicate with it from the computer.
The problem here is the IC is an SMD (Surface Mounted Device). The R3 uses an ATmega 16U2 while the older revisions uses the 8U2. So, we need an FTDI programmer for the purpose of uploading the code/sketch into the chip.
FTDI programmer
FTDI programmer
When you first plug in your FTDI programmer into your laptop, you have to install the driver file. Get the driver file here.
Once installed, just connect the FTDI programmer to the FTDI programming port of DIY Arduino accordingly.
Finally just click on upload to upload the code into the chip!
If you don’t have the extra 16 MHz crystal and 18-22 picofarad capacitors used in the above examples, you can configure the ATmega328 to use its internal 8 MHz RC oscillator as a clock source instead. You don’t really need the 10K pullup resistor on the reset pin either, so we remove it to get a truly minimal configuration.
You’ll need to install support for an additional hardware configuration:
  • Download this hardware configuration archive: breadboard.zip
  • Create a “hardware” sub-folder in your Arduino sketchbook folder (whose location you can find in the Arduino preferences dialog). If you’ve previously installed support for additional hardware configuration, you may already have a “hardware” folder in your sketchbook.
  • Move the “breadboard” folder from the zip archive to the “hardware” sub-folder of your Arduino sketchbook.
  • Restart the Arduino software.
  • You should see “ATmega328 on a breadboard (8 MHz internal clock)” in the Tools > Board menu.
Once you’ve done this, you can burn the bootloader and upload programs onto your ATmega328 as described above. Be sure to select “ATmega328 on a breadboard (8 MHz internal clock)” when burning the bootloader.
If you select the wrong item and configure the microcontroller to use an external clock, it won’t work unless you connect one.
Finally, you have success in making your own DIY Arduino, meaning that you can upload arduino coding into your chip!
VINduino on stripboard
VINduino on stripboard

------------------------------------------------------------------------------------------------------------





Arduino YUN Release Date Anyone?

No comments:
According to the official statement Arduino is preparing its new release YUN, the first member of a new line of wifi products combining the power Linux with ease of use of Arduino. The release date is not revealed but I bet will happen soon and am so excited about this news, probably will be one of their first buyers.
BTW does anyone knows when Arduino YUN will be released because I really want to start making some interesting Arduino projects with it?








































Arduino YUN Specs

  • Microcontroller: ATmega32u4
  • Operating Voltage: 5V
  • Input Voltage: 5V via microUSB or PoE 802.3af
  • Input Voltage: 6-20V
  • Digital I/O Pins: 14
  • PWM Channels: 7
  • Analog Input Channels: 6 (plus 6 multiplexed on 6 digital pins)
  • DC Current per I/O Pin: 40 mA
  • DC Current for 3.3V Pin: 50 mA
  • Flash Memory: 32 KB (ATmega32u4) of which 4 KB used by bootloader
  • SRAM: 2.5 KB (ATmega32u4)
  • EEPROM: 1 KB (ATmega32u4)
  • Clock Speed: 16 MHz
  • Processor: MIPS 24K operating at up to 400 MHz
  • Memory: DDR2 64MB Ram and 16 MB SPI Flash
  • AP or router: Complete IEEE 802.11bgn 1×1
  • Host/Device: USB 2.0
  • MicroSD: PoE compatible 802.3af card support

Basic Types and pinout of Arduino

2 comments:

Arduino Uno Pinout

 

Arduino Uno R3 Pinouts

Input and Output
Each of the 14 digital pins on the Arduino Uno can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: pins 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data. These pins are connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: pins 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.
The Uno has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function. Additionally, some pins have specialized functionality:
TWI: A4 or SDA pin and A5 or SCL pin. Support TWI communication using the Wire library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

Arduino Leonardo Pinout


arduino leonardo pinout


Input and Output
Each of the 20 digital i/o pins on the Arduino Leonardo can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data using the ATmega32U4 hardware serial capability. Note that on the Leonardo, the Serial class refers to USB (CDC) communication; for TTL serial on pins 0 and 1, use the Serial1 class.
TWI: 2 (SDA) and 3 (SCL). Support TWI communication using the Wire library.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, 11, and 13. Provide 8-bit PWM output with the analogWrite() function.
SPI: on the ICSP header. These pins support SPI communication using the SPI library. Note that the SPI pins are not connected to any of the digital I/O pins as they are on the Uno, They are only available on the ICSP connector. This means that if you have a shield that uses SPI, but does NOT have a 6-pin ICSP connector that connects to the Leonardo’s 6-pin ICSP header, the shield will not work.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.
Analog Inputs: A0-A5, A6 – A11 (on digital pins 4, 6, 8, 9, 10, and 12). The Leonardo has 12 analog inputs, labeled A0 through A11, all of which can also be used as digital i/o. Pins A0-A5 appear in the same locations as on the Uno; inputs A6-A11 are on digital i/o pins 4, 6, 8, 9, 10, and 12 respectively. Each analog input provide 10 bits of resolution (i.e. 1024 different values). By default the analog inputs measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.


Arduino Mega 2560 Pinout


Arduino Mega 2560 Pinout


Input and Output
Each of the 54 digital pins on the Arduino 2560 Mega can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX);
Serial 1: 19 (RX) and 18 (TX);
Serial 2: 17 (RX) and 16 (TX);
Serial 3: 15 (RX) and 14 (TX).
Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip.
External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 2 to 13 and 44 to 46. Provide 8-bit PWM output with the analogWrite() function.
SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication using the SPI library. The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.
TWI: 20 (SDA) and 21 (SCL). Support TWI communication using the Wire library. Note that these pins are not in the same location as the TWI pins on the Duemilanove or Diecimila.
The Mega2560 has 16 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and analogReference() function.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.


Arduino Mega ADK Pinout

 

Arduino Mega ADK Pinout




 Input and Output
Each of the 50 digital pins on the Arduino Mega ADK can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX);
Serial 1: 19 (RX) and 18 (TX);
Serial 2: 17 (RX) and 16 (TX);
Serial 3: 15 (RX) and 14 (TX).
Used to receive (RX) and transmit (TX) TTL serial data. Pins 0 and 1 are also connected to the corresponding pins of the ATmega8U2 USB-to-TTL Serial chip.
External Interrupts: 2 (interrupt 0), 3 (interrupt 1), 18 (interrupt 5), 19 (interrupt 4), 20 (interrupt 3), and 21 (interrupt 2). These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 2 to 13 and 44 to 46. Provide 8-bit PWM output with the analogWrite() function.
SPI: 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS). These pins support SPI communication using the SPI library. The SPI pins are also broken out on the ICSP header, which is physically compatible with the Uno, Duemilanove and Diecimila.
USB Host: MAX3421E. The MAX3421E comunicate with Arduino with the SPI bus. So it uses the following pins:
Digital: 7 (RST), 50 (MISO), 51 (MOSI), 52 (SCK).
NB: Please do not use Digital pin 7 as input or output because is used in the comunication with MAX3421E
Non broken out on headers: PJ3 (GP_MAX), PJ6 (INT_MAX), PH7 (SS).
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off.
TWI: 20 (SDA) and 21 (SCL). Support TWI communication using the Wire library. Note that these pins are not in the same location as the TWI pins on the Duemilanove or Diecimila.
The ADK has 16 analog inputs, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and analogReference() function.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

Arduino Ethernet Pinout

 

Arduino Ethernet Pinout


 Input and Output
Each of the 14 digital pins on the Ethernet board can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin can provide or receive a maximum of 40 mA and has an internal pull-up resistor (disconnected by default) of 20-50 kOhms.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial data.
External Interrupts: 2 and 3. These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value. See the attachInterrupt() function for details.
PWM: 3, 5, 6, 9, and 10. Provide 8-bit PWM output with the analogWrite() function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI communication using the SPI library.
LED: 9. There is a built-in LED connected to digital pin 9. When the pin is HIGH value, the LED is on, when the pin is LOW, it’s off. On most other arduino boards, this LED is found on pin 13. It is on pin 9 on the Ethernet board because pin 13 is used as part of the SPI connection.
The Ethernet board has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits of resolution (i.e. 1024 different values). By default they measure from ground to 5 volts, though is it possible to change the upper end of their range using the AREF pin and the analogReference() function. Additionally, some pins have specialized functionality:
TWI: A4 (SDA) and A5 (SCL). Support TWI communication using the Wire library.
There are a couple of other pins on the board:
AREF. Reference voltage for the analog inputs. Used with analogReference().
Reset. Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

 

Arduino Due Pinout


Arduino Due Pinout


Input and Output
Digital I/O: pins from 0 to 53
Each of the 54 digital pins on the Due can be used as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions. They operate at 3.3 volts. Each pin can provide (source) a current of 3 mA or 15 mA, depending on the pin, or receive (sink) a current of 6 mA or 9 mA, depending on the pin. They also have an internal pull-up resistor (disconnected by default) of 100 KOhm.
In addition, some pins have specialized functions:

Serial: 0 (RX) and 1 (TX)
Serial 1: 19 (RX) and 18 (TX)
Serial 2: 17 (RX) and 16 (TX)
Serial 3: 15 (RX) and 14 (TX)
Used to receive (RX) and transmit (TX) TTL serial data (with 3.3 V level). Pins 0 and 1 are connected to the corresponding pins of the ATmega16U2 USB-to-TTL Serial chip.
PWM: Pins 2 to 13
Provide 8-bit PWM output with the analogWrite() function. the resolution of the PWM can be changed with the analogWriteResolution() function.
SPI: SPI header (ICSP header on other Arduino boards)
These pins support SPI communication using the SPI library. The SPI pins are broken out on the central 6-pin header, which is physically compatible with the Uno, Leonardo and Mega2560. The SPI header can be used only to communicate with other SPI devices, not for programming the SAM3X with the In-Circuit-Serial-Programming technique. The SPI of the Due has also advanced features that can be used with the Extended SPI methods for Due.
CAN: CANRX and CANTX
These pins support the CAN communication protocol but are not not yet supported by Arduino APIs.
“L” LED: 13
There is a built-in LED connected to digital pin 13. When the pin is HIGH, the LED is on, when the pin is LOW, it’s off. It is also possible to dim the LED because the digital pin 13 is also a PWM outuput.
TWI 1: 20 (SDA) and 21 (SCL)
TWI 2: SDA1 and SCL1.
Support TWI communication using the Wire library.
Analog Inputs: pins from A0 to A11
The Due has 12 analog inputs, each of which can provide 12 bits of resolution (i.e. 4096 different values). By default, the resolution of the readings is set at 10 bits, for compatibility with other Arduino boards. It is possible to change the resolution of the ADC with analogReadResolution(). The Due’s analog inputs pins measure from ground to a maximum value of 3.3V. Applying more then 3.3V on the Due’s pins will damage the SAM3X chip. The analogReference() function is ignored on the Due.
The AREF pin is connected to the SAM3X analog reference pin through a resistor bridge. To use the AREF pin, resistor BR1 must be desoldered from the PCB.
DAC1 and DAC2
These pins provides true analog outputs with 12-bits resolution (4096 levels) with the analogWrite() function. These pins can be used to create an audio output using the Audio library.
Other pins on the board:
AREF
Reference voltage for the analog inputs. Used with analogReference().
Reset
Bring this line LOW to reset the microcontroller. Typically used to add a reset button to shields which block the one on the board.

--------------------------------------------------------------------------------------------------------------





 


Control a Relay with Arduino

No comments:
In this quick Arduino tutorial I will explain how you can control a relay using the Arduino Board, one 1K and one 10K resistors, 1 BC547 transistor, one 6V or 12V relay, one 1N4007 diode and a 12V fan. When the button is pressed the fan will turn ON and will remain in this state until the button is pressed again.

                                  Download  Code of this tutorial  

                                         

 

Arduino Control Relay Schematic

arduino control relay schematic
How does the circuit works
When the button is pressed the Arduino board will put pin 2 in HIGH state, meaning 5V on pin 2. This voltage is used to drive the transistor that will switch ON the relay and the load (in our case the fan) will be powered from the main power supply.
You cannot use the 5V from the USB to power up the transistor and the LOAD because the USB port usually delivers only 100mA, and this is not enough to switch the relay and the LOAD. That is why you must use an external power supply (Vcc) that is between 7 to 12 volts to power up the Arduino board and the transistor + relay. The load uses its own power supply, for instance if you use a light bulb then you might connect it to the 110/220V mains or any other power source.