Infrared Sensor Library for Proteus
Hello friends, I hope you all are doing great. In today's tutorial, I am going to share a new
Infrared Sensor Library for Proteus. This IR sensor is not available in
Proteus and we are sharing this library for the first time. I hope it will help in your
Embedded Systems Projects particularly related to robotics and automation. So, if you want to work on this IR Sensor then I would suggest you to first design its simulation and then try your luck with hardware.
There are different types of Infrared Sensors & modules available in the market. Some of these modules have transmitter & receiver on separate chips and are mostly get activated when someone interrupts the light. The one we have designed has a transmitter & receiver on a single chip. The IR signal transmits from the IR transmitter and if it has some obstacle in front of it then it bounces back and received by the IR receiver. You should also have a look at this list of
New Proteus Libraries for Engineering Students. So, let's have a look at How to use this Infrared Sensor Library for Proteus:
Note:
- You should also have a look at:
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | Arduino Uno | Amazon | Buy Now |
Infrared Sensor Library for Proteus
- First of all, download the Library files of this IR Sensor by clicking the below button:
Infrared Sensor Library for Proteus
- After downloading this file extract it and you will find three Library files in it, named as:
- InfraredSensorsTEP.IDX
- InfraredSensorsTEP.LIB
- InfraredSensorsTEP.HEX
- Place all these three files in the Library folder of your Proteus software.
Note:
- Once you have added the files in the Library folder, then restart your Proteus software.
- In the components section, make a search for Infrared Sensor, as shown in below figure:
- Now place this IR Obstacle Sensor in your Proteus and if everything goes fine then you will get something as shown in below figure:
- As you can see in above figure that we have four pins on our Infrared sensor, which are:
- Vcc => You need to provide +5V to this pin.
- GND => It should be grounded.
- OUT => That's output pin and it will get HIGH when this sensor will find some obstacle in front and will remain LOW in normal condition.
- TestPin => As Proteus is a simulation software so we can't actually place something in front of this sensor. That's why I have used this TestPin. If this Pin is LOW, then sensor will remain normal and if it's HIGH then sensor will behave as it has something in front of it.
- Now double click this Infrared Sensor and its Properties Panel will open up.
- In the Program File section, browse to the file InfraredSensorTEP.HEX which you have already downloaded and placed in the Library folder of Proteus.
- Here's the screenshot of Properties Panel for this Infrared Sensor:
- I have encircled the Program File in above figure and you can see I have selected the InfraredSensorsTEP.HEX.
- So, now let's design a simple circuit and have a look at how to use this Infrared Sensor in Proteus.
- Here's the screenshot of Infrared Sensor Simulation in Proteus:
- So, now let's run our Proteus simulation and if everything goes fine then you will get results, as shown in the below figure:
- I will interface this sensor with different Microcontrollers e.g. Arduino, PIC Microcontroller etc. in my coming tutorial.
- As you can see in the above figure that when TestPin is LOW then OUT Pin is also LOW means there's no obstacle and when TestPin gets 1 then OUT Pin will go HIGH and that means we have some obstacle.
So, that's all for Infrared Sensor Library for Proteus. I hope it will help you guys in your engineering projects. Let me know if you have any suggestions. Take care & have fun !!! :)
Introduction to Arduino Mega 2560
Hey Fellas! Hope you are doing well. Today, I am going to unlock the details on the Introduction to Arduino Mega 2560. It is a microcontroller board based on Atmega 2560 microcontroller. Arduino Boards have revitalized the automation industry with their easy-to-use platform where everyone with little or no technical background can get started with learning some basic skills to program and run the board.
I have updated articles previously on Arduino Uno, Arduino Nano, and Arduino Pro Mini. All these boards function similarly in one way or the other. There are some basic features like PCB layout design, size, number of analog pins and breadboard friendly nature that make them different from each other. In terms of coding, all these boards are programmed in Arduino IDE software and you don't need to attach extra components or devices to put them in running condition. Everything is already built in the board that makes this device readily available. Just plug and play with the board as per your requirement. Here's the video presentation of Arduino Mega 2560:
All the boards mentioned above work perfectly for a number of Arduino Projects when you require a simple task to be completed with fewer I/O pins and memory. However, when the project goes complex, a board with less memory fails to complete the task. This is where Arduino Mega 2560 comes in handy. This board comes with 54 pins and 16 analog pins with more memory to store the code. Sounds crazy, isn't it? Thanks to technology that keep your covered in every aspect and provides support in any way when it comes to fulfilling your technical needs.
I'll try to cover each and everything related to Arduino Mega 2560, what is this about, the main features, working, technical specifications and everything you need to know. Let's jump right in.
No. |
Pin Number |
Pin Description |
1 |
D0 - D53 |
54 Digital Input / Output Pins. |
2 |
A0 - A15 |
16 Analog Input / Output Pins. |
3 |
D2 - D13 |
12 Pulse Width Modulation ( PWM ) Pins. |
4 |
Pin # 0 (RX) , Pin # 1 (TX)
Pin # 19 (RX1) , Pin # 18 (TX1)
Pin # 17 (RX2) , Pin # 16 (TX2)
Pin # 15 (RX3) , Pin # 14 (TX3) |
 4 Serial Communication Ports (8 Pins). |
