Sound Sensor Library for Proteus

Update: We have created a new version of this library, which you can check here: Sound Detector Library for Proteus V2.0.
Hello friends, I hope you all are doing great. In today's tutorial, I am going to share a new Sound Sensor Library for Proteus. We are presenting this library for the first time and I would give the credit to our team, without their support it won't be possible. Proteus doesn't have this module in its library and it is used in a lot of Engineering Projects these days. This sound sensor is used to detect the sound in the surroundings and is normally known as the Sound Detector sensor. It won't recognize the sound. As we can't produce the sound in Proteus, that's why we have placed a TestPin. When this TestPin is HIGH, that means we have sound in the surroundings and if it's LOW then there's silence. Analog sound detector sensors are also available but our sensor is a digital one. So, now let's have a look at How to download & simulate this Sound Sensor Library for Proteus:
Where To Buy?
No.ComponentsDistributorLink To Buy
1Arduino UnoAmazonBuy Now

Sound Sensor Library for Proteus

  • First of all, download the Library files for the sound detector sensor by clicking the below button:
Sound Sensor Library for Proteus
  • Open this downloaded zip file, and extract below three library files:
    • SoundSensorLibraryTEP.LIB
    • SoundSensorLibraryTEP.DLL
    • SoundSensorLibraryTEP.HEX
  • Place these three files in the Library folder of your Proteus software.
Note:
  • Now restart your Proteus ISIS software and in the components section, make a search for sound sensor, as shown in the below figure:
  • As you can see in the above figure, we now have 3 sound sensors in the Proteus database.
  • So, now I am gonna place all of them in my Proteus workspace and here's how they look like:
  • They are all similar in operation, I just changed the base color as there are different versions available.
  • Now in order to make them work, we have to add the hex file.
  • Double click the sensor to open its Properties panel and in the Program File section browse to SoundSensorLibraryTEP.HEX file.
  • We have placed this hex file in the Library folder, here's the screenshot:
  • Now click OK and our sound detector sensor is ready for simulation.
  • So, let's design a simple circuit to test it out, as shown in the below figure:
  • When the TestPin will get HIGH, that means we have sound in the surroundings. In that case OUT Pin will also go HIGH.
  • In case of silence, OUT Pin will remain LOW.
  • Let's run our simulation and test it out as shown in the below figure:
  • So you can see in the above figure that LED is ON when the TestPin is HIGH and its OFF when the TestPin is LOW.
  • So that's how you can detect sound in Proteus.
  • I have also created this video which will give you a better understanding of How to download and use this Sound Sensor Proteus Library.
I hope you will like this Proteus Library. If you have any suggestions regarding this Proteus Library then ask in the comments and we will try our best to resolve them. Thanks for reading. :)

Introduction to Arduino Duemilanove

Hey Fellas! Hope you are doing well. I feel pleasure to have you on this platform. Today, I'll discuss the detailed Introduction to Arduino Duemilanove which is a Microcontroller Board, introduced by Arduino.cc and is based on ATmega168 or ATmega328. It comes with 14 pins that can be used both ways: Input or Output. Duemilanove means "2009" in Italian. Arduino boards have always been a good pick for hobbyists and students who intend to design projects that are mainly related to embedded system and automation. These boards are similar to microcontrollers, with little advantage over them as they come with some built-in peripheral features, setting you free from buying external components to employ automation in your project. If we focus on Arduino Duemilanove, it incorporates an ICSP header, a power jack, a reset button, and USB connection. A 16 MHz crystal is added on the device, aiming to produce clock pulses with regular intervals. In this post, I'll try to cover each and everything related this Arduino Board i.e. main features, pinout, pin description, software used and applications. Let's jump right in.

Introduction to Arduino Duemilanove

Arduino Duemilanove is a Microcontroller Board that is based on ATmega168 or ATmega328.
  • It comes with 14 I/O pins, out of which 6 are used as a PWM output Pins.
This board is useful where low speed and memory space is required. You can not compare it with Arduino Mega that proves to an ideal choice for high-speed applications. Still, if you aim to produce a project with simple functions, Arduino Duemilanove comes handy and stands fit for your technical requirements. It is a most recent version of the board housing USB connection and can operate at 5V with an Input voltage ranging between 6 to 20 V, however, it is advised to keep the voltage range from 7 to 12 V.
  • The Flash Memory is different depending on the microcontroller incorporated into the board: 16 KB for ATmega168 and 32 KB for ATmega 328. Out of this total flash memory, 2 KB is reserved for a bootloader. 
Similarly, SRAM featured on the device is 1 KB  while using ATmega168 and 2 KB for ATmega328. 
  • This board can be powered up both ways: connecting with a computer using USB cable or using DC adopter.
A reset button is added on the device that helps in resetting the module in case there comes a glitch in a running program and module requires instant reset that brings it back to the initial condition.
  • There is a built-in LED connected to digital pin 13, toggling between ON and OFF as you send HIGH and LOW respectively.

1. Arduino Duemilanove Features

Features of any device help you make a final decision before buying it for your project. Following table shows the main features of Arduino Duemilanove.
Microcontroller ATmega168 or ATmega328
CPU 32-Bit ARM Chip
Digital I/O Pins 14
PWM Output 6 (out of 14 I/O pins)
Analog Input 6
Flash Memory (Program Memory) 16 KB for ATmega168 and 32 KB for ATmega 328
SRAM 1 KB  for ATmega168 and 2 KB for ATmega328
EEPROM 512 bytes for ATmega168 and 1 KB for ATmega328
Input Voltage 7-12 V
Operating Voltage 5 V
Oscillator up to 16 MHz
Software Used Arduino IDE
Reset Button Yes
ICSP Header Yes
USB Port 1
UART (Serial Communication) Yes
SPI Protocol Yes
I2C Protocol Yes
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
  • Three communication protocols available on the board will help in connecting the module with external devices.
  • There is a slight difference in the memory used in the module based on the controller incorporated on the board. Before you intend to buy the module, make sure your technical requirements are quite in line with the memory space available on the board.

2. Arduino Duemilanove Pinout

Following figure shows the pinout of this Arduino Board.
  • There are total 28 physical pins on the board and six pins are available on the ICSP header. Four female headers are available covering all physical pins for the connection with the external devices.

3. Arduino Duemilanove Pin Configuration

In the previous section, you have got a brief overview of the Arduino module pinout. Now, we will highlight the major functions associated with each pin, so you can anticipate what each pin is capable to perform, helping you use the relevant pin for your project.
Digital I/O Pins
There are 14 digital I/O pins on the board that can be used as an input or output based on requirement. If you are working with sensors, these pins can be made as an input to accept the digital input from the sensor, similarly, if you are aiming to control the motor, these pins are used as an output for writing the required command to control the motors.
Analog Pins
There are 6 analog pins available on the board. These pins can accept any value, unlike digital signals that are designed to deal with only two values: HIGH and LOW. The following figure shows the location of analog pins on the board.
PWM Pins
There are six PWM pins (out of 14 digital I/O pins) incorporated on the board. PWM (pulse width modulation) is a process for getting analog results with digital means. These pins appear on the right side of the board as you place the board with power jack pointing upward.  Following figure shows the placement of these pins on the board.
ICSP Header
ICSP (In-Circuit Serial Programming) header is added that help to connect the board with computer and upload a sketch in case USB port is not available.  This feature is mainly used to program Arduino with another Arduino.
Power Source Pins
There are four main voltage sources i.e. Vin, 5V, 3.3V, AREF, available on the board. The Vin is the input voltage that ranges between +7 to +12 V and comes from the external power source. The board operates at 5V while 3.3V is the operating voltage of each pin. There are four ground pins on the board where one is reserved for AREF and another for ICSP header while remaining two are available for the board. The AREF is an Analogue reference voltage, used for analog pins. The following figure shows the power source pins.
Communication Protocols

Common communication protocols like SPI, UART and I2C are available on the board. It is important to note that SPI communication is available on both: digital I/O pins and ICSP header pins.

Serial Peripheral Interface (SPI) is commonly used to send data between microcontrollers and small peripherals such as sensors, shift registers, and SD cards. It comes with separate clock and data lines, layered with a select line to choose the device for communication.

Similarly, I2C is a two-wire interface that contains two main lines known as SDA and SCL where former is s serial data line that carries the data and later is serial clock line that is used to synchronize all data transfers over the I2C bus.

4. Programming and Communication

Almost all modules falling under the Arduino family are programmed using  Arduino IDE - Official software introduced by Arduino.cc for programming Arduino Modules. This software is compatible with common operating systems like Windows, Linux or MAC.
  • You need to take care before installing the software version for your system i.e. if you want to download Arduino IDE App version, you must have Windows 10 installed in your system as app version is not compatible with Windows 7 or 8.1.
