Interfacing Arduino with HC-05

Hello friends, i hope you all are fine and enjoying. Today i am going to share a new tutorial which is Interfacing Arduino with HC05 Bluetooth module. First of all lets have a little introduction about HC-05 Bluetooth module. HC-05 is a bluetooth module, which was designed for wireless data communication. This little module is capable of both sending and receiving data but it performs only one thing at a time, which means at a particular time it can only send or receive data but can't do the both tasks.

In order to send or to receive data, you have to make one module as a master and the other module as a slave. If both the modules are acting as master then, data will not transmit and if both the modules are acting as a slave then, again data will not transmit or receive. The hardware of Bluetooth module contains a large no of features. For example it is much sensitive and it is sensitive up to -80dBm and it catches a Bluetooth signal even from far away. If you wish to transmit data through it then, it also have much power to transmit data to a wider range. You can image its transmitting power from the digits that it has transmitting power of +4dBm. This module operates on a low voltages, that's why the power rating of this module is very low. The hardware of the module comes with a integrated antenna and also its hardware contains edged pins. These edged pins gives us the ease that it becomes very easy to plug in or plug out the wires. and also if you are going to use it within a circuit then, it becomes very easy to connect the cable with module. Above was a little introduction about Bluetooth module and its features. now lets move to the basic theme of our project, which is to do interfacing between arduino and HC-05.

Note:

  • If you have HC-06 or any other module in HC series then you don't need to get worried as they all work quite same. So you can also follow this tutorial for other HC series bluetooth modules.

Pin Configuration of HC-05

HC-05 Bluetooth module has total 6 pins. A simple HC-05  Bluetooth module is shown in the image given below and you can also see its pin configuration from this image. The pin configuration and the purpose of each pin is listed below as:

  1. They pin#1 is abbreviated a KEY pin. The function of this key is to show paired devices. In HC-05 module this pin is used to perform the module in AT mode.
  2. Pin#2 of HC-05  module is named as VCC pin. This module requires 3.3 volts to operate. If you will connect it directly with 5 volts then, this module will burn out.
  3. Pin#3 of this module is named as GND. At this pin the common ground of the circuit is provided.
  4. pin#4 is named as TXD. This pin is used when you have to transmit data to some external device. Asynchronous data transfer is performed by this module.
  5. pin#5 is named as RXD. This pin is used when the module have to receive wireless data from some external source. Asynchronous data is received through this module.
  6. The last pin of the module which is in fact pin#6 of the module and it is named as STATUS pin. The basic function of this pin is to check the status of the Bluetooth module. If the module is connected to some other device then, output of the system becomes HIGH and if the connection of Bluetooth drops then, this module generates a output pulse.

Interfacing with Arduino

So, now let's start with interfacing Arduino with HC05 bluetooth module. Its quite easy to interface as it works on Serial protocol. As mentioned above it has two pins named as TX and RX through which we can send or receive the data. Moreover, it works exactly the same as any mobile's bluetooth, you can connect your mobile with any device and can share data between these devices, similarly you can share the data with this device as well.
  • First of all, connect your HC05 bluetooth module with Arduino as shown in the below figure.
  • In the above figure, the connections are quite easy , we have provided power to the bluetooth module from Arduino and also connected TX pin of bluetooth module with RX pin of Arduino and RX pin of bluetooth module with TX of Arduino.
  • Now we are done with the connections so next part is to upload the code into Arduino.

Code for interfacing HC-05 with Arduino

Now upload the below code into your Arduino and you are ready to get the first data from your Bluetooth module.

Applications of HC-05 Module

  • The biggest application is that it is used to transmit or receive data wirelessly.
  • You can play your favorite sound tracks through bluetooth in your car using this module.
  • The modern Android phones contains a wireless GPS option. IN fact this module is being used in that phones and it works to seek the bluetooth location.
  • This module makes you able to chat with some android phone using Bluetooth.
Alright friends, that all for today. If you have any question, fell free to ask. Till next tutorial Take Care!!! :)

Introduction to Arduino Esplora

Hi Guys! Hope you’re well today. I welcome you on board. In this post today, I’ll walk you through the Introduction to Arduino Esplora. Looking like a videogame controller, the Arduino Esplora is an electrical device that contains an Arduino Leonardo board (microcontroller) and a number of outputs and inputs. There are a colored LED and a buzzer as outputs. And there is a light sensor, four buttons, a joystick, a microphone, an accelerometer, and a temperature sensor as inputs. In other words, it is just like another Arduino Board with integrated actuators and sensors. Just stay with me for a little while, as I’m going to document the complete Introduction to Arduino Esplora covering pinout, working, pin description, how it’s different than other Arduino boards, and applications. Let’s jump right in.

Introduction to Arduino Esplora

  • Introduced by Arduino.cc, the Arduino Esplora is an electrical device that is based on the Arduino Leonardo board and contains integrated actuators and sensors.
  • Similar to the Arduino Leonardo, the Esplora board is incorporated with an Atmega32U4 AVR microcontroller that carries a 16 MHz crystal oscillator.
  • The Esplora comes with onboard light and sound outputs, and many input sensors, like a temperature sensor, an accelerometer, a joystick, a slider, a light sensor, and a microphone.
  • It also contains two Tinkerkit input and output connectors to enhance its capabilities and a socket used for the LCD screen.
  • Arduino Boards like Arduino Esplora are developed to provide both hardware and software platforms in one place. You can control the board with Arduino software as you like better. Plug and play with the device without getting hands-on experience in electronics.
  • It can mimic a keyboard or mouse that gives you the ability to use it with any 3D software.
  • Arduino Esplora board contains two actuators and 11 inputs. It carries a light sensor, an accelerometer, a multiplexer, and a mic, an RGB LED, and a buzzer.
  • This board contains all built-in sensors and actuators, the reason it’s easy to program and easy to handle through Arduino IDE software.
  • The Arduino Esplora is a great package for beginners, with built-in features, giving you the ability to plug and play with the device and get desired results on the fly.
  • This board is not compatible with the Arduino Shields, but you can connect this device with the external LCD module.
  • To connect the other modules, this device carries two output and two input ports. These ports are compatible with the signal, voltage, and ground pins and are known as 2 pin TinkerKit ports.
  • The Arduino Esplora is an ideal pick for creating a remote control device for your electrical project. You can develop external communication with your project without any hassle.
  • A micro USB cable is attached to the board, and it carries almost everything to get you started without having to combine and assemble anything from outside.
  • Information is extracted from the inputs and is used to write the program in the software which is then used to control the outputs on the board or your computer just like a remote controller.
  • Arduino Esplora is compatible with the Arduino IDE (Integrated Development Environment) like other boards.
  • Plus, you can also run this device with Arduino Web Editor that is hosted online and is incorporated with the latest support and features for all boards. Read this guide on how to use this browser and upload your sketches online.
  • And if you want to use this board offline, you need to install the Arduino IDE desktop version.
  • This board contains everything built-in to get you started. You need to simply connect the board with the computer through USB cable and start your work.
  • The reset pushbutton is located at the upper left corner that is used to restart the board.