5 |
Pin # 50 ( MISO )
Pin # 51 ( MOSI )
Pin # 52 ( SCK )
Pin # 53 ( SS ) |
SPI Communication Pins. |
6 |
Pin # 20 ( SDA ), Pin # 21 ( SCL ) |
I2C Communication Pins. |
7 |
Pin # 13 |
Built-In LED for Testing. |
Other Arduino Boards:
You should also have a look at these other Arduino board, you might find them interesting as well. Compare their features and find the most suitable one for your project. Here's the list of other Arduino boards:
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | Arduino Mega 2560 | Amazon | Buy Now |
Introduction to Arduino Mega 2560
- Arduino Mega 2560 is a Microcontroller board based on Atmega2560. It comes with more memory space and I/O pins as compared to other boards available in the market.
- There are 54 digital I/O pins and 16 analog pins incorporated on the board that make this device unique and stand out from others.
- Out of 54 digital I/O, 15 are used for PWM (pulse width modulation).
- A crystal oscillator of 16MHz frequency is added on the board.
- This board comes with USB cable port that is used to connect and transfer code from computer to the board.
- DC power jack is coupled with the board that is used to power the board. Some version of the Arduino board lacks this feature like Arduino Pro Mini doesn't come with DC power jack.
- ICSP header is a remarkable addition to Arduino Mega which is used for programming the Arduino and uploading the code from the computer.
- You can download the Arduino Mega 2560 datasheet bu clicking below button:
Download Arduino Mega 2560 Datasheet
- This board comes with two voltage regulator i.e. 5V and 3.3V which provides the flexibility to regulate the voltage as per requirements as compared to Arduino Pro Mini which comes with only one voltage regulator.
- There is no much difference between Arduino Uno and Arduino Mega except later comes with more memory space, bigger size and more I/O pins.
- Arduino software called Arduino IDE is used to program the board which is a common software used for all boards belonged to Arduino family.
- Availability of Atmega16 on the board makes it different than Arduino Pro Mini which uses USB to serial converter to program the board.
- There is a reset button and 4 hardware serial port called USART which produces a maximum speed for setting up communication.
- The following figure shows the specifications of Arduino mega 2560.
- Arduino Mega is specially designed for the projects requiring complex circuitry and more memory space. Most of the electronic projects can be done pretty well by other boards available in the market which make Arduino Mega uncommon for regular projects. However, there are some projects that are solely done by Arduino Mega like making of 3D printers or controlling more than one motors, because of its ability to store more instructions in the code memory and a number of I/O digital and analog pins.
- There are three ways to power the board. You can either use a USB cable to power the board and transfer code to the board or you can power it up using Vin of the board or through Power jack or batter.
- Last two sources to power the board are required once you already built and compile code into the board through USB cable.
- This board comes with resettable polyfuse that prevents the USB port of your computer from overheating in the presence of high current flowing through the board. Most of the computers come with an ability to protect themselves from such devices, however, the addition of fuse provides an extra layer of protection.
- It can be used either way i.e. for creating stand-alone projects or in combination with other Arduino boards. Most complex projects can be created using this board.
Let's have a look at Arduino Mega 2560 Pinout:
Arduino Mega 2560 Pinout
- Following figure shows the pinout of Arduino Mega 2560:
- Each pin comes with a specific function associated with it. All analog pins can be used as digital I/O pins.
- Designing of a project using Arduino Mega gives you the flexibility of working with more memory space and processing power that allows you to work with a number of sensors at once. This board is physically larger than other Arduino boards.
Arduino Mega 2560 Pin Description
- 5V & 3.3V. This pin is used to provide output regulated voltage around 5V. This regulated power supply powers up the controller and other components on the board. It can be obtained from Vin of the board or USB cable or another regulated 5V voltage supply. While another voltage regulation is provided by 3.3V pin. Maximum power it can draw is 50mA.
- GND. There are 5 ground pins available on the board which makes it useful when more than one ground pins are required for the project.
- Reset. This pin is used to reset the board. Setting this pin to LOW will reset the board.
- Vin. It is the input voltage supplied to the board which ranges from 7V to 20V. The voltage provided by the power jack can be accessed through this pin. However, the output voltage through this pin to the board will be automatically set up to 5V.
- Serial Communication. RXD and TXD are the serial pins used to transmit and receive serial data i.e. Rx represents the transmission of data while Tx used to receive data. There are four combinations of these serial pins are used where Serail 0 contains RX(0) and TX(1), Serial 1 contains TX(18) and RX(19), Serial 2 contains TX(16) and RX(17), and Serial 3 contains TX(14) and RX(15).
- External Interrupts. Six pins are used for creating external interrupts i.e interrupt 0(0), interrupt 1(3), interrupt 2(21), interrupt 3(20), interrupt 4(19), interrupt 5(18). These pins produce interrupts by a number of ways i.e. providing LOW value, rising or falling edge or changing value to the interrupt pins.
- LED. This board comes with built-in LED connected to digital pin 13. HIGH value at this pin will turn the LED on and LOW value will turn it off. This gives you the change of nursing your programming skills in real time.
- AREF. AREF stands for Analog Reference Voltage which is a reference voltage for analog inputs.
- Analog Pins. There are 16 analog pins incorporated on the board labeled as A0 to A15. It is important to note that all these analog pins can be used as digital I/O pins. Each analog pin comes with 10-bit resolution. These pins can measure from ground to 5V. However, the upper value can be changed using AREF and analogReference() function.
- I2C. Two pins 20 and 21 support I2C communication where 20 represents SDA (Serial Data Line mainly used for holding the data) and 21 represents SCL(Serial Clock Line mainly used for providing data synchronization between the devices)
- SPI Communication. SPI stands for Serial Peripheral Interface used for the transmission of data between the controller and other peripherals components. Four pins i.e. 50 (MISO), 51 (MOSI), 52 (SCK), 53 (SS) are used for SPI communication.
Arduino Mega 2560 Dimensions
Follwoing figure shows the dimensions of the Arduino Mega 2560:
- Arduino Mega is comparatively larger than other boards available in the market. It comes 4-inch length and 2.1-inch width. However, USB port and power jack are slightly extended from the given dimensions.
Shield Compatibility with Arduino Mega 2560
- Arduino Mega is compatible with most of the shields designed for other Arduino boards.
- Before you intend to use a shield, make sure the operating voltage of the shield is compatible with the board voltage. Most of the shields operate at 3.3V or 5V which is compatible with this board, however, shields with higher operating voltage can damage the board.
- Also, the header distribution of the shield must resonate with the pin distribution of the board, so you can simply attach the shield with the board and make it in a running condition.
Arduino Mega 2560 Programming
- Arduino Mega 2560 can be programmed using Arduino Software called IDE which supports C programming.
- The code you make on the software is called sketch which is burned in the software and then transferred to the board through USB cable.
- This board comes with a built-in bootloader which rules out the usage of an external burner for burning the code into the board.
- The bootloader communicates using STK500 protocol.
- Once you compile and burn the program on the board, you can unplug the USB cable which eventually removes the power from the board. When you intend to incorporate the board into your project, you can power it up using power jack or Vin of the board.
- Multitasking is another feature where Arduino mega comes handy. However, Arduino IDE Software doesn't support multitasking feature but you can use other operating systems like FreeRTOS and RTX to write C program for this purpose. This gives you the flexibility of using your own custom build program using ISP connector.
Arduino Mega 2560 Applications
Arduino Mega 2560 is an ideal choice for the projects requiring more memory space to used with more number of number pins on the board. Following are the main applications of the Arduino mega boards.
- Developing 3D printer
- Controlling and handling more than one motors
- Interfacing of number of sensors
- Sensing and detecting temperature
- Water level detection projects
- Home automation and security systems
- Embedded Systems
- IoT applications
- Parallel programming and Multitasking
That's all for today. I hope you have found this article useful. However, 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 best of my expertise. Feel free to keep us updated with your feedback and suggestions, they help us provide you quality work that resonates with your field of work and helps you keep coming back for what we have to offer. Thanks for reading the article.
Introduction to Arduino Pro Mini
Hey Friends! Hope you are doing well. Today, I am going to give you a detailed Introduction to Arduino Pro Mini. It's a microcontroller board developed by Arduino.cc and is based on the Atmega328 microcontroller.
Arduino Pro Mini is quite similar to Arduino UNO in overall functionality however the main difference lies in its size and built-in programmer. Arduino Pro Mini is very small in size & it lacks a built-in programmer & USB Port. Arduino Uno comes with two onboard voltage regulators (i.e. 5V and 3.3V) while Arduino Pro Mini comes with a single voltage regulator.
There are two versions of Arduino Pro Mini available, first one operates at 5V & runs at 16MHz while the second one is of 3.3V runs at 8MHz.
Arduino boards are mainly used for the development of automation, robotics, embedded systems and other electronics projects. These boards were developed with the intention of providing easy hardware and software combination that gives a quick pathway to people with no technical background.
Arduino Pro Mini Key Features
|
No. |
Feature |
Value |
1 |
Microcontroller |
ATmega328 |
2 |
Operating Frequency/Crystal Oscillator |
16MHz/8MHz |
3 |
Digital I/O Pins |
14 |
4 |
Analog Pins |
8 |
5 |
PWM(Pulse Width Modulation) Pins |
6 |
6 |
Built-in Programmer |
Not available. |
7 |
USB Port |
Not available. |
8 |
Flash Memory |
32KB |
9 |
SRAM |
2KB |
10 |
EEPROM |
1KB |
11 |
Bootloader |
0.5KB in Flash Memory. |
In today's tutorial, I'll discuss each and everything related to Arduino Pro Mini so you don't need to scrape through the internet and find all information in one place. Let's get started.
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | Arduino Pro Mini | Amazon | Buy Now |
Introduction to Arduino Pro Mini
- Arduino Pro Mini is a compact, small-sized & application-type microcontroller board, developed by Arduino.cc and comes with an Atmega328 microcontroller incorporated on the board.
- This board comes with 14 Digital I/O Pins, out of which 6 pins are used for providing PWM output.
- Arduino Pro Mini Pinout also consists of 8 Analog Pins.
- The size of Arduino Pro Mini is 1/6th of the size of Arduino Uno, so it's quite small as compared to Arduino UNO.
- Depending on operating voltage, Arduino Pro Mini is of two types:
- Operating Voltage: 5.0V, Crystal Oscillator: 16MHz, Voltage Regulator: KB33.
- Operating Voltage: 3.3V, Crystal Oscillator: 8MHz, Voltage Regulator: KB50.
- In order to reduce the size, the USB port & built-in programmer are removed from Arduino Pro Mini, so after uploading code you can simply place it in your application(that's why also termed as application-type).
- Official Arduino Software called Arduino IDE (Integrated development environment) is used to write & upload programming code. The code we write to program this board is normally called a sketch.
- Arduino Pro Mini also has a Reset Button and a small LED connected to pin number 13.
Arduino Pro Mini Memory Allocations
- Arduino Pro Mini comes with 3 types of built-in memories:
- Flash Memory of 32KB out of which 0.5KB is used by the bootloader code.
- SRAM of 2KB.
- EEPROM of 1KB.
Now let me give you a brief overview of these memories, I have explained them in detail here:
What is a Microcontroller?
- Flash Memory is a non-volatile memory and is used for storing the programming code. As it's a non-volatile memory so it stores information even if the connection with the power supply is lost.
- SRAM(Static Random Access Memory) usually referred to as RAM memory is a volatile memory and is used to store temporary data i.e. variables. It loses data if we cut off the power supply.
- EEPROM is a semi-volatile memory and thus can be erased by programming.
Arduino Pro Mini Specifications
Here, I have shared a few more specifications and functionalities of Arduino Pro Mini.
- This board doesn't come with connectors already soldered which gives you the flexibility to solder the connectors in any way you want, based on the requirements and space available for your project.
- There is only one voltage regulator incorporated on the board i.e 3.3V or 5V based on the version of the board.
- The labeling on the voltage regulator defines the version of the board i.e. KB33 represents 3.3V edition and KB50 represents 5V edition. However, the board version can also be indicated by measuring the voltage between Vcc and GND pin.
- Overcurrent protection is another feature available in Arduino Pro Mini.
- The following figure shows the specifications of the board.
Arduino Pro Mini Datasheet
- You can download Arduino Pro Mini Datasheet by clicking the below button:
Download Arduino Pro Mini Datasheet
Now let's have a look at the Pinout of Arduino Pro Mini in detail:
Arduino Pro Mini Pinout
- As we know, each pin of the Microcontroller is assigned with multiple functions.
- In the below table, I have shared the key points of the Arduino Pro Mini pin diagram and labeled functions assigned to them:
Arduino Pro Mini Pinout |
No. |
Pin Number |
Pin Description |
1 |
Pins 0 - 13 |
14 Digital I/O Pins. |
2 |
Pins A0 - A7 |
8 Analog Pins. |
3 |
Pins 3, 5, 6, 9, 10 & 11 |
6 Pulse Width Modulation ( PWM ) Pins. |
4 |
Pins 0(RX) & 1(TX) |
Serial Communication Pins. |
5 |
Pins 10, 11, 12 & 13 |
SPI Communication Pins. |
6 |
Pins A4 & A5 |
I2C Communication Pins. |
7 |
Pin # 13 |
Built-In LED for Testing. |
8 |
Pins 4 & 5 |
External Interrupt Pins. |
- Here's the Circuit Diagram of Arduino Pro Mini Pinout:
Arduino Pro Mini Power Pins
- Vcc: Arduino Pro Mini Pinout consists of 2 Vcc Pins. It gives the regulated voltage i.e. 5V or 3.3V depending on the type of the board.
- GND: There are 3 GND(ground) pins incorporated on the board.
- RAW. This pin is used for supplying raw voltage to the board. You can power connect an external power supply ranging from 5V to 12 V.
- Reset: Pro Mini board comes with 2 Reset Pins, which comes in handy if the board hangs up in the middle of the running program, making this pin LOW will reset the board.
- In the below figure, I have highlighted the Power Pinout of Arduino Pro Mini:
Programming Header Pins
- Programming Header: FTDI six-pin programmer is connected with these pins and is used to upload programming code on the Pro Mini board.
Arduino Pro Mini I/O Pins
- Digital Pins: Arduino Pro Mini has 14 Digital I/O Pins in total labeled from 0 to 13, where Pin 0 is RX1 and Pin 1 is TX0.
- Analog Pins: It has 8 analog pins labeled from A0 to A7. These pins are used to input analog signals and come with a total resolution of 10bit.
I have encircled digital pins with green color and analog pins with orange color in the below figure:
Arduino Pro Mini Communication Pins
- Arduino Pro Mini supports 3 Communication Protocols for the transmission of data with other peripherals i.e. sensors, registers etc. and are named as:
- Serial Protocol.
- I2C Protocol.
- SPI(Serial Peripheral Interface) Protocol.
- TXD & RXD Pins: These pins are used for serial communication. TXD represents the transmission of serial data while RXD is used for receiving the data. Code is also uploaded through Serial Protocol.
- SPI Pins: Four pins 10(SS), 11(MOSI), 12(MISO), and 13(SCK) are used for communicating through SPI Protocol.
- I2C Pins: Two Pins(A4 and A5) are used for developing I2C communication. A4 is known as serial data line (SDA) which holds the data and A5 shows serial clock line (SCL) which provides data synchronization clock.
Other Pinouts
- PWM. There are 6 digital pins labeled as 3,5,6,9,10, and 11 available on the board that provide PWM (pulse width modulation).
- External Interrupts. There are two external interrupts available called T0(at Pin 4) and T1(at Pin 5). They are also known as hardware interrupts.
Arduino Pro Mini Vs Other Arduino Boards
- Most of the Arduino boards come with a USB port that is used to send the program from the computer to the board. However, in the case of Arduino Pro Mini, all of the USB circuitry is removed to make it as compact and small as possible. You can program the board using a USB to serial converter cable. The FT232RL USB serial module is very handy and preferable for programming this board. A six-pin FTDI header can be connected to a USB to serial converter that provides the USB power.
- If you have already worked on the Arduino Uno board, then no need to buy a USB to serial converter cable as you can program the Pro Mini using Uno board. Make sure, the Pro Mini version you are working on comes with 5V regulation as it runs at 16MHz like Arduino Uno board. Programming your 3.3V Pro Mini board will not be compatible with the Arduino Uno board, hence making it very difficult to program the 3.3V version of the Pro Mini board.
- The form factor is another major difference that makes this device unique.
- Pro Mini comes in a very small and compact size which makes this device suitable for most applications. But small size comes with one limitation i.e. it doesn't compatible with Arduino Shields unless you hard-wire the board with Arduino Shield.
Arduino Pro Mini Set Up
- First, you need to install the Arduino IDE software on your computer, which is the official software used to program Arduino boards.
- Connect the board with USB to Serial converter (FTDI serial module) that is used to transfer the program from computer to the board.
- Write the program in the IDE software in C language.
- No separate burner is required to burn the code. You can directly burn the code in the IDE software and transfer it to the board.
- Once you have burned and transferred the program to the board, the next step is to power the board to make it compatible with your project.
- Apart from using FTDI serial module, there are two ways to power the board. You can power the board through the RAW by setting the voltage range anywhere between 5V to 12V. It will automatically regulate to 3.3V based on the version of the board. However, if your project comes with a regulated voltage of 3.3V, then you can connect it directly to the Vcc pin of the board. Make sure, the board version is KB33 that runs at 3.3V, another version KB50 will run at 5V.
- These two ways of powering up the board are useful when you have disconnected the board with the computer and already burned the program using FTDI module.
Applications of Arduino Pro Mini
There are many applications of Arduino Boards, but the small size and ease of use make Arduino Pro Mini stand out from others, especially where space requirement of the project is highly concerned.
That's all for today. We always strive to give you quality work based on your needs and requirements. However, if you are unsure or have any question, you can approach me in the comment section below. I'd love to help you according to best of my knowledge. Keep your suggestions coming; they help us provide you best content so you keep coming back for what we have to offer. Thanks for reading the article.
Introduction to Arduino Uno
Hi Friends! Hope you are doing great. Today, I am going to give you a detailed Introduction to Arduino Uno. It is a microcontroller board developed by Arduino.cc and is based on Atmega328 Microcontroller. The first Arduino project was started in Interaction Design Institute Ivrea in 2003 by David Cuartielles and Massimo Banzi with the intention of providing a cheap and flexible way for students and professionals to learn embedded programming.
Arduino UNO is a very valuable addition in electronics that consists of a USB interface, 14 digital I/O pins(of which 6 Pins are used for PWM), 6 analog pins and an Atmega328 microcontroller. It also supports 3 communication protocols named Serial, I2C and SPI protocol. You should also have a look at this video presentation on Arduino UNO:
- Few main features of Arduino UNO are shown in the below figure:
Arduino UNO Features and Technical Specs |
No. |
Parameter Name |
Parameter Value |
1 |
Microcontroller |
Atmega328 |
2 |
Crystal Oscillator |
16MHz |
3 |
Operating Voltage |
5V |
4 |
Input Voltage |
5-12V |
5 |
Digital I/O Pins |
14 (D0 to D13) |
6 |
Analog I/O Pins |
6 (A0 to A5) |
7 |
PWM Pins |
6 (Pin # 3, 5, 6, 9, 10 and 11) |
8 |
Power Pins |
5V, 3.3V, Vin, GND |
9 |
Communication |
UART(1), SPI(1), I2C(1) |
10 |
Flash Memory |
32 KB (0.5KB is used by bootloader) |
11 |
SRAM |
2 KB |
12 |
EEPROM |
1 KB |
13 |
ICSP Header |
Yes |
14 |
Power sources |
DC Power Jack & USB Port |
I'll try to cover each and everything related to Arduino Uno, so you get a clear idea of what it does, its main features, working and everything you need to know. Let's get started.
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | Arduino Uno | Amazon | Buy Now |
Introduction to Arduino Uno
- Arduino Uno is a microcontroller board, developed by Arduino.cc, based on the Atmega328 microcontroller and is marked as the first Arduino board developed(UNO means "one" in Italian).
- The software used for writing, compiling & uploading code to Arduino boards is called Arduino IDE (Integrated Development Environment), which is free to download from Arduino Official Site.
- It has an operating voltage of 5V while the input voltage may vary from 7V to 12V.
- Arduino UNO has a maximum current rating of 40mA, so the load shouldn't exceed this current rating or you may harm the board.
- It comes with a crystal oscillator of 16MHz, which is its operating frequency.
- Arduino Uno Pinout consists of 14 digital pins starting from D0 to D13.
- It also has 6 analog pins starting from A0 to A5.
- It also has 1 Reset Pin, which is used to reset the board programmatically. In order to reset the board, we need to make this pin LOW.
- It also has 6 Power Pins, which provide different voltage levels.
- Out of 14Â digital pins, 6 pins are used for generating PWM pulses of 8-Bit resolution. PWM pins in Arduino UNO are D3, D5, D6, D9, D10 and D11.
- Arduino UNO comes with 3 types of memories associated with it, named:
- Flash Memory: 32KB
- SRAM: 2KB
- EEPROM: 1KB
- Arduino UNO supports 3 types of communication protocols, used for interfacing with third-party peripherals, named:
- Serial Protocol
- I2C Protocol
- SPI Protocol
- You can download the Arduino UNO datasheet by clicking the below button:
Download Arduino UNO Datasheet
- Apart from USB, a battery or AC to DC adopter can also be used to power the board.
Features of Arduino Uno Board
- Arduino Uno comes with a USB interface i.e. USB port is added on the board to develop serial communication with the computer.
- Atmega328 microcontroller is placed on the board that comes with a number of features like timers, counters, interrupts, PWM, CPU, I/O pins and based on a 16MHz clock that helps in producing more frequency and number of instructions per cycle.
- It is an open-source platform where anyone can modify and optimize the board based on the number of instructions and tasks they want to achieve.
- This board comes with a built-in regulation feature that keeps the voltage under control when the device is connected to the external device.
- A reset pin is present in the board that resets the whole board and takes the running program in the initial stage. This pin is useful when the board hangs up in the middle of the running program; pushing this pin will clear everything up in the program and starts the program right from the beginning.
- There are 14 I/O digital and 6 analog pins incorporated in the board that allows the external connection with any circuit with the board. These pins provide flexibility and ease of use to the external devices that can be connected through these pins. There is no hard and fast interface required to connect the devices to the board. Simply plug the external device into the pins of the board that are laid out on the board in the form of the header.
- The 6 analog pins are marked as A0 to A5 and come with a resolution of 10bits. These pins measure from 0 to 5V, however, they can be configured to the high range using analogReference() function and AREF pin.
- Only 5 V is required to turn the board on, which can be achieved directly using a USB port or external adopter, however, it can support an external power source up to 12 V which can be regulated and limit to 5 V or 3.3 V based on the requirement of the project.
Arduino Uno Pinout
Arduino Uno is based on an AVR microcontroller called Atmega328. This controller comes with 2KB SRAM, 32KB of flash memory, 1KB of EEPROM. Arduino Board comes with 14 digital pins and 6 analog pins. ON-chip ADC is used to sample these pins. A 16 MHz frequency crystal oscillator is equipped on the board. The following figure shows the pinout of the Arduino Uno Board.
Arduino UNO Pin Description
There are several I/O digital and analog pins placed on the board which operates at 5V. These pins come with standard operating ratings ranging between 20mA to 40mA. Internal pull-up resistors are used in the board that limits the current exceeding the given operating conditions. However, too much increase in current makes these resisters useless and damages the device.
- LED. Arduino Uno comes with a built-in LED which is connected through pin 13. Providing HIGH value to the pin will turn it ON and LOW will turn it OFF.
- Vin. It is the input voltage provided to the Arduino Board. It is different than 5 V supplied through a USB port. This pin is used to supply voltage. If a voltage is provided through a power jack, it can be accessed through this pin.
- 5V. This board comes with the ability to provide voltage regulation. 5V pin is used to provide output regulated voltage. The board is powered up using three ways i.e. USB, Vin pin of the board or DC power jack.
- USB supports voltage around 5V while Vin and Power Jack support a voltage ranges between 7V to 20V. It is recommended to operate the board on 5V. It is important to note that, if a voltage is supplied through 5V or 3.3V pins, they result in bypassing the voltage regulator that can damage the board if the voltage surpasses its limit.
- GND. These are ground pins. More than one ground pins are provided on the board which can be used as per requirement.
- Reset. This pin is incorporated on the board which resets the program running on the board. Instead of physical reset on the board, IDE comes with a feature of resetting the board through programming.
- IOREF. This pin is very useful for providing voltage reference to the board. A shield is used to read the voltage across this pin which then selects the proper power source.
- PWM. PWM is provided by 3,5,6,9,10, 11pins. These pins are configured to provided 8-bit output PWM.
- SPI. It is known as Serial Peripheral Interface. Four pins 10(SS), 11(MOSI), 12(MISO), 13(SCK) provide SPI communication with the help of the SPI library.
- AREF. It is called Analog Reference. This pin is used for providing a reference voltage to the analog inputs.
- TWI. It is called Two-wire Interface. TWI communication is accessed through Wire Library. A4 and A5 pins are used for this purpose.
- Serial Communication. Serial communication is carried out through two pins called Pin 0 (Rx) and Pin 1 (Tx).
- Rx pin is used to receive data while Tx pin is used to transmit data.
- External Interrupts. Pin 2 and 3 are used for providing external interrupts. An interrupt is called by providing LOW or changing value.
Communication and Programming
Arduino Uno comes with the ability of interfacing with other Arduino boards, microcontrollers and computers. The Atmega328 placed on the board provides serial communication using pins like Rx and Tx.
The Atmega16U2 incorporated on the board provides a pathway for serial communication using USB com drivers. A serial monitor is provided on the IDE software which is used to send or receive text data from the board. If LEDs placed on the Rx and Tx pins will flash, they indicate the transmission of data.
Arduino Uno is programmed using Arduino Software which is a cross-platform application called IDE written in Java. The AVR microcontroller Atmega328 laid out on the base comes with built-in bootloader that sets you free from using a separate burner to upload the program on the board.
Applications of Arduino UNO
Arduino Uno comes with a wide range of applications. A larger number of people are using Arduino boards for developing sensors and instruments that are used in scientific research. Following are some main applications of the board.
- Embedded System
- Security and Defense System
- Digital Electronics and Robotics
- Parking Lot Counter
- Weighing Machines
- Traffic Light Count Down Timer
- Medical Instrument
- Emergency Light for Railways
- Home Automation
- Industrial Automation
There are a lot of other microcontrollers available in the market that are more powerful and cheap as compared to the Arduino board. So, why you prefer Arduino Uno?
Actually, Arduino comes with a big community that is developing and sharing knowledge with a wide range of audiences. Quick support is available pertaining to the technical aspects of any electronic project. When you decide Arduino board over other controllers, you don't need to arrange extra peripherals and devices as most of the functions are readily available on the board that makes your project economical in nature and free from a lot of technical expertise.
That's all for today. I hope you have got a lot of information regarding the Arduino Uno board. However, if you are unsure or have any questions you can approach me in the comment section below. I'd love to help you according to the best of my knowledge. Keep your feedback and suggestions coming; they help us provide you quality work that resonates with your needs and requirements. Thanks for reading the article.
Smoke Detector with Arduino & MQ2 Sensor
Hello everyone, I hope you all are doing great. In today's tutorial, we are gonna have a look at How to design a
Smoke Detector with Arduino. Its quite a simple project but if you are working on any security project then you must add this feature in it. You should also download this
Gas Sensor Library for Proteus, and design its simulation.
I will use gas sensor MQ2 for this project. I have purchased MQ2 Gas Sensor module as its quite easy to interface with Arduino. Arduino board I'm using is Arduino UNO. I have also designed an
LPG Gas Leak Detect using Arduino using this MQ2 Sensor. So, let's get started with How to design Smoke Detector with Arduino & MQ2 Sensor.
Smoke Detector with Arduino & MQ2 Sensor
- First of all, we need to connect some jumper wires between Arduino and MQ2 smoke sensor shield.
- Here's the image of our Gas sensor and you can see, it has four pins in total.
- This gas sensor has four pins in total, which are:
- Vcc: We need to provide +5V.
- GND: We need to ground it.
- D0: Digital Output.
- A0: Analog Output.
- So now you will need four male to female jumper wires and connect them as shown in below figure:
- Sensor's pins are labelled on the back side and I have connected these four pins as follows:
- White Wire: Vcc of Sensor connected with +5V of Arduino.
- Black Wire: GND of Sensor connected with GND of Arduino.
- Grey Wire: D0 of Sensor connected with Pin # 8 of Arduino.
- Orange Wire: A0 of Sensor connected with A0 of Arduino.
- So, now let's design our code in Arduino software in which we will detect whether there's smoke around or not.
- I'm gonna use the analog output of our sensor and will first display the analog value in my Serial Monitor.
- I have used the below code, so copy it and upload in your Arduino board:
int Input = A0;
int SensorVal = 0;
void setup() {
Serial.begin(9600);
pinMode(Input, INPUT);
Serial.println("Interfacing of Smoke Sensor with Arduino");
Serial. println("Design by www.TheEngineeringProjects.com");
Serial.println();
}
void loop() {
SensorVal = analogRead(Input);
Serial.println(SensorVal);
delay(500);
}
- Now open the Serial Monitor of Arduino to check the analog values coming from our sensor.
- If everything goes fine then you will get something like this in your Serial Monitor:
- You can see we are getting the values in range of 420 to 450.
- You should read How to do Arduino Serial Communication, if you don't know how to get data serially.
- Now let's place a burning cigarette near it for smoke. (Cigarettes are injurious to health :P )
- When the sensor will sense smoke in its surroundings then its value will start to increase and in my case it reached to around 650.
- So, let's place a check in our Arduino coding to detect whether there's smoke or not.
- So add below code in your Arduino software and upload it to your Arduino board.
int Input = A0;
int SensorVal = 0;
int Check = 0;
void setup() {
Serial.begin(9600);
pinMode(Input, INPUT);
Serial.println("Interfacing of Smoke Sensor with Arduino");
Serial. println("Design by www.TheEngineeringProjects.com");
Serial.println();
}
void loop() {
SensorVal = analogRead(Input);
if((SensorVal > 500) && (Check == 1))
{
Serial.println("Smoke Detected . . .");
Check = 0;
}
if((SensorVal < 500) && (Check == 0))
{
Serial.println("All Clear . . .");
Check = 1;
}
//Serial.println(SensorVal);
delay(500);
}
- After uploading the code to Arduino, open your Serial Monitor.
- If everything goes fine then you will get something as shown in below figure:
- Now let me bring the cigarette close to get some smoke. (Cigarettes are injurious to health :P )
- You will get the warning as soon as it will detect smoke as shown in below figure:
- We got the detection of smoke in our Serial Terminal.
So, that's how we can easily design a Smoke Detector with Arduino & MQ2 Sensor. I think now you can quite easily design this smoke detector project at home. I hope you will enjoy it. Will meet you guys in next tutorial. Till then take care and have fun !!! :)
Magnetic Reed Switch Library for Proteus
Hello friends, I hope you all are doing great. In today's tutorial, I am going to share new
Magnetic Reed Switch Library for Proteus. We are quite proud to share it as its not been designed before. Our TEP Team has designed it and I think they need a little appreciation. :P You can interface it with any
Microcontroller like Arduino, PIC or
8051 Microcontroller etc.
As Proteus is a simulation software so we can't produce magnetic field in it. That's why, we have placed a TestPin and when you provide HIGH Signal to that TestPin then it will act as it has magnet around. Similarly, if you provide LOW Signal to that TestPin then it will behave normal and will sense no magnet around. Rite now, we have just designed two Magnetic Reed Switches but soon we will design other Reed Switches as well. So, let's get started with How to download and use
Magnetic Reed Switch Library for Proteus.
Magnetic Reed Switch Library for Proteus
- First of all, download this Magnetic Reed Switch Library for Proteus by clicking the below button:
Download Proteus Library Files
- You will get a .rar file so unzip it using winrar.
- Inside this .rar file, you will find three Proteus Library files, named as:
- MagneticReedSwitchesLibraryTEP.IDX
- MagneticReedSwitchesLibraryTEP.DLL
- MagneticReedSwitchesLibraryTEP.HEX
- Place all these three files in the Library folder of your Proteus 7 or 8 Professional.
Note:
- Here are the images of these real Magnetic Reed Switch Modules along with our designed modules in Proteus:
- We have designed these two modules, both of these modules give digital output only in Proteus but in real the reed module with red color also gives analog output.
- We are not yet able to produce analog output in Proteus, so that's why we have only digital output. :)
- Now I hope that you have placed all those three Proteus Library files in the Library folder of your Proteus software, so open your Proteus software or restart it.
- In Proteus software, go to your components search box and make a search for Magnetic Reed Switch as shown in below figure:
- Now place both of these modules in your Proteus software and they will look something, as shown in below figure:
- Double click any of these modules and its Properties panel will open up.
- Now in the Program File section, browse to our downloaded Library file MagneticReedSwitchesLibraryTEP.HEX as shown in below figure:
- Now click OK to close this Properties window.
- You can see we have four pins in total attached to our Magnetic Reed Switch, which are:
- Vcc: We have to provide +5V at this pin.
- GND: We have to provide Ground (0V) at this pin.
- D0: That's the Output Pin, it will be HIGH when some magnet is around otherwise remain LOW.
- TestPin: As Proteus a simulation so we can't provide magnetic field, that's why we have palced this TestPin. If TestPin is HIGH then it means magnetic field is around and if its LOW then there's no magnet around.
- I hope you have understood the pinout of this Reed Switch, so now let's design a simple simulation to test them out.
- So, design a simple circuit in Proteus as shown in below figure:
- Now run your simulation, and change the Logic State from 0 to 1, which is connected at TestPin.
- If everything goes fine then you will get such results:
- As you can see in the above figure that D0 Pin is HIGH when I changed the Logic State from 0 to 1 and that's why LED attached at D0 Pin is now ON.
- I have also designed a similar simulation for the other Magnetic Reed Switch and its ON state is shown in below figure:
- I have already added both of these simulations in the above download file.
- So, first add your Library and then run these simulations.
- I will soon interface this sensor with different Microcontrollers like Arduino, 8051 Microcontroller, PIC Microcontroller etc.
So, that's was all for today. I hope you will enjoy this Magnetic Reed Switch Library for Proteus and will use it in your Engineering Projects. Thanks for reading & have fun !!! :)
Heart Beat Monitor using Arduino in Proteus
Hello friends, I hope you all are doing great and having fun in your lives. In today's tutorial, we are gonna design a Heart Beat Monitor using Arduino in Proteus ISIS. You should download this
Heart Beat Sensor Library V2.0 for Proteus because we are gonna use that to detect heart beat in Proteus.
I have also used a 20x4 LCD which will display our heart rate value. You should download this
New LCD Library for Proteus. I have counted the heart beat for ten seconds and then I have multiplied it with 6 to get the heartbeat per minute which is abbreviated as bpm (beats per minute). So, let's get started with Heart Beat Monitor using Arduino in Proteus ISIS.
Where To Buy? |
---|
No. | Components | Distributor | Link To Buy |
1 | LCD 20x4 | Amazon | Buy Now |
2 | Arduino Uno | Amazon | Buy Now |
Heart Beat Monitor using Arduino in Proteus
- First of all, click the below button to download this complete Proteus simulation & Arduino code for Heart Beat Monitor:
Heart Beat Monitor using Arduino in Proteus
Proteus Simulation of Heart Rate Monitor
- Now let's have a look at How we have designed this simulation and How it works.
- So, design a simple circuit in Proteus as shown in the below figure:
- As you can see in the above figure, we have our Arduino UNO board along with LCD and Heart Beat Sensor.
- There's also a Button attached to Pin # 2, so when we press this button our Arduino will start counting the Heart Beat and will update it on the LCD.
Now let's have a look at the programming code for Heart Rate Monitor:
Arduino Code for Heart Rate Monitor
- Here's the code which I have used for this Heart Beat Monitor using Arduino:
#include <LiquidCrystal.h>
#include <TimerOne.h>
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
int HBSensor = 4;
int HBCount = 0;
int HBCheck = 0;
int TimeinSec = 0;
int HBperMin = 0;
int HBStart = 2;
int HBStartCheck = 0;
void setup() {
// put your setup code here, to run once:
lcd.begin(20, 4);
pinMode(HBSensor, INPUT);
pinMode(HBStart, INPUT_PULLUP);
Timer1.initialize(800000);
Timer1.attachInterrupt( timerIsr );
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Current HB : ");
lcd.setCursor(0,1);
lcd.print("Time in Sec : ");
lcd.setCursor(0,2);
lcd.print("HB per Min : 0.0");
}
void loop() {
if(digitalRead(HBStart) == LOW){lcd.setCursor(0,3);lcd.print("HB Counting ..");HBStartCheck = 1;}
if(HBStartCheck == 1)
{
if((digitalRead(HBSensor) == HIGH) && (HBCheck == 0))
{
HBCount = HBCount + 1;
HBCheck = 1;
lcd.setCursor(14,0);
lcd.print(HBCount);
lcd.print(" ");
}
if((digitalRead(HBSensor) == LOW) && (HBCheck == 1))
{
HBCheck = 0;
}
if(TimeinSec == 10)
{
HBperMin = HBCount * 6;
HBStartCheck = 0;
lcd.setCursor(14,2);
lcd.print(HBperMin);
lcd.print(" ");
lcd.setCursor(0,3);
lcd.print("Press Button again.");
HBCount = 0;
TimeinSec = 0;
}
}
}
void timerIsr()
{
if(HBStartCheck == 1)
{
TimeinSec = TimeinSec + 1;
lcd.setCursor(14,1);
lcd.print(TimeinSec);
lcd.print(" ");
}
}
- In this code, I have used a TimerOne Library which creates an interrupt after every 1sec.
- On each interrupt, it executes timerIsr() function, in which I have placed a check that whenever this interrupt will call we will increment TimeinSec variable.
- So, when TimeinSec will become equal to 10 then I am simply multiplying it with 6 and updating it on the LCD.
- So, use the above code and get your Hex File from Arduino Software and update it in your Proteus Simulation.
Simulating Heart Rate Monitor
- Now run your Proteus Simulation and you will get something as shown in the below figure:
- Now click this HB button and it will start counting the HB as well as will count the Time in seconds.
- After ten seconds it will multiply the current heart rate with six and will give the Heart Beat Per Minute.
- Here's a final image of the result:
- You can change the value of Heart Beat from the variable resistor connected with Heart Beat Sensor.
- Let's change the value of variable resistance connected to Heart Beat sensor, and have a look at the results.
- You have to press the button again in order to get the value.
- Here's the screenshot of the results obtained:
- So, now the heart is beating a little faster and we have got 108 bpm.
- If you run this simulation then you will notice that the second is quite slow which I think is because of Proteus.
- I have tested this code on hardware and it worked perfectly fine, although you need to change heart beat sensor's values in coding.
- Here's the video in which I have explained the working of this Heart Rate Monitor Simulation in detail.
So, that was all about Heart Beat Monitor using Arduino in Proteus ISIS. I hope you have enjoyed it and will get something out of it. Have a good day. :)
C945 Library for Proteus
Hello friends, I hope you all are doing great. In today's tutorials, I am gonna share a new
C945 Library for Proteus. If you have searched for this transistor in Proteus, then you must have known that it's not available in Proteus. We have designed this transistor in Proteus and here's its library.
If you don't know much about this transistor then you should have a look at
Introduction to C945, in which I have explained in detail the basics of this transistor. Today, first of all, I will show you How to install this library and after that we will design a simple Proteus Simulation in which we will see How to simulate C945 in Proteus. You should also check this amazing list of
New Proteus Libraries for Engineering Students. So, let's get started with C945 Library for Proteus:
C945 Library for Proteus
- First of all, download this C945 Library for Proteus by clicking the below button:
C945 Library for Proteus
- You will get two files in it named as:
- TransistorsTEP.IDX
- TransistorsTEP.LIB
Note:
- Place these two files in the Library folder of your Proteus software.
- Now open you Proteus Software or restart it if its already open.
- In your Components Search box, make a search for C945 and you will get some results as shown in below figure:
- Now place this component in your Proteus work space and it will look something as shown in below figure:
- Here's our NPN transistor named as C945, its first pin is Emitter, second one is Collector and the third one is Base.
- Now let's have a look at C945 Simulation in Proteus.
C945 Simulation in Proteus
- I hope you have installed the C945 Library for Proteus Successfully.
- Now let's design a simple circuit to have a look at working of this transistor.
- You can download this simulation by clicking the above button but as always, I would suggest you to design it on your own.
- That way you can learn a lot.
- The C945 Simulation for Proteus is shown in below figure:
- I have used an opto-coupler (normally I use PC817 while designing it on hardware), which is getting a 5V signal and then I am sending that signal to the Base of C945.
- At Emitter of C945, I have connected the GND and Collector is connected to the Load.
- Here's the ON and OFF state of above circuit:
- Its quite a simple circuit and actually what we are doing is we are controlling a 12V load frm 5V signal, which normally comes from Microcontroller like Arduino or PIC Microcontroller.
- You can also assemble this circuit in hardware and can use it in your projects.
- Here's the video in which I have shown How to download this C945 Library for Proteus and also how to run C945 Proteus Simulation:
So, that was all about C945 Library for Proteus and also How to design a C945 Simulation in Proteus. I hope you have enjoyed it and can design it on your own. You can download the Library as well as this Simulation by clicking above download button. Thanks for reading. Take care !!! :)
DC Motor Control using XBee & Arduino in Proteus
Hello friends, I hope you all are doing great. In today's tutorial, we are gonna design a project named DC Motor Control using XBee & Arduino in Proteus ISIS. I have shared the complete code and have also explained it in detail. You can also download the complete working Proteus Simulation given at the end of this tutorial. In this project, I have designed two Proteus Simulations.
The first Simulation is of Remote control in which I have used a keypad. The second simulation contains our two DC Motors and I am controlling the direction of those DC Motors with my Remote Control. XBee Module is used for sending wireless data. The code will also work on hardware as I have tested it myself. So, let's get started with DC Motor Control using XBee & Arduino in Proteus ISIS:
DC Motor Control using XBee & Arduino in Proteus
- I have designed two Proteus Simulations for this project.
- The First Simulation is named as Remote Control while the second one is named as DC Motor Control.
- I am controlling the directions of these DC Motors from my Remote.
- So, let's first have a look at Remote section and then we will discuss the DC Motor Control.
- You can download both of these Proteus Simulations (explained below) and Arduino codes by clicking below button:
Download Proteus Simulation
Remote Control
- Here's the overall circuit for Remote Control designed in Proteus ISIS:
- As you can see in the above figure that we have Arduino UNO which is used as a microcontroller and then we have XBee module which is used for RF communication and finally we have Keypad for sending commands.
- You have to download this XBee Library for Proteus in order to use this XBee module in Proteus.
- You will also need to download Arduino Library for Proteus because Proteus doesn't have Arduino in it.
- The Serial Monitor is used to have a look at all the commands.
- Now next thing we need to do is, we need to write code for our Arduino UNO.
- So, copy the below code and Get your Hex File from Arduino Software.
#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 4; //three columns
char keys[ROWS][COLS] = {
{'7','8','9', '/'},
{'4','5','6','x'},
{'1','2','3','-'},
{'*','0','#','+'}
};
byte rowPins[ROWS] = {13, 12, 11, 10}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
int KeyCheck = 0;
void setup()
{
Serial.begin(9600);
}
void loop()
{
char key = keypad.getKey();
if (key)
{
if(key == '1'){KeyCheck = 1; Serial.print("1");}
if(key == '2'){KeyCheck = 1; Serial.print("2");}
if(key == '3'){KeyCheck = 1; Serial.print("3");}
if(key == '4'){KeyCheck = 1; Serial.print("4");}
if(key == '5'){KeyCheck = 1; Serial.print("5");}
if(key == '6'){KeyCheck = 1; Serial.print("6");}
if(KeyCheck == 0){Serial.print(key);}
KeyCheck = 0;
}
}
- The code is quite simple and doesn't need much explanation.
- First of all, I have initiated my Keypad and then I have started my Serial Port which is connected with XBee Module.
- In the Loop section, I am checking the key press and when any key is pressed our microcontroller sends a signal via XBee.
- Now let's have a look at the DC Motor Control Section.
DC Motor Control
- Here's the image of Proteus Simulation for DC Motor Control Section:
- We have already installed the XBee & Arduino Library for Proteus in the previous section.
- Here you need to install L298 Motor Driver Library for Proteus, which is not available in it.
- So here we have used two DC Motors, which are controlled with L298 Motor Driver.
- XBee is used to receive commands coming from Remote Control.
- Now use below code and get your hex file from Arduino Software:
int Motor1 = 7;
int Motor2 = 6;
int Motor3 = 5;
int Motor4 = 4;
int DataCheck = 0;
void setup()
{
Serial.begin(9600);
pinMode(Motor1, OUTPUT);
pinMode(Motor2, OUTPUT);
pinMode(Motor3, OUTPUT);
pinMode(Motor4, OUTPUT);
digitalWrite(Motor1, HIGH);
digitalWrite(Motor2, HIGH);
digitalWrite(Motor3, HIGH);
digitalWrite(Motor4, HIGH);
Serial.print("This Arduino Code & Proteus simulation is designed by:");
Serial.println();
Serial.println(" www.TheEngineeringProjects.com");
Serial.println();
Serial.println();
Serial.println();
}
void loop()
{
if(Serial.available())
{
char data = Serial.read();
Serial.print(data);
Serial.print(" ======== > ");
if(data == '1'){DataCheck = 1; digitalWrite(Motor2, LOW);digitalWrite(Motor1, HIGH); Serial.println("First Motor is moving in Clockwise Direction.");}
if(data == '2'){DataCheck = 1; digitalWrite(Motor1, LOW);digitalWrite(Motor2, HIGH); Serial.println("First Motor is moving in Anti-Clockwise Direction.");}
if(data == '3'){DataCheck = 1; digitalWrite(Motor1, LOW);digitalWrite(Motor2, LOW); Serial.println("First Motor is Stopped");}
if(data == '4'){DataCheck = 1; digitalWrite(Motor3, LOW);digitalWrite(Motor4, HIGH); Serial.println("Second Motor is moving in Clockwise Direction.");}
if(data == '5'){DataCheck = 1; digitalWrite(Motor4, LOW);digitalWrite(Motor3, HIGH); Serial.println("Second Motor is moving in Anti-Clockwise Direction.");}
if(data == '6'){DataCheck = 1; digitalWrite(Motor3, LOW);digitalWrite(Motor4, LOW); Serial.println("Second Motor is Stopped.");}
if(DataCheck == 0){Serial.println("Invalid Command. Please Try Again !!! ");}
Serial.println();
DataCheck = 0;
}
}
- In this code, I am receiving commands from my remote and then changing the direction of my DC Motors.
- When it will get '1', it will move the first motor in Clockwise Direction.
- When it will get '2', it will move the first motor in Anti-Clockwise Direction.
- When it will get '3', it will stop the first motor.
- When it will get '4', it will move the second motor in Anti-Clockwise Direction.
- When it will get '5', it will move the second motor in Clockwise Direction.
- When it will get '6', it will stop the second motor.
- It will say Invalid Commands on all other commands.
- Now let's have a look at its working & results.
Working & Results
- Now run both of your Simulations and if everything goes fine, then you will have something as shown in below figure:
- Now when you will press buttons from keypad then DC Motors will move accordingly.
- Here's an image where I have shown all the commands.
So, that's all for today. I hope you have enjoyed today's project in which we have designed DC Motor Control using XBee & Arduino in Proteus ISIS. Thanks for reading !!! :)
Real Time Security Control System using XBee and GSM
Hello everyone, I hope you all are doing great. In today's post, I am going to share a Final Year Project in detail, named as Real Time Security Control System using XBee and GSM. I will give you all the details so that you can easily design it on your own. I've given the Proteus Simulation to download below. In that zip file, you will get both the Arduino codes and Proteus Simulations.
I have divided this whole project design into four parts. If you got into any trouble in your project, then ask in comments and I will try my best to resolve them. So, today we are gonna have a look at the basics of this Security project. There are a lot of systems introduced in the market these days that are used to transfer sensor data from one node to another either wirelessly or through some wired connection. The proposed technique also works on this same principle. But a lot of modifications are intended to introduce in order to enhance this technique.
Real Time Security Control System
- You can download this Project by clicking the below button:
Real Time Security Control System using XBee and GSM
Now let's have a look at the project description:
Project Description
In this project, I have designed a real-time security system, which consists of two wireless nodes named as
So, first of all, let's have a look at these two nodes one by one. First, I am going to discuss Sensor Node:
Sensor Node
The sensor node is placed in that building which is needed to be secured. Sensor node consists of three different sensors and two modules used for security purposes named as:
- Sensors:
- Smoke Sensor: To detect Smoke.
- Flame Sensor: Used for Fire Detection.
- Temperature Sensor: Measuring Temperature of surroundings.
- Modules:
- GSM module: is used to deliver the notification message if any fault occurs in the system.
- GPS module: is used to locate the exact position of the fault that occurred.
Below two modules are used for controlling purposes:
- Modules:
- Arduino UNO: All these Sensors and modules are connected to Arduino UNO.
- XBee Module: To send sensors' data & GPS Location to Base Node.
Block Diagram for the Sensor Unit of Real Time Security Control System using XBee and GSM is shown in below figure:
Now let's have a look at the Base Unit of Real Time Security Control System using XBee and GSM.
Base Unit:
- The base node will be placed in the Control Department. It could be your security guard's room or the nearby police station.
- This node will receive the data from the sensor node via XBee module.
- So, in total it will have three modules on it which are:
- XBee Module: It is used to maintain wireless communication between the sensor node and base node.
- LCD 20x4: It is used to display real-time conditions like sensors' values & GPS Location.
- Arduino Mega 2560: It is used to control both of these modules.
- Here's the block diagram of Base Unit for Real Time Security Control System using XBee and GSM:
Components Selected
In the previous section, we have had a look at the basic Introduction of our Real Time Security Control System using
XBee and GSM. This section will elaborate on the selection of the components which is the most important factor before designing any project/product. This is basically a simulation based project so there is no hardware involved in this project. The proposed technique is designed in
Proteus ISIS. All of the components are taken from the Proteus library.
Flame Sensor
- The flame sensor is an electronic device usually used for fire detection purposes.
- It can be used in homes, industries, offices, schools etc.
- A certain threshold is adjusted while designing the algorithm.
- When the fire flames cross that particular threshold, the flame sensor will send a signal to Arduino which will send that signal through Xbee to Base Unit immediately.
- As soon as the signal will be received on the Base Unit, the alarm will turn ON and hence guards will come to know that this area has become dangerous now.
- Immediate precautions must be taken in this case.
- Flame Sensor is not available in Proteus so we have designed its library.
- You should download this Flame Sensor Library for Proteus.
Smoke Sensor
- A smoke sensor is used to detect a certain level of smoke within the desired region.
- It is usually used in homes and organizations for the detection of fire or internal burns.
- It is a low-cost and very sensitive sensor that also beeps if someone is smoking in its coverage area.
- This Smoke Sensor will detect any smoke in the area then it will warn the Arduino board which will, in turn, send a signal via XBee to Base Unit.
- Proteus software doesn't have a smoke sensor in it so you should download this Smoke Sensor Library for Proteus.
Temperature Sensor
- The temperature sensor is an electronic sensor used to estimate the temperature in the surroundings.
- The temperature range can be adjusted while designing its algorithm.
- When the temperature in the surroundings reaches the adjusted threshold, it generates a notification.
- Most of the time an alarm is attached to the temperature sensor. The alarm starts to beep when the desired temperature is reached. It can be used in homes, offices and organizations to maintain the temperature of a certain area according to the desired requirements.
- But in our project we want to send a signal to the base unit, so that's why this sensor will send a signal to the base unit.
XBee Module
- XBee is selected as a wireless module. The proposed technique consists of two XBee modules.
- One is attached to the base unit and the other is attached to the sensor unit.
- The data is transmitted by the sensor unit via XBee module.
- And the XBee module attached to the base unit receives that data from the sensor unit and sends it to the microcontroller to manipulate it.
- There are many wireless modules available in the market these days e.g. Radio Frequency (RF) module.
- Some of them are not used commonly due to their shorter ranges e.g. Bluetooth module.
- XBee module is far better as compared to the Bluetooth module and provides a larger coverage area in comparison to similar wireless modules.
- So, XBee is used in this project. XBee module is not available in Proteus so that's why you should download XBee Library for Proteus.
Arduino UNO
- The microcontroller plays a vital role in any project and is like a backbone of a particular project.
- Arduino UNO and Mega 2560 both are selected as a microcontroller.
- Arduino UNO is attached to the sensor unit and Arduino Mega 2560 is attached to the base unit.
- Arduino is an open-source device. Students can take online help in almost every task. Online source codes are also available for different tasks.
- So, a student can easily perform them with a proper understanding.
- Arduino boards are also not available in Proteus so you should download this Arduino Library for Proteus.
GPS Module
- GPS module is used to locate the exact location of the fault.
- GPS module will be attached to Sensor Unit, so if anything goes wrong then we can also get the GPS location via SMS.
- It will provide us the longitude and latitude of the fault that occurred on the sensor unit.
- So, now if any of these sensors goes wrong then you can easily get the location of your sensor node via SMS.
- Proteus doesn't have GPS Module in it so you should download this GPS Library for Proteus.
GSM Module
- GSM module is used for security purposes.
- If a fault occurs at any position within the network, a notification message will be generated and sent towards the base unit from the sensor unit.
- We can also generate a call using this GSM which will be a much better way.
- This GSM module will also send the location via SMS. We have received this location from GPS in the form of longitude and latitude.
- Proteus doesn't have GSM Module in it so you should download this GSM Library for Proteus.
So, these are all the components/modules, which I have used in this project. So, in the first part, have seen the basic Introduction of the project and then in the second section, we have had a detailed overview of all the modules used. So, now in the next section which is the third part I am gonna show you How to design these Proteus Simulations.
Proteus Simulation of Security Control System
In this section, we are gonna have a look at how to design these Proteus Simulations for Real Time Security Control System using XBee and GSM. As you know, I have used Arduino so we also need to discuss the code in order to run these simulations. So, first, we will design the proteus simulations and then we will write its code.
Proteus Simulations
- I have designed two simulations for this project.
- First of all, what you need to do is to download all those above Proteus Libraries and add them properly.
- I have given detailed instructions in each post about How to use them.
- After adding all these Libraries, now restart your Proteus software and design a circuit for the Sensor Unit.
- Proteus Simulation of Sensor Unit is shown in the below figure:
- As you can see in the above figure, the Sensor unit consists of three different sensor modules, which are:
- Temperature sensor.
- Smoke sensor.
- Flame sensor.
- In this unit, Arduino UNO is used as a microcontroller to get data from all the sensors and this data will be transmitted wirelessly towards the base unit for proper monitoring.
- XBee module is used for wireless communication between the sensor unit and the base unit.
- GPS module is interfaced in order to locate the exact position of the fault that occurred in the system.
- Now we are gonna design our second simulation for the Base Unit.
- The Proteus Simulation of Base Unit is shown in the below figure:
- The base unit is basically a monitoring end of the system.
- All the data obtained from the sensors is transmitted by the sensor unit towards the base unit.
- The base unit has an Arduino Mega 2560 as a micro-processing unit.
- Just like the sensor unit, an XBee module is also attached to the base unit in order to receive the data wirelessly sent by the base unit.
- There is an LCD on the base unit. It is used to visualize the obtained results. It displays different messages e.g. fault detection, sensors data etc.
- GSM module is used in the base unit to send the notification if a fault occurs in the system or the system is showing some abnormal behavior even for an instance.
- This GSM module will also send the location in SMS. You have to enter the number of recipients in the programming code.
Arduino Code of Security Control System
- When you download this project, you will get a .rar file and within that file, you will find two folders.
- One of them will have the Arduino Codes and the other one will have Proteus Simulations.
- I have already added all the hex files so you just need to run these simulations.
- If you got into any trouble then use our Contact Form and our team will help you out.
- You should also need to read How to Get the hex file from your Arduino Software.
Proteus Simulation Results
- Now coming towards the last section of this project, now I am gonna show you the results of these simulations.
- So, I have run both of these Simulations and here's the first look at Base Unit:
- The LCD on the base unit is displaying the title of our project.
- Virtual Terminal is connected with Arduino so that we could also have a look at incoming or outgoing data.
- After that first of all, Arduino will communicate with the GSM module and will set its settings, as shown in the below figure:
- Now our GSM module has configured, so the next screen of the base unit is shown below:
- As you can see in the above figure that LCD is displaying the values of all three sensors and because all are normal that's why the Alarm is OFF.
- The temp value is 0 because we haven't yet received the data from the sensor unit.
- Now let's run our Sensor Unit and make our Fire Sensor HIGH, then you will get results as shown in the below figure:
- The alarm is also ON in the above figure and SMS has also been sent which is shown in Virtual Terminal.
- In case, when both fire and smoke are detected, LCD will display smoke as well as fire detection messages.
- SMS will also be sent as you can see in the Virtual Terminal. GSM has sent the message indicating Fire Detected and GPS Location.
- Base Unit Proteus Simulation is shown in the below figure:
- So, whenever you change any of these sensors' values in the Sensor Unit then the respective value will change in the Base Unit.
So, that was all about Real Time Security Control System using XBee and GSM. If you got into any trouble then ask in the comments and I will help you out. Thanks for reading, take care and have fun !!! :)