The software is very easy to use and is readily available on the Arduino Website. It is an open source software i.e. you can use it freely and modify your Arduino Board as per your requirements. Some basic codes are already available on the software, you just need to connect the board with the computer and upload the required program and start playing with your board right away.
  • Arduino never fails to keep your budget at the bare minimum as no external burner is required to burn the code inside the module due to Module's built-in bootloader, however, if you aim to insert a new controller on the module, you have to install the bootloader again using IDE software.
Arduino IDE comes with a number of options to select the required Arduino Board, simply go to Tools Menu and click Board section and select the board you are working on.
  • Software comes with a compilation option that allows you to see the code compilation on the bottom of the screen as you upload the code, generating a code hex file which then is transferred to the board.
The physical pin 0 and 1 are used for UART communication and FTDI  chip on the board sets a pathway to bridge the serial communication between FTDI drivers and USB. As you send the data using FTDI chip and USB connection, the RX and TX will flash, indicating information is being transferred to the computer.

5. Arduino Duemilanove Projects and Applications

Arduino Duemilanove comes with a wide range of applications and features a number of peripheral features. Following are some major applications it can be used for:
  • Student Projects
  • Industrial Automation
  • Health and Security Systems
  • Embedded Systems
  • Motor and Sensor Control
That’s all for today. I hope I have given you everything you needed to know about Arduino Duemilanove. However, if you are unsure or have any question you can comment in the section below. I’d love to help you in any way I can. You are most welcome to keep us updated with your valuable feedback and suggestions, they help us provide you quality work as per your needs and requirements. Thanks for reading the article.

Introduction to Arduino Leonardo

Hi Guys! Hope you are getting along with life pretty well. I always strive to keep you updated with most valuable information related to engineering and technology. Today, I'll discuss the detailed Introduction to Arduino Leonardo. It is a microcontroller board based on the ATmega32U4 and comes with 23 digital input/output pins. It is developed by Arduino.cc, aiming to provide easy to use interface with the ability to perform a number of functions on a single chip. It incorporates everything required to drive the automation in the relevant project. Simply connect this device with the USB cable or power it up using DC adapter and start playing with it In this post, I'll try to cover each and everything related to Arduino Leonardo, so you don't need to wrestle your mind browsing the whole internet and find all the information in one place. Let's dive right in and get down to the nitty-gritty of this tiny module.

Introduction to Arduino Leonardo

  • Arduino Leonardo is a microcontroller board developed by Arduino.cc. It is based on the ATmega32U4 and comes with 23 digital input/output pins that are enough to connect with external devices and turn your innovation into reality.
  • The Microcontroller on the board incorporates a built-in USB communication, setting you free from the use of a secondary processor. The USB communication helps Leonardo disguise the mouse or keyboard when it is connected to a computer.
  • The module supports the crystal oscillator with the frequency up to 16 MHz that is enough to generate clock pulses with decent pace required for the synchronization of all the internal operations.
In-circuit programming header is added in the device that gives you the flexibility to tweak the already written code after its installation in the relevant project.
  • This board supports common communication protocol like UART, SPI, and I2C. The UART is a serial communication protocol mainly used for transferring and receiving serial data using two pins called TX and RX.
While I2C is a two-wire interface that involves two main lines known as SDA and SCL where former is s serial data line that carries the data and later is serial clock line that is used to synchronize all data transfers over the I2C bus.
  • Serial Peripheral Interface (SPI) is a third communication protocol added on the board that is commonly used to send data between microcontrollers and small peripherals such as sensors, shift registers, and SD cards using separate clock and data lines, layered with a select line to pick the device for communication.

1. Arduino Leonardo Features

If you aim to work on your desired project, you must know the common features this device holds in order to avoid any hassle in future, getting you a clear idea if the ratings of the device are quite in line and stand fit for your project. Following table shows the main features of the Arduino Leonardo.
Microcontroller ATmega32U4
CPU 8-Bit
Digital I/O Pins 23
PWM Output 7
Analog Input 12
Flash Memory (Program Memory) 32 KB (Out of which 4 KB is used by bootloader)
SRAM 2.5 KB
EEPROM 1 KB
Input Voltage 7-12 V
Operating Voltage 5 V
Oscillator up to 16 MHz
Software Used Arduino Software (IDE)
Reset Button Yes
ICSP Header Yes
USB Port 1
UART (Serial Communication) Yes

2. Arduino Leonardo Pinout

Following figure shows the pinout of Arduino Leonardo.
  • USB jack, Power Jack and Reset button are quite in line with each other and are surfaced on one side of the board. Nonetheless, all components and pins on the board are designed in a regular pattern, giving a compact and symmetrical interface.

3. Arduino Leonardo Pin Description

You have got a clear idea about some of the basic functions of this Arduino Module. In this section, we will break down pinout of the board with different images and describe them in terms of pin description of the board. Let's get started.
Analog Pins
There are 12 analog pins added on the board. As per the nature of these pins, they can utilize any number of values, unlike digital signals that are designed to deal with only two values: HIGH and LOW. The following figure shows the placement of these analog pins on the board.
PWM Output
There are seven PWM pins available on the board. If you place the board with power jack pointing upward, these pins appear on the right side of the board. PWM is a process for getting analog results with digital means. You can see these pins in the figure below.
Communication Protocols

Three communication protocols including SPI, UART and I2C are incorporated on the board. You can see them on the figure below. It is important to note that SPI communication is not available on the digital I/O pins like other boards instead, it houses in the ICSP header as shown in the figure below.

Power Source
Difference power sources are available for a variety of purpose. Mainly, the board operates at 5V while 3.3V is the operating voltage of each pin. The Vin is the input voltage that ranges between +7 to +12 V. This voltage comes from the external power source. There are two ground pins on the board. The AREF is an Analogue reference voltage, mainly used for analog pins. The IOREF is useful for powering and developing a compatibility between this board and Arduino Shields. As the shield is connected with this pin, it (shield) wears the I/O voltage provided by the Board. The Shield using IOREF pin will be compatible with both 3V3 and 5V. You can see the power source in the figure below.
ICSP Header
ICPS stands for In-Circuit Serial Programming – A feature used for programming Arduino with another Arduino. ICSP header is added that helps in connecting the board with a computer for uploading a sketch in case USB port is not available.

4. Programming

  • Arduino.cc has introduced its own official software, called Arduino IDE, for programming the Arduino module. This software supports common operating systems like Windows, Linux or MAC. Before you download this software, make sure the required software version is compatible with your system i.e. if you aim to download App version, you must have Windows 10 installed in your system as app version is not compatible with Windows 7 or 8.1.
You are ready to use the software as you install it. Some simple LED programs are already available on the software, giving you the flexibility to start working on the board in due course.
  • No external burner is required to burn the code inside the module as it comes with a built-in bootloader. Having said that, if you intend to insert a new controller on the module, you need to install the bootloader again using IDE software.
The Serial Monitor is added in Arduino Software, that helps you see the code working in real time as you verify and upload the code.
  • Arduino IDE comes with a compilation option that allows you to see the code compilation on the bottom of the screen as you upload the code. It generates hex file of the code which then is transferred into the board.

5. Difference between Arduino Leonardo and Arduino Uno

There is a slight difference between these two boards in terms of controller used, number of digital pins, PWM pins, and the pins reserved for SPI communication.
  • Arduino Uno incorporates ATmega328 while Arduino Leonardo comes with ATmega32U4.
Similarly, Uno has 20 digital I/O pins, out of them 6 are analog input pins and Leo has 23 digital I/O pins, out of which 12 are analog input pins.
  • There are 7 PWM output pins available on the Leonardo and 6 are added on the Uno board.
Uno comes with SPI protocol on the digital I/O pins while Leonardo contains SPI communication on the ICSP header pins.

6. Arduino Leonardo Projects and Applications

You can not write off the importance of Arduino Modules if you are working on a project that comes with a remote connection with automation. Arduino Leonardo comes with a wide range of applications and incorporates a number of peripherals, setting you free from the hassle of spending too much for buying external components. Following are some major applications Arduino can be used for:
  • Industrial Automation
  • Health and Security Systems
  • Creating wireless keyboard
  • Automatic Pill Dispenser
  • Embedded Systems
  • Student Projects
  • USB Trackpad
  • Water Level Meter