Esplora carries four LEDs as follows:
  • ON LED is colored green that identifies if the board is getting a power supply
  • Accessible through pin 13, L is a yellow LED that is directly connected to the microcontroller.
  • RX and TX are yellow LEDs that determines the information received or transmitted through USB communication.

Arduino Esplora Features

The following are the sensors available on the Esplora board:
  • Joystick
  • push-button of the joystick
  • microphone
  • light sensor
  • 2 TinkerKit input connectors
  • temperature sensor
  • 4 separate push-buttons
  • Accelerometer
The following are the actuators present on the board:
  • RGB LED
  • Buzzer
  • 2 TinkerKit connectors

Arduino Esplora Set up with Windows

  • First, you require a standard software developed by Arduino.cc known as Arduino IDE. This software is used to program and control the board through your system.
  • Now connect the board with the computer through micro USB that is used to transfer the program from the computer system to the board.
  • As you connect the cable the green power LED (labeled ON) will turn on and then the yellow LED will start glowing that is marked ‘L’. The yellow LED will go blinking on and off after 8 seconds indicating your board is connected with the computer.
  • When you connect the board, the Windows will automatically start its driver installation process. It the installation process doesn’t start automatically, go to the windows device manager then (Start > Control Panel > Hardware) and go to the Arduino Esplora listing. Right-click this listing and pick Update driver.
  •  At the next popped up window, select "Browse my computer for driver software", and click Next
  • Now click the ‘Browse’ option. It will return another window: find the folder with the Arduino software that you have installed. Choose the drivers folder and click OK, then click the ‘Next’ button
  • You will get a notification that reads, “the board has not passed Windows Logo testing.” Click on the option “Continue Anyway.”
  • After a while, a window will open that reads “Windows has finished installing the driver software for this device” Now click the ‘close’ button.
These instructions are for the system having Windows 7 operating system. If you have a MAC or Linux then read this post on how to connect Arduino Esplora with the system. All pictures placed here are from Arduino.cc

Applications

The following are the applications of Arduino Esplora.
  • Used in Arduino Wifi remote controller
  • Used in robotics and electronics
  • Incorporated to identify free-fall detection using an accelerometer
  • Employed to emulate mouse or keyboard
That’s all for today. I hope you find this read helpful. If you have any questions, you can approach me in the section below, I’d love to help you the best way I can. Feel free to keep us updated with your valuable feedback and suggestions, they help us generate quality work customized to your exact needs and requirements. Thank you for reading the article.

Analog Vibration Sensor Library for Proteus

Hi Guys! Glad to see you here. I welcome you on board. In this post today, I’ll be discussing Analog Vibration Sensor Library for Proteus. I have already shared the digital Vibration Sensor Library for Proteus, you should check that as well. I’ve been adding brand new libraries for proteus covering sensors and Arduino boards. I’ve recently discussed Analog PIR Sensor Library for Proteus and Analog Flex Sensor Library for Proteus. You may be stuck into thinking I’ve previously shared those libraries but they were libraries covering digital PIR and digital Flex sensors, here we discussed analog libraries for both PIR and Flex sensors. Before I pen down how to download and simulate Analog Vibration Sensor Library for Proteus, let’s discuss what is vibration sensor first. A vibration sensor is mainly used to monitor the vibration of industrial machines. It is also called a piezoelectric that plays a crucial role in the proper working of industrial machinery. If vibration values increase from the industry standards, they can severely affect the overall working of the machine and in the worst case can put the machine at a grinding halt. To avoid this, we use vibration sensors that give the warning signal if vibration exceeds the desired values. These sensors are attached to the alarm system that produces audible sound indicating the machine is in danger, thus results in the deactivation of the entire machine. Vibration sensors are based on the piezoelectric effect to observe the small changes in pressure, acceleration, force, and temperature. These changes are converted into an electrical signal. Air fragrance can also be monitored by vibration sensors. They monitor the air fragrance and detect its capacitance and quality. I hope you’ve got a clear idea about the vibration sensor now we’ll download and run the Analog Vibration Library for Proteus. I’ve added both a simple simulation of the vibration sensor and a simulation with the Arduino Board. Let’s get started.

Analog Vibration Sensor Library for Proteus

  • Click the link given below to download the Analog Vibration Sensor Library for Proteus.
  • As you download this file, it returns further two files named Proteus Library and Proteus Simulations.
Analog Vibration Sensor Library for Proteus Click the Proteus Library folder that contains four files as follow:
  • VibrationSensorAnalogTEP.HEX
  • VibrationSensorTEP.HEX
  • VibrationSensorTEP.IDX
  • VibrationSensorTEP
Now copy all files given above and place them into the library folder of your Proteus software.  
  • In case you don’t have proteus software in your system, you can read this post covering how to download and install proteus software.
  • After adding the above files, start the proteus software and if it’s already running, close the software and restart again.
  • Now click the ‘P’ button to search for the ‘analog vibration sensor’ libraries that you’ve recently placed.
  • As you search it, it will return the figure as given below:
  • Select the sensor and click OK. Now you’ll see your cursor has now started blinking with the sensor that shows you can place your analog vibration sensor anywhere in the workspace available on the proteus software.
  • As you place your sensor, it will show the figure below:
