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.
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.
Analog Flex Sensor Library for Proteus
First of all, click the link given below to download the analog flex library for proteus.
Download 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:
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.