That’s all for today. I hope you have got a lot of information regarding Arduino Leonardo. However, if you are unsure or have any question you can approach me in the comment section below. I’d love to help you the best way I can. You are most welcome to keep us updated with your valuable feedback and suggestions, they help us provide you quality work that resonates with your needs and requirements. Thanks for reading the article.

Introduction to Arduino IDE

Hey Guys! Hope you are doing well. Today, I'll discuss the detailed Introduction to Arduino IDE, where IDE stands for Integrated Development Environment - An official software introduced by Arduino.cc, that is mainly used for writing, compiling and uploading the code in almost all Arduino modules/boards. Arduino IDE is open-source software and is easily available to download & install from Arduino's Official Site.

In this post, I'll take you through the brief Introduction of the Software, how you can install it, and make it ready for your required Arduino module. Let's dive in and get down to the nitty-gritty of this Software.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Arduino UnoAmazonBuy Now

Introduction to Arduino IDE

  • Arduino IDE is an open-source software, designed by Arduino.cc and mainly used for writing, compiling & uploading code to almost all Arduino Modules.
  • It is an official Arduino software, making code compilation too easy that even a common person with no prior technical knowledge can get their feet wet with the learning process.
  • It is available for all operating systems i.e. MAC, Windows, Linux and runs on the Java Platform that comes with inbuilt functions and commands that play a vital role in debugging, editing and compiling the code.
  • A range of Arduino modules available including Arduino Uno, Arduino Mega, Arduino Leonardo, Arduino Micro and many more.
  • Each of them contains a microcontroller on the board that is actually programmed and accepts the information in the form of code.
  • The main code, also known as a sketch, created on the IDE platform will ultimately generate a Hex File which is then transferred and uploaded in the controller on the board.
  • The IDE environment mainly contains two basic parts: Editor and Compiler where former is used for writing the required code and later is used for compiling and uploading the code into the given Arduino Module.
  • This environment supports both C and C++ languages.

How to Download Arduino IDE

You can download the Software from Arduino main website. As I said earlier, the software is available for common operating systems like Linux, Windows, and MAX, so make sure you are downloading the correct software version that is easily compatible with your operating system.

  • If you aim to download the Windows app version, make sure you have Windows 8.1 or Windows 10, as the app version is not compatible with Windows 7 or older version of this operating system.
  • You can download the latest version of Arduino IDE for Windows (Non-Admin standalone version), by clicking below button:
Download Arduino IDE

The IDE environment is mainly distributed into three sections

  1. Menu Bar
  2. Text Editor
  3. Output Pane

As you download and open the IDE software, it will appear like an image below:

The bar appearing on the top is called Menu Bar that comes with five different options as follow

  • File - You can open a new window for writing the code or open an existing one. The following table shows the number of further subdivisions the file option is categorized into.
  • As you go to the preference section and check the compilation section, the Output Pane will show the code compilation as you click the upload button.
  • And at the end of the compilation, it will show you the hex file it has generated for the recent sketch that will send to the Arduino Board for the specific task you aim to achieve.
  • Edit - Used for copying and pasting the code with further modification for font
  • Sketch - For compiling and programming
  • Tools - Mainly used for testing projects. The Programmer section in this panel is used for burning a bootloader to the new microcontroller.
  • Help - In case you are feeling skeptical about software, complete help is available from getting started to troubleshooting.

The Six Buttons appearing under the Menu tab are connected with the running program as follows.

  • The checkmark appearing in the circular button is used to verify the code. Click this once you have written your code.
  • The arrow key will upload and transfer the required code to the Arduino board.
  • The dotted paper is used for creating a new file.
  • The upward arrow is reserved for opening an existing Arduino project.
  • The downward arrow is used to save the current running code.
  • The button appearing on the top right corner is a Serial Monitor - A separate pop-up window that acts as an independent terminal and plays a vital role in sending and receiving the Serial Data. You can also go to the Tools panel and select Serial Monitor, or pressing Ctrl+Shift+M all at once will open it instantly. The Serial Monitor will actually help to debug the written Sketches where you can get a hold of how your program is operating. Your Arduino Module should be connected to your computer by USB cable in order to activate the Serial Monitor.
  • You need to select the baud rate of the Arduino Board you are using right now. For my Arduino Uno Baud Rate is 9600, as you write the following code and click the Serial Monitor, the output will show as the image below.
  • The main screen below the Menu bard is known as a simple text editor used for writing the required code.
  • The bottom of the main screen is described as an Output Pane that mainly highlights the compilation status of the running code: the memory used by the code, and errors that occurred in the program. You need to fix those errors before you intend to upload the hex file into your Arduino Module.
  • More or less, Arduino C language works similar to the regular C language used for any embedded system microcontroller, however, there are some dedicated libraries used for calling and executing specific functions on the board.

Arduino Libraries

  • Libraries are very useful for adding extra functionality into the Arduino Module.
  • There is a list of libraries you can check by clicking the Sketch button in the menu bar and going to Include Library.
  • As you click the Include Library and Add the respective library it will be on the top of the sketch with a #include sign. Suppose, I Include the EEPROM library, it will appear on the text editor as

#include <EEPROM.h>

  • Most of the libraries are preinstalled and come with the Arduino software. However, you can also download them from external sources.

Making Pins Input or Output

The digitalRead and digitalWrite commands are used for addressing and making the Arduino pins as an input and output respectively.

These commands are text sensitive i.e. you need to write them down the exact way they are given like digitalWrite starting with small "d" and write with capital "W". Writing it down with Digitalwrite or digitalwrite won't be calling or addressing any function.

How to Select the Board

  • In order to upload the sketch, you need to select the relevant board you are using and the ports for that operating system.
  • As you click the Tools on the menu, it will open like the figure below:
  • Just go to the "Board" section and select the board you aim to work on. Similarly, COM1, COM2, COM4, COM5, COM7 or higher are reserved for the serial and USB board. You can look for the USB serial device in the ports section of the Windows Device Manager.
  • The following figure shows the COM4 that I have used for my project, indicating the Arduino Uno with the COM4 port at the right bottom corner of the screen.
  • After correct selection of both Board and Serial Port, click the verify and then upload button appearing in the upper left corner of the six-button section or you can go to the Sketch section and press verify/compile and then upload.
  • The sketch is written in the text editor and is then saved with the file extension .ino.

It is important to note that the recent Arduino Modules will reset automatically as you compile and press the upload button the IDE software, however, the older versions may require the physical reset on the board.

  • Once you upload the code, TX and RX LEDs will blink on the board, indicating the desired program is running successfully.
Note: The port selection criteria mentioned above are dedicated to Windows operating system only, you can check this Guide if you are using MAC or Linux.
  • The amazing thing about this software is that no prior arrangement or bulk of the mess is required to install this software, you will be writing your first program within 2 minutes after the installation of the IDE environment.

Arduino Bootloader

  • As you go to the Tools section, you will find a bootloader at the end.
  • It is very helpful to burn the code directly into the controller, setting you free from buying the external burner to burn the required code.

When you buy the new Arduino Module, the bootloader is already installed inside the controller. However, if you intend to buy a controller and put it in the Arduino module, you need to burn the bootloader again inside the controller by going to the Tools section and selecting the burn bootloader.

That's all for today. I hope I have given you everything you needed to know about Arduino IDE. If you are unsure or have any questions, you can ask me in the comment section below. I'd love to help you the best way I can. You are most welcome to keep us updated with your valuable feedback and suggestions, they help us provide you quality work so you keep coming back for what we have to offer. Thanks for reading the article.

Introduction to Arduino Micro

Hey Guys! Hope you are getting along with life pretty well. Welcome you onboard. Today, I'll unlock the details on the Introduction to Arduino Micro. It is a Micro board, based on the ATmega32U4 microcontroller and comes with built-in USB, making it easily compatible with the computer. Arduino Micro, as the name suggests, is the smallest board in the Arduino Community. It is comparable to its counterparts like Arduino Nano and Arduino Promini. In this tutorial, I'll discuss each and everything related to Micro board including its main features, pinout, pin description, the software used and applications. Let's dive in and explore everything you need to know about this tiny board.

Introduction to Arduino Micro

  • Arduino Micro is the smallest board in the Arduino Community and is mainly based on the ATmega32U4 microcontroller.
  • It contains a built-in USB on the tiny easy to integrate interface, that helps in laying out a prompt connection with the computer.
  • Don't get into the illusion of performing complex functions that require more memory space, as this little toy comes with flash memory around 32 KB while EEPROM and SRAM are 2.5 KB and 1 KB respectively, still enough to wet your technical appetite.
  • The maximum length and width of the Micro PCB are 4.8cm and 1.77cm respectively, however, with the attached USB port the dimensions will slightly be larger than the given parameters, exceeding from the edge of the PCB layout.
  • Breadboard compatibility makes this device easy to use for getting a hands-on experience before incorporating it in the relevant project with all prerequisites.
  • You can download Arduino Micro Datasheet by clicking below button:
Download Arduino Micro Datasheet
  • The ATmega32U4 microcontroller available on the board features UART communication with TX and RX pins.
  • The Micro board incorporates resettable poly-fuse that that is mainly used for securing computer's USB ports from shorts and overcurrent by providing an extra layer of protection.
  • If the current escalates from the required value to the USB port, the fuse will jump in and work as an emergency switch, breaking the connection between the board and computer. It is advised to keep the provided current to the USB port under 500mA.

1. Arduino Micro Features

If you are aiming to pick this Arduino module for your relevant project, it is advised to get a hold of its features in order to avoid any hassle in future. The following figure shows the main features of Arduino Micro.
Microcontroller ATmega32U4
CPU 8-Bit
Digital I/O Pins 24
PWM Output 7
Analog Input 12
Flash Memory (Program Memory) 32 KB
SRAM 2.5 KB
EEPROM 1 KB
Input Voltage 7-12 V
Operating Voltage 5 V
Oscillator up to 16 MHz
Software Used Arduino Software (IDE)
Reset Button Yes
ICSP Header Yes
USB Port 1
UART (Serial Communication) Yes
  • Serial communication along with SPI and I2C communications are available on the board. The physical reset button is added that helps to stop the running function and puts the controller in the initial condition from where it takes and implements the stored information from scratch.

2. Arduino Micro Pinout

Following figure shows the Arduino Micro Pinout diagram.
  • You may have heard, at times, tiny things work wonders. Same is true with this module. It is nothing but a technical peripheral device with a number of features laid out and housed in one package.
  • Still, as I have mentioned earlier, it operates perfectly if you plan to design the simple project that requires less memory space. Arduino Due and Arduino Leonardo are preferred to meet your technical needs if your project requirements are complex and require more memory space in order to design and drive automation in the relevant project.
  • The built-in USB communication on the board removes the need for a secondary processor and helps it to appear to a connected computer as a keyboard and mouse, in addition to a virtual (CDC) serial / COM port.

3. Arduino Micro Pin Description

Until now, you have got a brief overview of this device and how this module can be a good fit for your project. In this section, I'll discuss the pin description with images, you can easily grab the idea what are the major functions associated with each pin. Let's get to the point.
Analog Input
There are 12 analog inputs on the board. You can see them in the figure below.
Communication Protocols
Communication protocols like serial, SPI and I2C are incorporated on the board. You can see them highlighted on the figure below.
PWM Output
Seven pins are used for PWM output purpose. It is a process for getting analog results with digital means. You can see PWM in the figure below.
Power Source
The 5V is a voltage at which board operates while 3.3V is the operating voltage of each pin. The Vin is the input voltage that ranges between +7 to +12 V and is a  voltage from the external power source, not from a USB port. There are two ground pins on the board. The AREF predicts the Analogue reference voltage that helps to inject the Arduino a reference voltage from an external power supply. You can see the power source in the figure below.
External Interrupt
PCINT are the external interrupts generated on any digital I/O pin. The following figure shows the pins on which external interpret can be generated.
ICSP Header Pins
ICPS head is added on the board and it stands for In-Circuit Serial Programming - A feature used for programming Arduino with another Arduino. And if USB port is not available, it comes out handy for connecting the board with a computer for uploading a sketch.

4. Programming

  • Arduino Software, called IDE, is mainly used for programming the Arduino module and it works perfectly with common operating systems like Windows, Linux or MAC. You can download it from the Arduino site and it is compatible with all versions in the Arduino family.
  • You are ready to use the software as you install it. Some simple LED programs are already available on the software so you can easily start working on the board and compile the default program with the intention you are getting the results on the fly.
  • Built-in bootloader that comes with the board lets you off the hook from wresting your mind for compiling and burning the code using the external burner.
  • Micro board features a serial peripheral interface (SPI) that is mainly used in the communication between the microcontroller and other peripheral devices such as shift registers and sensors. Two pins are used for SPI communication i.e. MOSI (Master Output Slave Input) and MISO (Master Input Slave Output) - they are used for sending and receiving the data by the microcontroller.
  • The Serial Monitor is added in Arduino Software, that plays a vital role in transmitting textual data to or from the board.
  • The TX and RX pins are used for serial communication where TX pin transmits the serial data while RX receives the serial data.
  • The board is capable to perform I2C communication using two pins called SDA and SCL.

5. Difference between Arduino ProMini and Arduino Micro

  • There is a little difference between Arduino ProMini and Micro board, however, peripherals on these boards are same.  The built-in USB in the Micro board proves to be a candid difference between two modules while Promini requires FTDI cable in order to generate USB power and communication to the board.
  • The USB on Micro board can act as a number of ways: Keyboard or mouse, USB hard drive, USB to serial Converter and MIDI controller.
  • The Arduino Pro Mini incorporates ATmega328 microcontroller while Arduino Micro comes with ATmega32U4. Flash memory is the same on both modules however, SRAM differs slightly with 2KB on the ProMini and 2.5 KB on the Micro board.
  • Last not least, the Arduino Pro Mini features 2 hardware interrupts while the Micro board comes with 5 hardware interrupts.

6. Arduino Micro Projects and Applications

Arduino micro comes with a wide range of applications with the ability to groove in hard to reach places. It offers a high number of connections with a minimum interface. The outstanding ability of this board to disguise keyboard or mouse while connected with a computer makes it an ideal choice for many computer applications. You can use this board for the development of the following projects.
  • USB Joystick
  • Electric Bike
  • Windows PC lock/unlock application
  • Creating wireless keyboard
  • Automatic Pill Dispenser
  • USB Trackpad
  • Water Level Meter
There is a list of projects you can create but I have mentioned a few of them to give you an idea what this tiny thing can help in designing a product ranging from embedded, automation to computer applications. That's all for today. I hope I have given you everything you needed to know about Arduino Micro. However, if you are unsure and consider something is left unsaid, making it difficult for you to grab the basic idea, you can approach me in the comment section below. I'd love to help you the best way I can. Keep your feedback and suggestions coming and help us create a quality content as per your needs and requirements. Thanks for reading the article.

Introduction to Arduino LilyPad

Hi Friends! Hope you are doing well. Today, I'll give you a detailed Introduction to Arduino LilyPad. It is an Arduino Microcontroller Board, based on ATmega168/ATmega328 and is introduced by Leah Buechley and SparkFun Electronics.

This board is mainly developed for e-textiles and wearables projects. As per the designed purpose, it can be attached to fabric, sensors, power supplies, and actuators. You may need a conductive thread for joining this board with the required object.

In this post, I'll try to cover each and everything related to Arduino LilyPad, what is this about and how it is used for the development of desired projects. Let's jump right in and get down to the nitty-gritty of this board.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Arduino LilypadAmazonBuy Now

Introduction to Arduino LilyPad

  • Arduino LilyPad is an Arduino Main Board that is mainly designed for e-textiles and wearables projects and is based on the Atmega168/Atmega328 microcontroller.
  • LilyPad is nothing but an Arduino-programmed microcontroller and works similar to other Arduino boards available.
  • It comes in a round shape unlike other Arduino boards so that it could fit easily in wearables.
  • However, the ability of this board to be sewn down with the fabric or sensor through conductive thread puts it ahead and stands out of the boards available in the Arduino community.
  • There are 22 wide open pin-holes, appear around the edge of the whole rounded shape that is mainly used for the connection with the fabric and sensor through a conductive thread.
  • Out of these 22 pinholes, one is reserved for +5V, and one for ground.
  • The LilyPad Arduino incorporates 6 analog inputs that can also be used as digital I/O. They are marked as A0 through A5 on the board, providing 10 bits of resolution. It is important to note that, the analog inputs measure from ground to 5 volts, however, the upper end of their range can be modified using the analogReference() function.
  • The board contains 14 digital pins that can be employed as an input or output, using pinMode(), digitalWrite(), and digitalRead() functions.
  • Like other boards in the Arduino, this Pad is programmed by Arduino IDE - an official software mainly used for programming the Arduino Boards, that is developed by Arduino.cc
  • The board comes with a wide voltage range and operates anywhere between 2.7 V to 5.5 V. The pins on the board come with the ability to control and handle the input or output of the attached device.
  • There are two ways to keep your Pad null and void: increase the operating voltage above 5.5 V or plug the power in reverse order.
  • As I mentioned earlier bootloader is used for storing the code and burning it on the board, however, you can also bypass the bootloader and program the ATmega328 using ICSP (In-Circuit Serial Programming) header.