Now we'll look into the analog vibration sensor pinout.

Vibration Sensor Pinout

The vibration analog sensor contains 4 pins as follows.
  • OUT = First is an OUT pin that is connected with a voltmeter that represents the output voltage against the variable resistor attached to the TestPin.
  • GND = Second is a ground pin that is attached to ground voltage.
  • Vcc = Third is the voltage supply pin that gets 5V to power the vibration sensor.
  • TestPin = Forth is the TestPin. This pin is only available in the proteus simulation. You don’t find it on the analog vibration sensor in real. When this pin is LOW, it shows no vibration and when this pin is HIGH it represents the vibration on the machine.

Adding HEX File

Now we’ll add the HEX file to run our vibration sensor simulation. Right-click the sensor and reach the ‘edit properties’ option and double-click the sensor it will pop up the same edit properties panel. Browse the Sensor’s HEX file option and look for the HEX file. You can find the HEX file in the library folder. Same HEX file that we have recently placed in the library folder. Select this HEX file and click OK. Now we’ll attach a simple circuit with the vibration sensor to run our simulation.

LC Circuit

  • We need to design a simple circuit to run this sensor in the proteus workspace. We’ve designed and attached the LC circuit with the OUT pin of the vibration sensor.
  • And TestPin is connected with a variable resistor. Both variable resistance and voltage we get on the voltmeter attached with the OUT pin are inversely proportional to each other.
  • When variable resistance is set to the maximum value the voltage on the voltmeter will be zero and when variable resistance is set to the minimum value (zero) it shows the maximum voltage i.e. 4.98V on the voltmeter.
When you run the simulation it will return the result below:
  • You can see the voltage appearing on the left vibration sensor placed on the proteus workspace is 2.56V because TestPin attached with the variable resistor is set to almost half of the resistance value.
  • I told you earlier I’ll show you both simple simulation and the vibration sensor simulation with the Arduino Board. If you are interested in the Arduino Library for Proteus, check this post where I have added six Arduino Boards Libraries for Proteus.
Now connect the voltage on the OUT pin with the analog pin i.e. A0 of the Arduino Board: When variable resistance is maximum the voltage on the voltmeter will be zero and its equivalent analog value across LCD attached with the Arduino Board will be 0019 and when the resistance on the variable resistor is minimum the voltage will be 4.98V and its equivalent analog value on the LCD will be 1019. This is it. I hope, you’ve got a clear insight into how to download Analog Vibration Sensor Library for Proteus. If you have any questions, you can ask me in the comment section below. I’d love to help you with the best of my expertise. Feel free to pop your suggestions about the libraries you think should be included in the proteus library database, I’ll design and add them to the database. Thank you for reading this article.

Analog Flex Sensor Library for Proteus

Hi Friends! Happy to see you here. Thank you for viewing this read. Hope you’re well today. In this post, I’m going to discuss the Analog Flex Sensor Library for Proteus. You should also have a look at Digital Flex Sensor Library for Proteus. I’ve been adding them over the last few days intending to design and share brand new libraries that are not a part of the proteus library database already. I’m adding both simple simulation and simulation with the Arduino board to help you better understand these libraries with microcontrollers and Arduino devices. Before I go further and walk you through on how to download and simulate Analog Flex Sensor Library for Proteus, let’s get to know what’s Flex sensor first. Simply put, a flex sensor is used to monitor the value of bend. It is also known as a bend sensor that is mainly used in robot whisker sensors, door sensors, stuffed animal toys, and Nintendo power glove. The flex sensor is coupled with the exterior where the rotation of this exterior is directly related to the change in the sensor resistance. Carbon or plastic material is used for the construction of these sensors where deflection value is sensitive to varying resistance. In terms of varying resistance and size, these sensors are categorized into two main types i.e. 4.5-inch bend sensor and 2.2-inch bend sensor. I hope you’ve got a brief insight into what is flex sensor and why it is used for. You can also sneak into the Analog PIR Sensor Library for Proteus that I’ve shared previously. And if you don’t have proteus software installed in your system, check this post on how to download and install proteus software. Without further ado, let’s jump right into the Analog Flex Sensor Library for Proteus. Continue reading.

Analog Flex Sensor Library for Proteus

First of all, click the link given below to download the analog flex library for proteus. Analog Flex Sensor Library for Proteus As you download this file, it contains two folders named Proteus Library and Proteus Simulation. Click the Proteus Library, it will open up four files that read:
  • FlexSensorAnalogTEP.HEX
  • FlexSensorTEP.HEX
  • FlexSensorTEP.IDX
  • FlexSensorTEP
Copy and place these four files into the proteus library folder. Now, click the ‘P’ button as below and write ‘Flex sensor analog’ in the search bar. As you do this, it will return the file as mentioned below.
  • Select this file and click “OK” As you click OK, your cursor will start blinking with the flex sensor, indicating you can place this sensor anywhere you want on the proteus workspace.
When you place this sensor on the proteus workspace, it will appear as follows: This is how flex sensor appears on proteus workspace.

Flex Sensor Pinout

Flex sensor contains four pins as follow:
  • G = first is the ground pin that you’ll connect to the ground voltage.
  • O = second is the OUT pin that gives the Flex sensor value demonstrating if the sensor has identified the value of bend.
  • V = third is the voltage supply pin that receives 5V to power the sensor.
  • TestPin = forth is TestPin that we require in Proteus simulation only. This pin is not included in the sensor in real. We need to add this pin for identifying the value of bend. When this Pin is HIGH it gives the value of bend and when it turns LOW it gives no value of bend.

Adding HEX File

Now we’ll add the HEX file in the Flex sensor to run our simulation. You can find FlexSensorAnalogTEP.HEX file in the library folder of your Proteus library folder. Recall, we’ve already placed this file in the library folder of proteus.
  • To add this file, right-click on the sensor and look for ‘edit properties.’
  • You can also double click the flex sensor to reach the ‘edit properties’ panel.
Now search for the HEX file that you have placed in the proteus library folder. Add this file and click ‘OK’ … Before you run this simulation we need to design and connect the LC circuit with the Flex sensor. We’ll add this circuit purposely. Why? You’ll get to know later in this post. Connect the Output ‘O’ pin with the LC circuit through voltmeter where we get the output voltage following the variable resistor attached with the test pin.
  • Both output voltage across voltmeter and variable resistance are inversely proportional to each other. When resistance is maximum, the voltage on the voltmeter is zero, thus indicating no amount of bend.
And when resistance is zero the voltage appearing across a voltmeter will be 4.98V, confirming the value of bend as an output voltage on the flex sensor. You may be wondering why we add this LC circuit with the flex sensor? We need to include this circuit because proteus gives a peak to peak value that we have to convert into the Vrms value. That LC circuit serves this purpose. You’ve done it. You have designed a simple simulation of a flex sensor library for proteus. We have added this library the very first time, as you won’t find this library in the proteus library database before. I’ve mentioned at the start of the article, I’ll share both simple simulation and simulation with Arduino Board.

Analog Flex Sensor With Arduino UNO

Now we attach the Arduino board with the flex sensor. To do this, we connect the voltage appearing across the voltmeter with the analog input pin of the Arduino board. As you run this simulation it will return the result below. Again, when resistance is maximum, the voltage is zero, that gives equivalent analog value on the LCD connected with the Arduino board, that value is 0019. And when resistance is zero, the voltage will be 4.98V and its equivalent analog value on the LCD will appear 1019. That’s all for today. Hope you find this read helpful. If you face any difficulty in the simulation of Analog Flex Library for Proteus, you can leave your query in the section below, I’ll help you the best way I can. Feel free to leave your suggestions of the libraries that are not available in the proteus library database, I’ll design and share respective libraries with both simple simulation and simulation with Arduino boards. Thank you for reading this post.

Soil Moisture Sensor Library For Proteus

Update: We have created a new version of this library, which you can check here: Soil Moisture Sensor Library for Proteus V2.0.

Hi Friends! Hope you’re well today. I welcome you on board. In this tutorial, I’ll be discussing the Soil Moisture Sensor Library for Proteus. You won't find Soil Moisture Sensor Library in Proteus and we’re going to share its Proteus Library very first time. I have previously shared many Proteus Libraries for digital and analog sensors and today I’m discussing something new. Excited to get a hold of the Soil Moisture Sensor Library? Me too. In the upcoming days, I’ll keep sharing different libraries related to sensors. If you’re curious to sneak into the nitty-gritty of sensors not available in the Proteus library already, pop your suggestion in the comment section below. I’ll try my best to comply with your suggestions and walk you through something brand new.

Soil moisture sensors are used to measure the water content in the soil. They use capacitance to measure the dielectric permittivity of the soil which defines the function of the water content. Before further ado, let’s dive in and have a look at How to download and simulate Soil Moisture Sensor Library for Proteus:

Where To Buy?
No.ComponentsDistributorLink To Buy
1LCD 20x4AmazonBuy Now
2Arduino UnoAmazonBuy Now

Soil Moisture Sensor Library For Proteus

  • You can download the Proteus Library zip file of Soil Moisture Sensor Library by clicking the button below.
Download Proteus Library Files
  • It’s a .zip file that contains two folders inside i.e. Proteus Library & Proteus Simulations.
  • The real fun starts right here right away.
  • Open proteus library folder that contains three files named:
    • SoilMoistureSensorTEP.IDX
    • SoilMoistureSensorTEP.LIB
    • SoilMoistureSensorTEP.HEX
  • Copy and paste these three files in the Library folder of your Proteus software:
  • Now, we need to run the Proteus ISIS software and don't forget to restart, if it's already open.
  • Look for the Soil Moisture in the component’s search box as shown below.
  • After installing the Library successfully, you’ll get similar results as below:
  • You can see in the figure above we have one Soil Moisture Sensor.
  • Now simply place this Soil Moisture Sensor in your Proteus workspace, as mentioned below:
  • You can see in the figure above, I have placed one Soil Moisture Sensor inside the Proteus workspace.
  • This sensor carries 4 pins in total, named:
  • V (Vcc): We’ll provide +5V here.
  • G (GND): We’ll provide ground here.
  • Ao (Out): It’s an analog output signal from the sensor.
  • TestPin: It is used for simulation purposes only. Soil Moisture Sensor doesn’t contain this pin in real.

Adding Sensor’s Hex File

  • After this drill, we’ll add the Sensor’s Hex File, which we have downloaded and placed in the Library folder.
  • To do that, right-click on your Soil Moisture Sensor and then click on “Edit Properties” as below:
  • Or you can double click the Soil Moisture Sensor, it will pop the window below:
  • Click on the Browse button and add SoilMoistureSensorTEP.HEX file available in the Proteus Library section as shown in the figure below:
  • After adding the Sensor’s Hex File, click on the ‘OK’ button to close the ‘Edit Properties’ Panel.
  • Our Soil Moisture Sensor is now ready to simulate in our Proteus ISIS.
  • We’ll design a small circuit to thoroughly understand the working of this Soil Moisture Sensor.

Proteus Simulation of Soil Moisture Sensor

  • Here, I’m designing a simple circuit. I’ve attached a variable resistor with the Test Pin & added a Voltmeter at the Output pin, as shown in the figure below:
  • This resister defines the soil water content in the proteus simulation.
  • When the resistance is maximum at the test pin, the circuit shows zero volts across the voltmeter, which means the sensor is either in the dry ground or taken out of the ground i.e. giving zero moisture value of the water content.
  • And when resistance is zero, the circuit will show the maximum voltage across the voltmeter which indicates the sensor is inserted in a wet ground i.e. water contents in the soil are too high.
  • This is important. We have attached the output pin with an LC filter. This filter is not required in real hardware implementation.
  • We are using it in Proteus Simulation only as Proteus gives the peak-to-peak value and we have to convert that PP value into Vrms.
  • If you are working on a real sensor then you don’t need to add this LC circuit.
  • Now, let’s run this Proteus Simulation and if you have done everything as mentioned, it will show the result mentioned in the figure above.

Simulation of Soil Moisture Sensor with Arduino

Now, let's interface this sensor with a microcontroller.
  • We have attached the output of the sensor appearing across the voltmeter with the A0 pin of the microcontroller as below.

You can see we get the analog value 1019 when the voltage across the voltmeter is 4.98V

This is it. I hope you find this tutorial helpful. This will help engineering students in simulating their semester projects in proteus. In the next tutorials, I’ll be sharing and adding more libraries of sensors. You’re most welcome to share your suggestions with the sensors you want me to libraries of. If you’re unsure or have any questions, you can ask me in the section below. I’ll help the best way I can. Thank you for reading this article.

IR Proximity Sensor Library for Proteus

Hello friends, I hope you all are doing great. In today's tutorial, I am going to share a new IR Proximity Sensor Library for Proteus. Proximity Sensors are not available in Proteus and we are sharing its Proteus library for the first time. So far, I have only shared Proteus Libraries of digital sensors but today I am sharing an analog sensor, so too excited about it. In the next few days, I will keep on sharing Proteus Libraries of different analog sensors, so if you want any sensor in Proteus, then let me know in the comments. IR Proximity Sensors are used to detect hurdles/obstacles placed in their path. They are normally used on robots for path navigation and obstacle avoidance. So, let's have a look at How to download and simulate IR Proximity Sensor Library for Proteus: Note:

IR Proximity Sensor Library for Proteus

  • First of all, download this IR Proximity Sensor Library for Proteus, by clicking the below button:
IR Proximity Sensor Library for Proteus
  • It's a .zip file, which will have two folders in it i.e. Proteus Library & Proteus Simulation.
  • Open Proteus Library Folder, it will have 3 files, named as:
    • IRProximitySensorTEP.IDX
    • IRProximitySensorTEP.LIB
    • IRProximitySensorTEP.HEX
  • Place these three files in the Library folder of your Proteus software.
Note:
  • After adding these library files, open your Proteus ISIS software, or restart it if it's already open.
  • In the component's search box, make a search for IR Proximity.
  • If you have installed the Library successfully, then you will get similar results, as shown in the below figure:
  • As you can see in the above figure that we have two IR Proximity sensors.
  • When it comes to functionality, both sensors are exactly the same, they just have different colors.
  • Now simply place these IR Proximity Sensors in your Proteus workspace, as shown in the below figure:
  • As you can see in the above figure, I have placed both of these IR Proximity sensors in my Proteus workspace.
  • This sensor has 4 pins in total, which are:
    • V ( Vcc ): We need to provide +5V here.
    • G ( Gnd ): We need to provide Ground here.
    • O ( Out ): It's an analog output signal from the sensor.
    • TestPin: It's solely for simulation purposes, we don't have this pin in a real IR sensor.
  • As we can't actually place an obstacle in front of this sensor in Proteus simulation, that's why I have used this TestPin.
  • If we change the value of TestPin from 0V to 5V then that means the obstacle is coming close.

Adding Sensor's Hex File

  • Lastly, we need to add the Sensor's Hex File, which we have downloaded and placed in the Library folder.
  • So, in order to do that, right-click on your IR sensor and then click on Edit Properties.
  • You can also open the Properties Panel by double-clicking on the sensor.
  • Here, in the Properties Panel, you will find Sensor's Hex File Section.
  • Click on the Browse button and add IRProximitySensorTEP.HEX file here, as shown in the below figure:
  • After adding the Sensor's Hex File, click on the OK button to close the Properties Panel.
  • Our IR Proximity Sensor is now ready to simulate in Proteus ISIS.
  • Let's design a small circuit, in order to understand the working of this IR Proximity Sensor.

Proteus Simulation of IR Proximity Sensor

  • First of all, let's design a simple circuit, where I am attaching a variable resistor with the Test Pin & I am adding a Voltmeter at the Output pin, as shown in the below figure:
  • Using this variable resistance, we can change the voltage on Test Pin.
    • If TestPin has 0V, means we don't have any obstacle in front of the sensor.
    • If TestPin has 5V, implies that something's placed right in front of the sensor.
  • So, let's have a look at How the output value will change when we change the voltage on TestPin.
  • At the Output Pin, I have placed an LC filter, which is also not required in real hardware implementation.
  • But I have to use this filter in Proteus Simulation, as Proteus provides the Peak to Peak value and we need to convert that value into Vrms.
  • So, if you are working on a real sensor then you don't need to add this inductor or capacitor.
  • Now, let's run this Proteus Simulation and if you have done everything correctly, then you will get similar results:
  • I have shown three different scenarios in the above figure:
    • In the first image, the variable resistor is at 100%, thus providing 0V at TestPin. That's why we got 0V at Output and hence no obstacle detected.
    • In the second image, the variable resistor is around 50%, thus providing around 2.5V at TestPin. So, we are getting around 2.5V at Output and hence obstacle detected in close range.
    • In the third image, the variable resistor is around 0%, thus providing around 5V at TestPin. So, we are getting around 5V at Output and hence obstacle's just in front of the sensor.
  • I have placed this simulation in the above zip file, so play with it and don't forget to add the Sensor's Hex File.
So, that was all for today. I hope this IR Proximity Sensor Library will help engineering students in simulating their course projects. I will interface this IR sensor with Arduino and other Microcontrollers and will share their simulations. If you have any issues, then ask in the comments and I will help you out.

Introduction to Arduino Zero

Hello friends, I hope you are all fine will be doing something interesting in your life. In today's tutorial, we are gonna have a look at detailed Introduction to Arduino Zero. Arduino Zero is a Microcontroller device. It is a 32-bit extension of UNO series. Its main features are Atmel Embedded Debugger (EDBG), it provides a full debug interface without additional hardware. This board provides a platform of new inventory projects in smart IoT devices, high technology automation, robotics and much more. As, Electronic devices coming in our life, they have become cheaper and performing more functions then there predecessor. The microcontroller was introduced in the industry to make our task easy in electronic devices and projects. Arduino Zero is a valuable addition in the electronics industry. It providing the improvement in Arduino role in our projects. In today's I will explain about Its pinout, projects, working, protocol, etc. So let's started with Introduction to Arduino Zero.

Introduction to Arduino Zero

  • Arduino Zero is a microcontroller board, based on Atmel SAMD21G18U ARM CORTEX MO+CPU. It is simply a 32 bit extension of Arduino UNO series.
  • It has 20 input-output pins (10 can be used PWM output), it also has six analog inputs, 2 UARTs, 48 MHZ clocks, 1 digital to analog converter (DAC), one SPI reader, one TWI and reset button.
  • One of the most important functions of it is that (EDGB), Which provide full debugging without any external hardware. EDGB also support a virtual com port that can be used for boat loader programming.
  • It allows the designer to control electronic devices in a comprehensive way. AC to DC adopter can also be used to power the board.
  • Arduino Zero boards are quite similar to other boards in the Arduino family in terms of use and functionality.
  • It can operate on external supply 6 to 20 volts. But if we supply below six volts it becomes unstable and if the voltage is greater then 12, the voltage regulator is overheating and may damage the board.
Now, let's discuss the pinout of Arduino Zero PINOUT:

Arduino Zero PINOUT & Description

There are main twenty pinouts of Arduino Zero, let's discuss which are most important and mostly used.
No.  Pin Name  Description
01 SCL SCL is a clock line. It uses to synchronized data on a protocol which it uses. It works on the I2C protocol.
02 SDA SDA is a line at which data is transferred by the serial way.
03 AREF AREF stand for Analogue reference. It used to supply Arduino reference voltage.
04 GND This pin is used for ground purposes.
05 TX/D1 This pin used for transmission of data.
06 RX/D0 This pin is used for receiving data
07 AD0 It used for analog to digital conversion.
08  IOREF This pin is used for input, output voltage reference purpose. For example, an Arduino would supply 5 v to this pin, but a due would supply 3.3 v. Sending a signal to this pin does nothing.
09 3.3 V  This pin is used for 3.3 v supply to Arduino.
10 REST This pin is used for resting of Arduino.
11 VUSB This is a USB port.
12 VIN At this pin, we supply input voltage to Arduino.
13 AO/DAC This is used for analog to digital conversion of the signal.
14 GND This is two ground in Arduino Zero, this one is second
15 PROGRAMMING PORT This pin is used for the feeding of programming to Arduino.
16 SUPPLY CONNECTOR This pin is used for 2.1 mm supply connector.
17  MCU  This pin is used to interface other microcontrollers with Arduino.
  [otw_is sidebar=otw-sidebar-5] Now, Let's discuss the specifications of Arduino Zero.

Features & Specifications of Arduino Zero

These are some specification of Arduino Zero:
  • Arduino Zero is a SAMD 21 Cortex M0+ 32bit low power ARM microcontroller.
  • Its board Power Supply (usb.in) is 5 volts.
  • DC current we can apply at the 3.3v pin is 600 mA.
  • DC current for the 5-volt pin is 600mA.
  • Its circuit operating Voltage is 3.3V.
  • Total digital input and output pins are 22.
  • Its PWM Pins  are 12 (0, 1, 2, 3, 4, 5, 6, 7, 8, 10, A3 - or 18 -, A4 -or 19).
  • It's flash memory is 256 KB.
  • It has flash memory for boot-loader is 8 kb.
  • It has SRAM of  32 KB.
  • Its Clock Speed is 32.768 kHz (RTC), 48 MHz.
  • Its supported battery is Li-Po single cell, 3.7 V, 700 mAh minimum.
  • It's Analog Input Pins are  6, 12-bit ADC channels
  • It's Analog Output Pins are 1 to 10-bit DAC.
  • There is no use of EEPROM.
  •  Its LED BUILTIN is at pin no 13.
For a better understanding of Arduino Zero, we discuss its use in project By an example.

Zero Drive

Lets discuss project of Arduino Zero.
  • Zero Driver is basically an Arduino Zero compatible dual motor driver board for mechatronics engineering projects and different types of industrial robots.
  • In robotic projects required two board, one is a microcontroller and other is a separate driver for a motor. Zero Driver combines both in one for our convenience.
  • Zero drivers come with the same microcontroller as an Arduino Zero 48 MHZ ARM cortex M0+ chip, which is better than any other an entry-level Arduino Uno.
  • For better understand how this work lets see a picture of zero drive.

Application of Arduino  Zero

These are some applications of Arduino Zero. We can use it as a parking Lot Counter.
  • It can be used in security and Defense System.
  • It is used in Digital Electronics and Robotics.
  • It is used in Weighing Machines.
  • It is used in Traffic Light Count Down Timer.
  • we can also use it in Medical Instrument.
  • It is also used in Emergency Light for Railways.
  • It is also used in Home Automation.
So, friends, this was all about Arduino Zero. If you any question regards it, you ask in comment box. I will resolve your queries. Thanks for reading. Take care until next post...

PC817 Library for Proteus

Hello friends, I hope you all are doing great. In today's tutorial, I am going to share a new PC817 Library for Proteus. PC817 is an optocoupler / optoisolator, which is used for electrical isolation between components or modules. It's normally used after Microcontroller Pins so that back emf doesn't burn them. You should also have a look at Introduction to PC817, I have shared its complete details there. PC817 is used a lot in Embedded projects but is not available in Proteus, so our team has designed it for the first time. Using this Library, now you can easily simulate this optocoupler in your Proteus simulations. So, let's get started with How to download & install PC817 Library for Proteus:

PC817 Library for Proteus

  • First of all, download this PC817 Library for Proteus by clicking the below button:

[dt_default_button link="https://www.theengineeringprojects.com/ArduinoProjects/PC817 Library for Proteus.zip" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Library[/dt_default_button]

  • It's a zip file, which will have a Proteus Library folder.
  • Open this folder, and you will find these 2 Library files in it:
    • OptocouplersTEP.IDX
    • OptocouplersTEP.LIB
  • Place these Library Files in the Library folder of your Proteus software.
Note:
  • Now open your Proteus ISIS software or restart it if its already open.
  • In the components search box, make a search for PC817.
  • If everything goes fine, then you will get results as shown in below figure:
  • Now place this PC817 in your workspace.
  • Default optocoupler available in Proteus contains 5 Pins but this PC817 has 4 Pins, as shown in below figure:
  • I have shown both optocouplers in above figure.
  • Now let's design a simple circuit to have a look at How it works:
  • So, connect three LogicState and one LED with PC817, as shown in below figure:
  • Now run your Proteus Simulation and change the states of your buttons.
  • Both On & Off states of PC817 are shown in below figure:
  • So, that's How you can easily simulate PC817 in Proteus.
I hope this PC817 Library will help you in your Engineering Projects. If you got into any trouble, then ask in comments and we will help you out. Thanks for reading, take care and have fun !!! :)

Interfacing of Arduino with 74HC595 & 74HC165

Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you How to Interface Arduino with 74HC595 & 74HC165. I have already interfaced these shift registers separately with Arduino. In the first tutorial we have seen Arduino 74HC595 Interfacing in which I have discussed How to increase the output pins of Arduino using 74HC595. After that in second tutorial we have seen Arduino 74HC165 Interfacing where we have increased the input pins of Arduino. So, now we are gonna interface both of these shift registers with Arduino UNO and will increase both input and output pins of Arduino. I have also given the Proteus simulations for download at the end of this tutorial along with Arduino code. So, lets get started with Interfacing of Arduino with 74HC595 & 74HC165:

Interfacing of Arduino with 74HC595 & 74HC165

  • As you can see in above figure, I have used 74HC165 & 74HC595 and interfaced its pins with Arduino UNO.
  • I could use same clock for these shift registers but it would have made the code quite complex.
  • That's why I have used separate clock pins and I have used the below code to reflect the input on output.
#define NUMBER_OF_SHIFT_CHIPS   1
#define DATA_WIDTH   NUMBER_OF_SHIFT_CHIPS * 8
#define TotalIC 2
#define TotalICPins TotalIC * 8

int LoadPin    = 8;
int EnablePin  = 9;
int DataPin    = 11;
int ClockPin   = 12;

int RCLK = 5;
int SER = 6;
int SRCLK = 7;

unsigned long pinValues;
unsigned long oldPinValues;
boolean Data[TotalICPins];

void setup()
{
    Serial.begin(9600);

    pinMode(LoadPin, OUTPUT);
    pinMode(EnablePin, OUTPUT);
    pinMode(ClockPin, OUTPUT);
    pinMode(DataPin, INPUT);

    digitalWrite(ClockPin, LOW);
    digitalWrite(LoadPin, HIGH);
    Serial.println("Visit us at www.TheEngineeringProjects.com");
    Serial.println();
    pinMode(SER, OUTPUT);
    pinMode(RCLK, OUTPUT);
    pinMode(SRCLK, OUTPUT);

    ClearBuffer();
    
    pinValues = read_shift_regs();
    print_byte();
    oldPinValues = pinValues;
}

void loop()
{
    pinValues = read_shift_regs();

    if(pinValues != oldPinValues)
    {
        print_byte();
        oldPinValues = pinValues;
    }

}

unsigned long read_shift_regs()
{
    long bitVal;
    unsigned long bytesVal = 0;

    digitalWrite(EnablePin, HIGH);
    digitalWrite(LoadPin, LOW);
    delayMicroseconds(5);
    digitalWrite(LoadPin, HIGH);
    digitalWrite(EnablePin, LOW);

    for(int i = 0; i < DATA_WIDTH; i++)
    {
        bitVal = digitalRead(DataPin);
        bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));

        digitalWrite(ClockPin, HIGH);
        delayMicroseconds(5);
        digitalWrite(ClockPin, LOW);
    }

    return(bytesVal);
}

void print_byte() { 
  byte i; 

  Serial.println("*Shift Register Values:*\r\n");

  for(byte i=0; i<=DATA_WIDTH-1; i++) 
  { 
    Serial.print("P");
    Serial.print(i+1);
    Serial.print(" "); 
  }
  Serial.println();
  for(byte i=0; i<=DATA_WIDTH-1; i++) 
  { 
    
    Serial.print(pinValues >> i & 1, BIN); 
    Data[i] = pinValues >> i & 1, BIN;
    //if(BinaryValue == 1){Data[i] = HIGH;}
    //if(BinaryValue == 0){Data[i] = LOW;}
    UpdateData();
    if(i>8){Serial.print(" ");}
    Serial.print("  "); 
    
  } 
  
  Serial.print("\n"); 
  Serial.println();Serial.println();

}

void ClearBuffer()
{
    for(int i = TotalICPins - 1; i >=  0; i--)
    {
       Data[i] = LOW;
    }
    UpdateData();
} 

void UpdateData()
{
   digitalWrite(RCLK, LOW);
   for(int i = TotalICPins - 1; i >=  0; i--)
   {
        digitalWrite(SRCLK, LOW);   
        digitalWrite(SER, Data[i]);
        digitalWrite(SRCLK, HIGH);

  }
  digitalWrite(RCLK, HIGH);
}
  • In the above code, I have used Number_of_Shift_Chips 1 and it means I am using 1 chip each, so in total 2 chips.
  • Now get hex file from Arduino software and upload it in your Proteus software.
  • Run your simulation and if everything goes fine then you will get something as shown in below figure:
  • You can see in above figure that all those LED outputs are ON which has HIGH inputs.
  • I have also attached a Virtual Terminal with Arduino to have a look at the input bits.
  • Now let's add 2 chips of 74HC165 and 74HC959, so design a simple simulation as shown in below figure:
  • Now in your above code change the Number of Shift chips from 1 to 2, as now we are using 2 chips each.
  • Upload your hex file and if everything goes fine then you will get similar results:
  • So, that's how you can easily increase input and output pins of Arduino UNO.
  • I have just designed a simple code but you can work on it and can control these inputs separately as well.
  • You can interface different digital sensors on these input pins and can control motors, relays, solenoids etc. at output pins.
  • You can download both of these Proteus Simulations along with Arduino code by clicking the below button, but I would suggest you to dwsign it on yoru own so that you could learn from mistakes.

[dt_default_button link="https://theengineeringprojects.com/ArduinoProjects/Interfacing%20of%20Arduino%20with%2074HC595%20&%2074HC165.zip" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Arduino Code [/dt_default_button]

So, that was all about Interfacing of Arduino with 74HC595 & 74HC165. I hope you can now easily simulate it. If you have any questions then ask in comments and I will try my best to resolve them. Thanks for reading. Take care !!! :)

Arduino 74HC165 Interfacing: Increase Input Pins

Hello friends, I hope you all are doing great. In today's tutorial, I am going to do an Arduino 74HC165 Interfacing and we will have a look at How to increase Input Pins of Arduino. 74HC165 is a shift register and works on the principal of Parallel In Serial Out. In my previous tutorial Arduino 74HC595 Interfacing: Increase Output Pins, we have seen How to increase the output pins of Arduino and today we are gonna do exact the opposite and we will increase the input pins. 74HC165 will take 8 parallel inputs from different sensors or buttons etc and will send them to serial OUT Pin, which will be connected to Arduino. So, if you are working on a project where you want to get data of 15 or 20 digital sensors then you can use this shift register and just using a single pin of Arduino you can read data of all those sensors. We can only get digital inputs, we can't get analog input through this shift register. So, let's get started with Arduino 74HC165 Interfacing:

Arduino 74HC165 Interfacing

  • I will design a Proteus Simulation of Arduino 74HC165 Interfacing, I have given the files for download at the end of this tutorial, but I would recommend you to design it so that you could learn.
  • I will connect simple Logic buttons with this shift register and will read their status on the Serial Port.
  • So, first of all design a simple Proteus Simulation as shown in below figure.
  • I have used Arduino UNO and have connected Virtual Terminal so that we could have a look at Serial data.
  • As you can see in the above figure that I have connected four pins between Arduino and 74HC165, which are:
    • Pin # 8 of Arduino  ==> Shift (SH) of shift register.
    • Pin # 9 of Arduino  ==> Clock Enable (CE) of shift register.
    • Pin # 11 of Arduino ==> Serial OUT (SO) of shift register.
    • Pin # 12 of Arduino ==> Clock (CLK) of shift register.
  • Now open you Arduino software and copy paste the below code in it:
#define NUMBER_OF_SHIFT_CHIPS   1
#define DATA_WIDTH   NUMBER_OF_SHIFT_CHIPS * 8

int LoadPin    = 8;
int EnablePin  = 9;
int DataPin    = 11;
int ClockPin   = 12;

unsigned long pinValues;
unsigned long oldPinValues;

void setup()
{
    Serial.begin(9600);

    pinMode(LoadPin, OUTPUT);
    pinMode(EnablePin, OUTPUT);
    pinMode(ClockPin, OUTPUT);
    pinMode(DataPin, INPUT);

    digitalWrite(ClockPin, LOW);
    digitalWrite(LoadPin, HIGH);

    pinValues = read_shift_regs();
    print_byte();
    oldPinValues = pinValues;
}

void loop()
{
    pinValues = read_shift_regs();

    if(pinValues != oldPinValues)
    {
        print_byte();
        oldPinValues = pinValues;
    }

}

unsigned long read_shift_regs()
{
    long bitVal;
    unsigned long bytesVal = 0;

    digitalWrite(EnablePin, HIGH);
    digitalWrite(LoadPin, LOW);
    delayMicroseconds(5);
    digitalWrite(LoadPin, HIGH);
    digitalWrite(EnablePin, LOW);

    for(int i = 0; i < DATA_WIDTH; i++)
    {
        bitVal = digitalRead(DataPin);
        bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));

        digitalWrite(ClockPin, HIGH);
        delayMicroseconds(5);
        digitalWrite(ClockPin, LOW);
    }

    return(bytesVal);
}

void print_byte() { 
  byte i; 

  Serial.println("*Shift Register Values:*\r\n");

  for(byte i=0; i<=DATA_WIDTH-1; i++) 
  { 
    Serial.print("P");
    Serial.print(i+1);
    Serial.print(" "); 
  }
  Serial.println();
  for(byte i=0; i<=DATA_WIDTH-1; i++) 
  { 
    Serial.print(pinValues >> i & 1, BIN); 
    
    if(i>8){Serial.print(" ");}
    Serial.print("  "); 
    
  } 
  
  Serial.print("\n"); 
  Serial.println();Serial.println();

}
  • The code is quite simple but let me give you a quick explanation of  it.
  • First of all, I have assigned names to all 4 pins of 74HC165 connected with Arduino.
  • Function read_shift_regs() is used to read the eight input pins of 74HC165 and print_byte() function is used to display that data on Serial Monitor.
  • So get your hex file from Arduino software and upload it in Proteus software.
  • Run your Proteus simulation and if everything goes fine then you will get results as shown in below figure:
  • If you change any input of your shift register then you will get the new value on your Virtual Terminal.
  • Now let's add another 74HC165 and increase our input pins by 16.
  • So, design a simple circuit as shown in below figure:
  • Now, in the above code, simply change the first line and make #define NUMBER_OF_SHIFT_CHIPS 2.
  • Simply changes 1 to 2, as we are using 2 shift registers now.
  • Now get your hex file and run the Proteus simulation.
  • Here's the output of our 16 increased inputs:
  • That's how you can easily interface multiple 74HC165 chips with your Arduino board and can increase the input options.
  • You can download these Proteus simulations and code for Arduino 74HC165 Interfacing by clicking the below button:

[dt_default_button link="https://www.theengineeringprojects.com/ArduinoProjects/Arduino 74HC165 Interfacing.rar" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Code[/dt_default_button]

  • You should also have a look at this video in which I have shown How to run these simulations:
So, that was all for today. In my coming tutorial, I will interface both 74HC165 and 74HC595 with Arduino UNO and will show you How to increase both input and output pins at the same time. Thanks for reading. Take care!!! :)
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