Arduino LilyPad Features

Following are the main features of the Arduino LilyPad.
Microcontroller ATmega168 or ATmega328V
Digital I/O Pins 14
Analog Input Channels 6
PWM Channels 6
Crystal Oscillator 8 MHz
Flash Memory 16 KB (of which 2 KB used by bootloader)
Bootloader Memory Out of 16KB in the Flash Memory, 2KB is reserved for Bootloader
SRAM1 KB 1 KB
EEPROM 512 bytes
Operating Voltage 2 to 5 V
DC Current per I/O Pin 40 mA
Internal pull-up resistor 20 kO

Arduino LilyPad Pinout

  • Arduino Lilypad Pinout is shown in the below figure:
  • There is a candid difference between external interrupt pins and PCINT pins. Former is the dedicated hardware pin used for generating the interrupt while later is the interrupt that can be created on any digital I/O pin.
  • There are 6 PWM tabs on the board, shown by the dashed lines on the pinout image above. These PWM pins can also be used as digital I/O pins.

How to program Arduino LilyPad?

You can layout the LilyPad connection by following the given steps.
  • Be careful while connecting the power and ground pins of the board. The +5V power must be connected to the positive tab on the board and the ground tab of the board should be connected to the ground of the power source. The reverse connection can cause severe damage to the board and in a worst-case scenario, your board may stop working all at once.
  • There are two ways to generate a regulated +5V power source: Using a +5V pin of the Mini USB Adapter or employing another 2.7-5.5V power source using a Lithium rechargeable battery.
The following figure shows the LilyPad connection with Mini USB Adapter:
  • You can see the two circular tabs on the board marked as TX and RX that are mainly used in two ways: For uploading new sketches to the board and establishing a serial communication with other devices.
  • Apart from using your own power supply, you can also use Mini USB Adapter or Arduino NG board for connecting the Pad with the computer.

The following figure shows the connection of the Arduino UNO with LilyPad:

Note: Don't forget to remove the ATmega8 or ATmega168 from the NG before connecting it with the LilyPad. You can use alligator clips and jumper wires for connecting the +, -, TX and RX tabs on the LilyPad with the corresponding pins on the NG board.

Applications

  • LilyPad is really very handy for e-textile and wearable products, because of its small size.
  • Arduino Lilypad is used in IoT products and embedded projects as well.
  • The circular tabs covering the whole Pad at the edge are mainly used for the connection between Pad and wearable products.

That's all for today. I hope this read has succeeded in grappling your attention and resonated with your field of interest. If you are feeling dubious in any area of the information related to the Pad that I have left unfolded, you can approach me in the comment section below. I'd love to help you according to the best of my expertise. Keep visiting us for valuable information related to engineering and technology. Thanks for reading the article.

How to use digitalWrite Arduino Command

Hey Friends! Hope you are doing well. Today, I'll discuss the details on How to use digitalWrite Arduino Command. The digitalWrite command in Arduino is used for writing the status of the digital Pin. The Pin assigned to this command must be an OUTPUT pin so that it can transfer data to other components like LEDs, motors, and actuators and use them as per your needs and requirements. Arduino boards have always been a great choice for both experts and newbies, as they come with built-in peripheral functions, and no need of external components is required to drive automation and develop some basic functions on the relevant project. Basic Arduino Software is used as a compiler and no separate burner is required to burn the required code into the board. You can simply plug the board with the computer through a USB cable and burn and compile the program by a single click on the software.

How to use digitalWrite Arduino Command

  • digitalWrite Arduino Command is used to write the status of digital Pins, and can make them either HIGH or LOW. The Pin needs to be an OUTPUT Pin.
  • We are working on Arduino UNO, that comes with 14 digital I/O pins and 6 analog pins. You can set these pins as an input or output using pinMode based on your technical requirements.
  • These pins are labeled as 0 to 13 on the board including two serial pins called Tx and Rx appearing at the start and marked as 1 and 0 pins respectively.
  • We set Pins as an INPUT when we want to read or receive data from some component like sensors. And making pins as an OUTPUT will require a digitalWrite function to write or send data to the required device like LEDs, motors etc.
  • When any pin is set an as OUTPUT using the pinMode Arduino Command, it will appear as HIGH or LOW depending on the voltage applying on the pin. For voltage above 3.3V it will appear as HIGH and for GND (ground) it will appear as LOW on the software.
  • Before connecting an LED to pin, make sure to set pinMode as OUTPUT when you call the digitalWrite function, otherwise LED won't be flashing with clear bright light.
Syntax for digitalWrite Arduino
  • Here’s the syntax used for digitalWrite Arduino command:

digitalWrite(pin, value);

where:
  • The "pin" defines the Arduino pin number used. It has to be an OUTPUT Pin.
  • And "value" defines if the pin will be HIGH or LOW.
  • For example:

digitalWrite(8, HIGH);

Note: 
  • It is worth mentioning here that digitalWrite command doesn’t store or return any value unlike most of the commands used in Arduino that help in storing some value.
Difference between analogWrite and digitalWrite
Both terms analogWrite and digitalWrite are used for same purpose i.e. sending data from Arduino, but:
  • The former is used to send data in analog form i.e. 0V - 5V.
  • The later only defines the HIGH and LOW value of the desired pin where HIGH is an indication, pin is getting 5V and LOW is an indication pin is set to ground or zero voltage.
That's all for today. I hope you have found this article informative. If you are unsure or have any question, you can ask me in the comment section below. I'd love to help you according to the best of my expertise. You are most welcome to keep us updated with your valuable feedback and suggestion - they help us provide you quality work so you keep coming back every now and then. Thanks for reading the article.

How to use pinMode Arduino Command

Hi Friends! Hope you are doing well. In this post, I'll uncover the details on How to use pinMode Arduino Command. The pinMode defines the Arduino Pins, if they are used as an input or output. The INPUT_PULLUP is another option achieved by pinMode, that is mainly used to place a virtual pull-up resistor to the input pins. We have started Arduino Tutorials for Beginners quite a while now for the newbies, who are really interested to get a hands-on experience with Arduino. Generally, Arduino is known as a Microcontroller, but it is a step ahead of it. The PIC microcontrollers require some basic circuit to start with but Arduino brings revolution in the automation industry by removing the need of developing any basic circuit. Although Atmega328 is the Microcontroller used in Arduino UNO. Also, the burner is required to burn the program in PIC Microcontrollers, while there is no need to connect separate burner with the Arduino - simply plug it with the computer through a USB cable and start playing with it. In this tutorial, we will thoroughly discuss what is pinMode and how to use it in the Arduino module. Let's jump right in and explore what is this about and everything you need to know.

How to use pinMode in Arduino

  • The Arduino Board comes with GPIO (general purpose input output) pins that can be used in two ways i.e. input, output.
  • pinMode Arduino Command is used to define the operation of these Input/output pins, there are three types of modes that can be assigned using this command and are named as:
    • OUTPUT.
    • INPUT.
    • INPUT_PULLUP.
  • There are 14 digital and 6 analog pins in the module that mainly depend on the pinMode for setting up their mode of operation as an input or output.
  • In this post we mainly discuss the Arduino UNO, that is based on ATmega328 microcontroller, however, you can use other modules like Pro Mini, Mega or Leonardo as per your needs and requirements. The pinMode works same in the module no matter what type of Arduino version you are using.
Syntax for pinMode Arduino
Here's the syntax for our pinMode Arduino command:

pinMode(pin#, mode);

where:
  • Pin defines the Arduino pin number used.
  • There are three types of modes that can be assigned to pins of Arduino, which are:
    • OUTPUT
    • INPUT
    • INPUT_PULLUP
Let's use Pin # 8 of Arduino and assign all possible modes to it:

pinMode(8, OUTPUT);

pinMode(8, INPUT);

pinMode(8, INPUT_PULLUP);

Note: 
  • It is important to note that, unlike most of the functions used in the C code for Arduino module, this pinMode doesn't store or return any value.
  • You have to use any one of these three modes at a time.
Modes of pinMode Arduino
  • In the previous section, we have discussed the basic syntax of pinMode, and I hope you have pretty much got the basic idea behind it.
  • The only thing worth mentioning here is the difference between INPUT and INPUT_PULLUP.
  • So, here's a simple code where I have made Pin # 8 as an INPUT and read its status on Serial Monitor.
int Pin = 8;

int Status = 0;

void setup()
{
  Serial.begin(9600);
  pinMode(Pin, INPUT);          
}

void loop()
{
  Status = digitalRead(Pin);       
  
  if(Status == HIGH)
  {
    Serial.println("HIGH");
  }

  if(Status == LOW)
  {
    Serial.println("LOW");
  }
 
}
  • Let's have a look at the Serial Monitor:
  • While taking the above image, Pin # 8 was in open state and we are getting just random values.
  • We are getting these random values i.e. HIGH, LOW because our Pin#8 is neither connected to +5V nor GND.
  • Arduino seems confused here, and we can remove this confusion by simply changing INPUT to INPUT_PULLUP.
  • As we run the Serial Monitor, we will get something shown below:
  • You can see how we are getting HIGH value only, while the pin is still in open state.
  • We can conclude, when we have nothing on our INPUT pin then INPUT_PULLUP will make the pin HIGH.
Difference between Read and Write
There are two ways to send or receive data. You can either define the pin as an input that helps in reading the data from an external device like sensors. Or you can define pin as an output that helps in writing and sending a command to LEDs, motors or actuators for executing the desired functions. That's all for today. I hope you have found this post informative as per your needs and requirements and can easily use this pinMode Arduino Command. If you are feeling skeptical or have any question, you can ask me in the comment section below. I'll try and help you according to the best of my expertise. Thanks for reading the article.

Introduction to Arduino Due

Hey Fellas! I am back to give you a daily dose of useful information. Today, I'll uncover the details on the Introduction to Arduino Due. It is a microcontroller board based on Atmel SAM3X8E, 32-Bit ARM microcontroller. It is developed by Arcuino.cc with the intention to provide an easy pathway for the beginners to get a hands-on experience with the module without any prior technical knowledge. You can just plug the device into the computer through a USB cable and start playing with it right away. Arduino Modules are a step ahead of a single microcontroller. If your project is mainly based on a microcontroller, you need to buy external peripherals and connect them with the controller in order to lay out an automation into your project. Arduino Boards has made things easy more than ever before. Although, more or less, they are known are microcontrollers, they have a leg over them because of built-in peripherals and an ability to perform a number of functions on a single chip. Also, no external burner is required for Arduino, as it comes with a built-in burner. You just have to write and compile the required code into the Arduino Software and burn in the module through a single click on the computer. In this post, I'll cover each and everything related to Arduino Due i.e. its main features, pinout, pin description, compilers used and applications. Let's get down to the nitty-gritty of this tiny module and explore everything you need to know.

Introduction to Arduino Due

  • Arduino Due is a microcontroller board that is mainly based on Atmel SAM3X8E (32-Bit ARM microcontroller). It is a big module as compared to Arduino Nano or Arduino Uno and comes with more number of pins and memory space as compared to them.
  • It contains 54 digital that can work both ways: input or output. Out of these digital pins, 12 can be used to generate PWM outputs.
  • This module contains everything in bulk required for the automation project including 12 analog inputs, and 4 UARTs serial module.
  • I was floored when I came to know this module comes with clock frequency around 84 MHz. Yes, you heard that right. The splendid oscillator will help in processing speed grow skyrocket.
  • Two USB ports are available where one is used as a programming USB Port while other is Native USB Port. Don't you worry, I'll make it clear the difference between them. Just follow along.
  • Most of the Arduino Boards run at 5 V but this module is an exception that operates at 3.3V. The pins incorporated on the cannot withstand voltage higher than this. Doing so can drastically affect the board performance and can make your pins null and void.
  • JTAG is added on the board that is mainly used for testing the physical connection between the onboard pins.
  • The Arduino Due can be programmed using a common Arduino Software (IDE), that is compatible with all Arduino boards and can work both ways: online and offline.
  • This module incorporates 2 DAC (digital to analog), 2 TWI, a power jack (you can power up the device by connecting it with a computer through USB cable or using this power jack), an SPI header reset button, an erase button and reset button. Bunch of functions, making your task easy.
  • As per the voltage constraint, Arduino shields that operate at 5V are not compatible with this Due module. However, the shields that come with Arduino R3 layout work efficiently including Arduino WiFi shield and Ethernet Shield as they operate at 3.3V.

1. Arduino Due Features

You have got a brief overview of the device. I have compiled the main features of this device at one place. Following table shows the main features of Arduino Due.  
Microcontroller Atmel SAM3X8E ARM Cortex-M3
CPU 32-Bit
Digital I/O Pins 54
PWM Output 12
Analog Input 12
Flash Memory (Program Memory) 512 KB
SRAM 96 KB (two banks: 64 KB and 32 KB)
Operating Voltage 3.3V
Input Voltage 7-12 V
Manufacturer Arduino.cc
Oscillator up to 84 MHz
Software Used Arduino Software (IDE)
Reset Button 1
Erase Button 1
DAC (Digital to Analog Converter) 2
UART (Serial Communication) 4
SPI Communication Yes
TWI (I2C Communication) 2
Arduino Shield Compatibility Yes (that operate at 3.3V)
USB (2) Programming USB (1) Native USB (1)
Power Jack 1
JTAG Header 1
DC current for 3.3V 800mA
Total DC output current on all I/O lines 130mA

2. Arduino Due Pinout

Now, you have got a hold of the main features of this module. In this section, I'll highlight the pinout of the chip. Following figure shows the pinout of Arduino Due.  
  • I know it is quite overwhelming and difficult to digest at one glance, but don't you worry I have broken it down in the pin description with images.

3. Arduino Due Pin Description

The function associated with each pin will help you understand the purpose of each pin in the relevant project they can be used for. Following table shows the description of each pin.
Digital I/O Pins 54 There are 54 digital I/O pins, out of which 12 can be used as PWM outputs.
Analog Pins A0 to A11 These pins are used for an analog pins on the board. They are 12 in numbers.
Digital to Analog Converter DAC0, DAC1 Two digital to analog converter with 12bit resolution.
Erase Button 1 Erases the information by holding down this button
Reset Button 1 Resets the board
External Interrupts Digital I/O Pins All 54 pins can be used for generating an external interrupt
UART 4 Board comes with 4 pairs of TX and RX serial pins for laying out serial communication. These pins include (A9,A8), (D4,D5), (A13,A12), (A11,A10)
SPI Serial Peripheral Communication (MOSI, MISO, SCK, RESET) Pin used (A26, A25, A27, Reset)
TWI Two Wire Interface (2 module) There are two I2C communication incorporated on the board with pins at A18, A17, B13, B12
CAN Interface 2 CAN (Controller Area Network) Interface is used for communication between controllers. Pins include
Power Source +5V, +3.3V, GND and Vin +5V- Connected to 5V +3.3V (Operating Voltage) Vin- Input Voltage - Connected to +7V to +12V (recommended) GND - Connected to Ground
  You have got clear about the functions associated with each pin. Now, I'll highlight the functions of each pin with images, making it easy for you to look at the information without much hassle.
Digital I/O Pins
Arduino Due comes with four ports named PORTA, PORTB, PORTC, and PORTD. There are 54 digitals I/O pins. The pins with PINK color on the pinout mention above are used as digital I/O pins.
Analog Pins
There are 12 analog pins on the board. They are a part of PORTA and PORTB and appear on the board as follow.  
USB Ports and Power Jack
There are two USB ports available on the board where one is programming USB port and other is native USB port. Both ports can be used for programming purpose, however, the native port also acts as a USB host for connected peripherals like keyboards and smartphones. There is one power jack on the board for powering up the device.
UART
There are four UART channels added on the board. They are used for the serial communication with the external devices where TX is the Serial Transmit Pin while RX is the Serial Receive Pin. They appear on the board as follow.
TWI
There are two TWI (Two Wire Interface) modules incorporated on the board, also known as the I2C protocol, and are used to establish the communication between low-speed devices like ADC and DAC converters and microcontrollers. It is a two wire communication and comes with two lines: Serial Clock (SCL) and Serial Data (SDA). The former is a clock signal that is used to synchronize the data transfer between the devices while the later is used to hold the desired data.
PWM Output
Out of 54 digital pins, 12 are used for PWM output. They appear on the board as follow.
JTAG Header
JTAG header is a remarkable addition in the board that most of the board lack in the Arduino Community. It is a common hardware interface that sets a pathway to communicate directly with external chips on a board. It was introduced by the Joint (European) Test Access Group with the intention of testing the physical connections between pins on a chip. It comes with fours pins known as TCK, TMS, TDI, and TDO. This header incorporates on the board as follows.
Reset and Erase button
There is one reset and one erase button is added on the device. Former is used to reset the controller while later is used to erase the stored information on the board. They appear on the board as follow.
Power Source
There are four power sources mentioned as 5V, 3.3V, Vin and Ground. The 3.3V is the operating voltage of each pin while Vin is the input voltage with the recommended voltage range of 7V to 12V. You can power the controller with Vin or 5V. These voltage sources appear on the board as follow.
4. Programming and Communication
  • Almost all Arduino Boards can be programmed by Arduino Software called IDE. It is easy to use and a common person with no prior technical can learn the software without much difficulty. It is readily available, just download the software and select the board you aim to work on. As I mentioned earlier, no external burner is required to burn the code into the controller. Arduino software works perfectly with common operating systems like Windows, Linux or MAC.
  • This module comes with a bunch of communication protocols to communicate with external devices. The UART is useful for setting up a serial communication. One serial module is okay, right? Wrong. There are four of them, giving you the flexibility to establish serial communication with more than one devices. Serial library in the software is mainly used for the serial communication between board and external devices.
  • The Serial Monitor is a remarkable addition in Arduino Software, mainly used for transmitting textual data to or from the board.
  • The TX and RX pins incorporate an LED on each pin that flashes as the data is transmitted.
  • Two Wire Interface is also included in the device that comes with two lines SDA and SCL. There are two TWI channels available on the board. Arduino Software Wire Libary is used to access the TWI bus.
  • Arduino Due comes with a serial peripheral interface (SPI) that plays a vital role in the communication between the microcontroller and other peripheral devices such as shift registers and sensors. There are two pins used for SPI communication i.e. MOSI (Master Output Slave Input) and MISO (Master Input Slave Output). The former is used for receiving the data while later helps in sending data by the microcontroller.

5. Difference between Arduino Due and Arduino Mega

There is a vital difference between both modules in terms of operating voltage, memory space, number of pins and processing speed. Arduino Due can perform the functions with greater pace as compared to Arduino Mega. More powerful built-in peripherals and more memory space put Arduino Due ahead of Mega. However, there are some limitations. Arduino Due is not compatible with the 3.3V devices, also, SAM3Xchip provides a complex and intimidating interface that can scare the hell of the person who is practicing this module very first time. It is advised to work with a smaller module like Arduino Uno in the start, and as you get a solid grip on the module, you can move to the complex interface.

6. Arduino Due Applications

Arduino Due is a little bit bulky, covers large space and is used in a wide range of applications where fast processing speed is the end result. Following are the main applications of the board.
  • Industrial Automation
  • Home and Security Systems
  • Virtual Reality Applications
  • Android Applications
  • GSM Based Projects
  • Embedded System
That's all for today. I hope I have given you everything you needed to get started with this module. If you are still living in doubt, you can approach me in the comment section below. I'll guide you the best way I can. Your feedback and suggestions are the piece of nuggets for us, on which we generate and shape our content - so keep that coming. Thanks for reading the article.

Introduction to ATmega128

Hey Guys! Hope you are doing well. I am back to feed you with valuable information relating to engineering and technology. Today, I'll uncover the details on the Introduction to ATmega128. It is an AVR, 8-bit low power microcontroller, that comes with a 64-pin interface and is based on RISC architecture.  Availability of 133 Powerful Instructions with single clock cycle and 32 x 8 General Purpose Working Registers make this device an ideal choice for many applications where decent code execution is required. The memory space incorporates on this module is more than normal AVR controllers including Program memory around 128K, enough to store the number of instructions on a single chip. In this post, I'll try to cover each and everything related to ATmega128, so you can get clear idea what is this about before aiming to pick it for your relevant project. Let's jump right in and get down to the nitty-gritty of this module.

Introduction to ATmega128

  • ATmega128 is an AVR, 8-bit low power microcontroller that contains 64-pin interface and is based on RISC architecture.
  • It is mainly used in an embedded system and industrial automation.
  • This AVR controller differs from PIC controllers in accordance with the instruction set where AVR requires one clock cycle to execute a number of instructions while PIC controllers need a number of clock cycles to execute a single instruction.
  • The ADC is included in the device that makes it an ideal choice for sensor interfacing where it receives the analog signal and converts it to a digital one. There are total 8 channels available on the ADC module.
  • Apart from communications protocols like SPI, I2C, and USRAT, this tiny module comes with watchdog timers, external interrupts, power up timer, 6 sleep modes and programming enable pin.
  • The Program Memory is based on Flash and comes with a memory space around 128K while EEPROM and SRAM are 4K each.
  • If you are an expert or newbie, you need this module every now and then for the development of the electronic projects where automation is a major concern. Ability to perform a number of functions without buying external components makes this device highly economical and best choice for the tech geeks.

1. ATmega128 Features

This AVR microcontroller comes with very useful features. Large memory space and number of pins make this device a step ahead for driving automation in the relevant project. Following table shows the main features of ATmega128.
No. of Pins 64
CPU 8-Bit AVR
Operating Voltage 4.5 to 5.5 V
Program Memory 128K
Program Memory Type Flash
RAM 4K
EEPROM 4K
ADC Number of ADC Channels 10-Bit 8
Analog Comparator Yes
PWM Channels 6
Oscillator up to 16 MHz
Timer (4) 16-Bit Timer (2) 8-Bit Timer (2)
Packages (3) PDIP TQFP QFN
Power Up Timer Yes
I/O Pins 53
Manufacturer Microchip
SPI Yes
I2C Yes
Watchdog Timer Yes
Brown out Detection (BOD) Yes
USART Yes
Sleep Modes 6
Minimum Operating Temperature -40 C
Maximum Operating Temperature 85 C

2. ATmega128 Pinout and Pin Description

The pinout and pin description of each pin will help you understand the major functions associated with each pin. Some pins are able to perform more than one functions on each pin.
Pinout
Following figure shows the pinout of ATmega128.  
  • The AVCC is the voltage applied to the ADC module while AREF is the reference voltage applied to the controller. The VCC and GND are the voltage supply and ground pins respectively.
Pin Description
Following table shows the description of each pin.
1 PEN Programming Enable
2 PE0 RXD PDI I/O Pin Serial Receive Pin (USART)
3 PE1 TXD PDO I/O Pin Serial Transmit Pin (USART)
4 PE2 XCK0 AIN0 I/O Pin External Interrupt PinAnalog Comparator Positive
5 PE3 OC3A AIN1 I/O Pin Dedicated Pin for Timer (PWM Channel) Analog Comparator Negative
6 PE4 OC3B INT4 I/O Pin Dedicated Pin for Timer (PWM Channel) Interrupt
7 PE5 OC3C INT5 I/O Pin Dedicated Pin for Timer (PWM Channel) Interrupt
8 PE6 T3 INT6 I/O Pin Timer 3 Interrupt
9 PE7 ICP3 INT7 I/O Pin Timer/Counter3 Input Capture Pin Interrupt
10 PB0 SS I/O Pin SS (Slave Select Input for SPI).  This pin is set to low when the controller acts as a slave
11 PB1 SCK I/O Pin SCK (Serial Clock for SPI). This clock is shared between the controller and external devices for accurate data transfer
12 PB2 MOSI I/O Pin MOSI (Master Output Slave Input) for SPI communication. The data is received by this pin when the microcontroller acts as a slave
13 PB3 MISO I/O Pin MISO (Master Input Slave Output) for SPI communication. The data is sent to the master using this pin when microcontroller acts as a slave
14 PB4 OC0 I/O Pin PWM Channel Output
15 PB5 OC1A I/O Pin PWM Channel Output
16 PB6 OC1B I/O Pin PWM Channel Output
17 PB7 OC2 OC1C I/O Pin PWM Channel Output
18 PG3 TOSC2 I/O Pin MISO (Master Input Slave Output) for SPI communication. When the controller acts as a slave, the data is sent by a controller to master through this pin Interrupt
19 PG4 TOSC1 I/O Pin SCK (SPI Bus Serial Clock). This clock is shared between the controller and other devices for data transfer Interrupt
20 RESET Voltage Supply Pin for ADC
21 VCC Voltage Reference
22 GND Ground Pin
23 XTAL2 Crystal Oscillator Output
24 XTAL1 Crystal Oscillator Input
25 PD0 SCL INT0 I/O Pin I2C communication External Interrupt 0
26 PD1 SDA INT1 I/O Pin I2C communication External Interrupt 1
27 PD2 RXD1 INT2 I/O Pin Serial Communication Receive Pin (USART) External Interrupt 2
28 PD3 TXD1 INT3 I/O Pin Serial Communication Transmit Pin (USART) External Interrupt 3
29 PD4 ICP1 I/O Pin Timer/Counter1 Input Capture Pin
30 PD5 XCK1 I/O Pin External Clock I/O for USART
31 PD6 T1 I/O Pin Timer 1
32 PD7 T2 I/O Pin Timer 2
33 PG0 WR I/O Pin Control Pin for writing to the external memory
34 PG1 RD I/O Pin Control Pin for reading from the external data memory
35 PC0 A8 I/O Pin
36 PC1 A9 I/O Pin
37 PC2 A10 I/O Pin
38 PC3 A11 I/O Pin
39 PC4 A12 I/O Pin
40 PC5 A13 I/O
41 PC6 A14 I/O Pin
42 PC7 A15 I/O Pin
43 PG2 ALE I/O Pin ALE (Address Latch Enable), it is used when multiple memory chips are connected to the microcontroller and only one of them needs to be selected
44 PA7 AD7 I/O Pin
45 PA6 AD6 I/O Pin
46 PA5 AD5 I/O Pin
47 PA4 AD4 I/O Pin
48 PA3 AD3 I/O Pin
49 PA2 AD2 I/O Pin
50 PA1 AD1 I/O Pin
51 PA0 AD0 I/O Pin
52 VCC Voltage Supply Pin
53 GND Ground
54 PF7 ADC7 TDI I/O Pin ADC Channel 7 JTAG Interface
55 PF6 ADC6 TDO I/O Pin ADC Channel 6 JTAG Interface
56 PF5 ADC5 TMS I/O Pin ADC Channel 5 JTAG Interface
57 PF4 ADC4 TCK I/O Pin ADC Channel 4 JTAG Interface
58 PF3 ADC3 I/O Pin ADC Channel 3
59 PF2 ADC2 I/O Pin ADC Channel 2
60 PF1 ADC1 I/O Pin ADC Channel 1
61 PF0 ADC0 I/O Pin ADC Channel 0
62 AREF Reference Voltage
63 GND Ground
64 AVCC Voltage Supply Pin for ADC

3. ATmega128 Main Functions

ATmega128 can perform a number of functions on a single chip. Large memory space with more number of pins interface put this device ahead of other controllers available in the AVR community. Following are the major functions associated to this tiny module.
Timer
Atmega128 comes with four timers i.e. two 8-bit and two 16-bit timers. These timers play a vital role in creating a delay of any running functions and can be used both ways i.e. timers as well as counters where former is used to control the internal functions of the controller and increments the instruction cycle, while later counts the number of intervals by incrementing the rising and falling edge of the pin and is mainly used for external functions. Two other timers added in the device are
  • Oscillator Start-up Timers
  • Power Up Timer
Oscillator start-up timer resets the controller to stabilize the crystal oscillator. And power-up timer is used to generating a minor delay once you power on the device, helps in stabilizing the power signals.
Number of Sleep Modes
This device incorporates Six Sleeping Modes for power saving purpose. These modes include:
  • Power-save
  • Power-down
  • Idle
  • ADC Noise Reduction
  • Standby
  • Extended Standby
Brown Out Detect (BOD)
The BOD, also known as BOR (Brown Out Reset), is a valuable addition to the device that helps in resetting the module once the Vcc (voltage supply) goes below a brownout threshold voltage. In this mode, multiple voltage ranges are produced to save the module once the power drops at the voltage supply line. If you aim to bring back the device from BOD function, it is advised to enable the Power Up Timer for creating a slight delay.
Watchdog Timer
Most of the chips, if not all, produced by Microchip, incorporate a built-in watchdog timer that resets the controller if the running program hangs up during compilation or gets stuck in the infinite loop. The main purpose of this timer is to prevent the controller from resetting it manually, giving you a slight edge over other processors where you need to wrestle your mind to manually reset the controller in case there comes a glitch in the running function. The watchdog timer behaves like a countdown timer.
Interrupt
The interrupts are very helpful for calling the desired function that puts the main running function on hold until the required instruction is executed. The controller goes back to the main program once the interrupt is executed.
I2C Communication
I2C protocol is used to layout the communication between low-speed devices like ADC and DAC converters and microcontrollers. It is a two wire communication that mainly contains two lines
  • Serial Clock (SCL)
  • Serial Data (SDA)
The former is a clock signal, mainly used to synchronize the data transfer between the devices and is generated by the master device, while the later is used to hold the desired data.
SPI Communication
ATmega128 houses a serial peripheral interface (SPI) that is mainly used for communication between the microcontroller and other peripheral devices such as sensors, shift registers, and SD cards. Separate clock and data lines are available, layered with a select line for selecting the relevant device for communication. Two pins used for SPI communication are as follow
  • MOSI (Master Output Slave Input)
  • MISO (Master Input Slave Output)
The MOSI pin is used for receiving the data when the microcontroller acts as a slave. Similarly, MISO helps in sending data by the microcontroller while later acts as a slave mode.

4. ATmega128 Compilers

Compilers are the basic software used for writing and compiling the code into the AVR controller. Some are free to use and some are paid. If you are getting your hands-on very first time with the controllers, it is advised to go with the free version, you can move to paid version as you grow and learn with the passage of time. Following are some basic compilers mainly used for AVR microcontrollers.
  • The IAR is a paid compiler and comes with a professional interface. As per the testimonials and personal experience of some of the experts, this compiler proves to the best version for the AVR microcontrollers.
  • CodeVision houses a CodeWizard and turns out to be highly economical for the controllers.
  • The GCC Port is another good pick to start with, but it comes with a bit complex interface. It works with both Windows and Linux operating systems.
  • ImageCraft is a valuable addition for compiling the code, but it doesn't incorporate some GUI features like editor and project management that may put you in big trouble during the code execution.

5. ATmega128 Memory Interface

Two memory types are mainly used in ATmeag128 named as Program Memory (Flash Memory) and SRAM memory where former makes use of a single pipelining for the execution of the instructions and later is a volatile memory mainly depends on the power supply source.  This AVR module incorporates a Harvard Architecture where separate memories spaces are reserved for both data and program. The memory space in the controller is nothing but a combination of the linear and regular memory maps. The Fast Access File Register is layered with 32 x 8 – Bit general purpose working registers. The single clock cycle is enough for accessing these registers and laying out the ALU (Arithmetic Logic Unit) operation where the result is stored in the Register file.
Program Memory (ROM)
Program memory has a memory space around 128K where recent instruction is called followed by the next instruction, executing the instructions in every clock cycle.
  • It is mainly categorized into two parts named as the Boot Program section and Application Program section. The former comes with Applications Flash Memory that plays the main part for SPM instruction writing.
Data Memory (RAM)
The data memory has a memory space around 4K. Five different addressing modes in the AVR architecture are used for addressing this RAM memory. These modes are named as
  • Direct
  • Indirect
  • Indirect with Displacement
  • Indirect with Pre-decrement
  • Indirect with Post-increment.
Three address registers, known as X, Y, and Z, increment and decrement in indirect addressing modes. Control registers are present in the flexible interrupt module that mainly come with global interrupt enable bit laying in the Status Register. These interrupts come with an Interrupt Vector Table where Interrupt Vector is a major part of it and both are inversely proportional to each other. It is important to note that, the Interrupt Vector table depends on the Interrupt Vector Position.
  • The ALU module operates in a single clock cycle and is divided into three main functions called direct, arithmetic and bit functions, that are directly connected with 32 general purpose registers.

6. ATmega128 Block Diagram

Following figure shows the block diagram of ATmega128.
  • ATmega128 comes with six software selectable power saving modes. The Power-down is very helpful for freezing the Oscillator and stops all other module functions while keeping the register contents saved. The functions remain disabled until the next interrupt is called and executed.
  • Similarly, the Idle mode allows the interrupt system, SPI Port, SRAM, Timers/Counter to function while keeping the CPU disabled.
  • The ADC Noise Reduction mode plays a vital role in minimizing the switching noise and freezes entire module except asynchronous ADC and Timers.
  • In the Power-save mode, the entire device is sleeping except asynchronous timer which continues to run.
  • The Standby mode puts the whole device in sleep mode except Crystal Oscialltor which continues to run, helping to consume low power. The Extended Standby mode allows both the Oscillator and the Asynchronous Timer to run while the rest of the device sleeps.
ATmega128 Applications
  • Embedded systems
  • Industrial Automation
  • Students Projects
  • Making of quadcopters
  • Home automation
That's all for today. I hope I have given you everything you needed to know about ATmega128. If you are unsure or have any question, you can approach me in the comment section below. I'll try and help you according to the best of my knowledge. Feel free to keep us updated with your valuable suggestions, so we keep providing quality work and you keep visiting us every now and then. Thanks for reading the article.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir