pH Sensor Library for Proteus

Hi guys, I hope you are good and doing well in your life. In this article, I am going to tell you about a new pH Sensor Library for Proteus. I hope you all will enjoy it and find it useful. We are all well aware of pH Sensors which are used for the detection of pH of different fluids. By knowing the pH of a liquid we can tell whether the liquid is acidic or basic. You can’t find a pH sensor in Proteus software, so we designed a pH sensor for simulation purposes. You can interface this pH Sensor with any Microcontroller, for example: Arduino, PIC Microcontroller, 8051 Microcontroller etc.

In this pH Sensor Library, I have added four different pH Sensors, which are used for the detection of the pH of any fluid. Since we can’t place real liquid and measure pH in this software, I have attached a test pin in the pH meter where you have to connect a potentiometer. The potentiometer will produce a reading from 0 to 1023, which will be mapped from 0 to 14 in the program code. We can predict the nature of the liquid. We will have a look at how to use these sensors below. So, here’s the list of all four pH sensors, I have added to this pH sensor  library:

  • PH METER
  • PH METER 2
  • PH METER 3
  • PH METER 4

So, let’s start with downloading and installing the pH Sensor Library for Proteus.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2ResistorAmazonBuy Now
3Arduino UnoAmazonBuy Now

What is a pH Sensor?

  • A pH sensor is a device that is used to measure the pH value of a liquid. pH can be defined as the concentration of H+ ions in a liquid. We can find whether the fluid is acidic, basic or neutral by knowing the pH of the liquid.
  • Real pH sensors are shown below:

pH sensor Library for Proteus

  • First, download the zip file of Proteus Library for pH Sensor.
  • Click the link below to download the library zip file of pH Meter:
pH Sensor Library for Proteus
  • After downloading the zip file, extract its files and open the folder named “Proteus Library Files“.
  • In this folder, you will find three files, named:
    • pHMeterLibraryTEP.IDX
    • pHMeterLibraryTEP.LIB
    • pHMeterLibraryTEP.HEX
  • We have to place these files in the ‘LIBRARY’ folder of Proteus software.
  • Now, open Proteus. if you are already working on it you have to restart it.
  • In the components search box, search for “PH METER” and you will get four results, as shown in the below figure:
  • Let’s place these four pH Meter models in our Proteus workspace:

Adding Hex File to the Sensor

  • Now we need to paste the hex file of the pH METER in the properties section of the sensor. Double click on the sensor to open the properties window.
  • Go to the program file section, browse to the hex file, which we have downloaded above and placed it in the ‘LIBRARY’ folder of Proteus software:
  • After adding the hex file, click the Ok button.
  • Now all is ready, let’s create a circuit to check it's working.

pH Sensor Proteus Simulation

  • The pH sensor is now ready to simulate in Proteus, so let’s design a simple circuit to understand its working:
  • As you can see, I have placed an LC filter on the analog output of the pH sensor, it's because proteus gives us a peak to peak voltage value and we need to convert it to Vrms.
  • While performing the real experiment, you don’t need to do the above stuff.
  • Now, let’s run the Proteus simulation. You will see such a screen if everything will work fine.

Interfacing of pH sensor with Arduino UNO

  • Add Arduino UNO  and pH sensor to the components list and place them in the workspace.
  • Placed an LC filter on the analog output of the pH sensor, as mentioned above.
  • Connect it to the A0 pin of Arduino. Add a virtual terminal also to see the readings generated.
  • Paste the hex file of the program at the program file section of the Arduino.
  • Now run the simulation, if everything's fine you will get results as shown in the below figure:
  • You can watch the complete working simulation in the below video:

So, that was all for today. I hope you have enjoyed today's lecture. Thanks for reading !!!

WiFi Temperature Monitor with ESP8266 and DS18B20

Hello friends, I hope you all are doing great. Today, we will create a wifi temperature monitoring system. For reading, we will use the DS18B20 sensor. For data processing and webpage creation, we will use our already known ESP8266.

The project will be built as follows:

  1. Circuit assembly
  2. Code for reading the DS18B20 sensor (we will use Serial for tests).
  3. Creation of the webpage (we will use SPIFFS to store in FLASH).

But first, let's know a little about the sensor and the communication model it uses.

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

Materials

For this project, we will need the following items: For this project, we will need the following items:

  • 1 x ESP8266
  • 1x DS18B20 Sensor
  • 1x Breadboard
  • 1x 4k7 Ohms resistor

DS18B20

  • DS18B20 is a digital temperature sensor with good precision, good customization, practical use, reliable and low cost. Good combination?
  • The sensor monitors temperatures in the range: -55°C to +125°C (-67°F to + 257°F), with an accuracy of +-0.5°C in the range -10°C to +85°C (outside that range, this inaccuracy increases, but nothing absurd).
It uses three pins for operation:
  • VDD (Power Supply)
  • GND (Ground)
  • DQ (Digital Communication)

VDD operates with values from 3V to 5.5V and can even be omitted. The sensor has a Parasite Mode, using only the DQ and GND pins, and its power comes from the communication pin. This mode works well but is more susceptible to noise.

Data communication takes place over the 1-Wire (OneWire) protocol, using the DQ pin. We'll discuss the protocol later, but now it's important to know that, despite having only one wire, it allows two-way communication.

The reading is performed actively, the microcontroller sends a command and receives back a packet with the information.

In addition to the reading request, the sensor can also receive alarm configuration and data format commands. The DallasTemperature library already handles most of this for us. Including offering us some additional features, such as receiving reading in Faraday.

The most common models on the market are found in the TO-92 package (looks like a transistor) and the waterproof package. This second is more common due to its practical application, 1m long cable with stainless steel tip. It can be used to control water temperature, for example. The reading is performed actively, the microcontroller sends a command and receives back a packet with the information.

In addition to the reading request, the sensor can also receive alarm configuration and data format commands. The DallasTemperature library already handles most of this for us. Including offering us some additional features, such as receiving reading in Faraday.

The most common models on the market are the TO-92 package (looks like a transistor) and the waterproof package. This second is more common due to its practical application, 1m long cable with stainless steel tip. It can be used to control water temperature, for example.

OneWire

OneWire (or 1-Wire) is a communication method designed by Dallas Semiconductor that transmits data using just one line, with a system of signaling who sends and when.

The method is very similar to i2C, but it has a much more limited data transfer speed. Another difference is that in the 1-wire case, it is possible to omit the power pin, using the data pin in parasite mode (by now, you may have noticed that despite the name, the method needs at least two wires: Data and GND).

Communication is done in master-slave mode, in which the microcontroller sends all requests, and the other devices only send data when nominally requested.

Each device has a unique address/name. This allows us to connect multiple devices on the same data line. The requests are sent in broadcast, the device that recognizes itself in it responds.

Circuit

The circuit for our application is simple. We will connect the VDD pin of the sensor to the 3V3 of the NodeMCU, GND with GND, and we will use the D4 pin for the sensor data. It could be any other digital pin.

Additionally, a 4k7 ohm resistor must be placed between the data pin and the 3V3 to increase stability.

Finding the DS18B20 address

As we saw earlier, each sensor has a unique address and, this address is essential for communication. We can understand this as a manufacturing serial number. But how to identify this number? We will create a helper code to find this address. In this case, the code scans any devices connected to pin D4. We will use the Serial Monitor to visualize the result.

We started with importing the OneWire and DallasTemperature libraries (do not forget to maintain order). If any import error occurs, you can add them to Arduino IDE's library manager.

Next, we start a OneWire object on pin D4 and create a sensor using that object. From that moment on, the “sensors” object has all the properties and functions offered by the DallasTemperature library.

And we will make use of two functions Search(), which performs a search for devices in OneWire, and reset_search() which restarts this search.

What our code does is start a search, save the result in the addr variable and, if the variable is not empty, write it in the serial.

We found the result on the Serial Monitor. If there are other devices, they will appear here too. Keep the address, we'll need it.

 

Sensor reading by Serial Monitor

Now that we know the sensor's address. Let's start our main code for reading the temperature. The objective here is to start the sensor and take a reading every 10s.

We started in the same way, but this time we created the sensor1 variable with the collected address.

In the readDs18b20() function we will use two functions:

  • requestTemperatures() - This function does not specifically communicate with any sensors, but with all. It's like it says: If you're a ds18b20, run a new read now and wait for my ” And what the sensor does.
  • getTempC(address) - Here we send information directed to each sensor of interest, which responds to us with the last reading

Inside the Setup() function we started the sensor with the begin() function, it performs a reading automatically, if you didn't make new requests, the sensor would still respond to the getTemp() function, but with an outdated value.

In the loop, we have a timer with the millis() function so that the reading takes place every 10s.

On the serial monitor, we should get the following result:

Note that on line 15, we added one more parameter to the Serial.println() function. With that, we define the number of decimal places.

Creating the monitoring page

With our reading ready, let's create a web page to view this information in the browser. Remember that later we will put these files in FLASH ESP8266 with SPIFFS.

We will build the following screen:

    And for this, we will use two files:
  • index.html
  • style.css

The page structure is not the focus of this article, but basically, we have the index.html file creating the page itself and triggering a javascript function to update the reading.

The style.css file improves the appearance of the page but does not interfere with its functioning.

Both files must be in the data folder within the project folder and be transferred using the ESP8266 Sketch Data Upload.

Complete Code

With the page saved to FLASH, we need to create the structure to serve the page.

  • Connect on wifi
  • Create a web server
  • Create call-backs for requests to this

This step is nothing new for us, but it is worth noting a few points.

Now the readDs18b20() function also updates a variable of type String. We do this because server call-back functions do not accept integer or float variables.

For the server, we have three routes:

  • “/” will send the html file with the latest sensor reading.
  • “/styled.css” will send the css file
  • “/state” will return the temperature variable to be updated.
  • And now in Serial Monitor, we have the IP to access at http://yourIP.

Conclusion

The DS18B20 is an extremely efficient and easy-to-use sensor. The application we developed today could be used to monitor the ambient temperature, or perhaps the temperature of a water reservoir. And the ESP8266 extends the range of that monitoring as far as we want.

ESP8266 – Serial Communication

Today we will talk about an extremely powerful tool in the use of microcontrollers. The Serial communication, specifically the USART (Universal Synchronous Asynchronous Receiver Transmitter) standard. The system works using two wires. RX (Receiver) and TX (Transmitter), connecting two devices. The RX of one is connected to the TX of the other. If the choice is for a synchronous connection, it may be necessary to add one or two more pins to operate as a “traffic light”. But most current microcontrollers can operate asynchronously, which saves us the expense of pins. Data is sent, as the name implies, in a series of bits. ESP8266 provides us with two ports, one of them converted to USB in the NodeMCU module.
Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

Applications

The range of uses of serial communication is limited only by creativity. Here I will mention three more general scenarios and detail some applications within them.

1. Communicating with computers

With a USB cable, we were able to connect the NodeMCU with a computer via Serial. Arduino IDE already gives us the first use. With Serial Monitor, we can send commands or debug the functioning of our code. But the integration with other software is pretty powerful. Imagine, for example, access control in which a circuit with ESP8266 reads an RFID card and sends it via Serial to a Permission Validation System. Or even an LED panel that receives a software display text.

2. Communicating with microcontrollers

Probably the most common application. Whether to integrate into a preexisting circuit or to distribute functionality between microcontrollers. This integration can be done between different microcontrollers. As long as they operate with the same voltage (3.3V) or use a level converter. An application example is to integrate the ESP8266 wifi with the analog ports of an ATMEGA328 to build an IoT toxic gas sensor. We already know that the ESP8266's analog port is quite inefficient. Then it is possible to perform the analog reading on the ATMEGA328 and send the information to ESP8266 by Serial.

3. Communicating with industrial machines

This, without a doubt, is the most interesting way to integrate industrial machinery with WEB systems. The older industrial equipment that allows some automation, provides RS232 or RS485 ports for integration with PLCs. In these cases, the commands are pretty plastered, but hopefully, well documented. The voltage level is 12V or 24V, but there are converters and logic levels to solve this. The industry 4.0 paradigm has been operating to make this kind of integration. Some PLCs are already developed with wifi modules. And on that account, circuits with the ESP8266 have the immense advantage of low cost. The vision behind this is to be able to remotely monitor or control an entire industrial plant. Tracking KPIs for predictive maintenance, doing recalibrations, and managing production.

Main Functions

The Serial library has a good variety of functions for Serial communication, but most are for very specific uses. We will discuss the most common ones and may return to others in the future as needed by the projects.

Serial.begin()

The first function to be used. It initializes Serial communication informing the data transfer speed (in bits per second) and, optionally, a configuration parameter. By default, Serial is configured to send data in 8-bit packets plus a terminator, not including parity. The best way to imagine this communication is to imagine a train, where each byte (8 bits) sent is a car, and the terminator is the connection between them. This standard is used in most devices, but if you need to integrate a device with another standard, the config parameter allows you to change the number of bits in the packet (from 5 to 8), the number of stop bits (1 or 2 ) and enable or disable parity (a packet integrity check). The speed uses some preset values. The fastest that remains stable for the ESP8266 is 115200 changes per second. So we could start with: Serial.begin(155200) The function below presents the same result, making the config parameter explicit. Serial.begin(115200, SERIAL_8N1)

Serial.available()

The function returns an integer with the number of bytes available in the read buffer. The maximum of bytes in the buffer is 64. This function is very useful for monitoring incoming information. Value = Serial.available()

Serial.read()

The function returns the most recent byte in the input buffer and removes it from the buffer. It is ideal if your communication is byte-to-byte. For example, if you are receiving input from a keyboard, the function would return the key you typed. It returns an integer with byte or -1 if no data is available.

Serail.readString()

This function is best suited for reading strings. Like words. It is the equivalent of calling the read() function continuously until it reads all the information from the buffer. The function returns a string with the data.

Serial.print() and Serial.println()

The two functions are very similar. It takes a value and sends it serially in ASCII format. It is also possible to define the numerical base before sending (binary, decimal...) and the number of decimal places. The function can be used either in the format: Serial.print(value) And the format: Serial.print(value, format) The table below presents some usage examples. The println function works pretty much the same, but it adds the return character ‘\r’ and newline ‘n’ at the end of the packet. It's the equivalent of typing in a text editor and pressing the "Enter" key.

Serial Monitor

The Arduino IDE provides a very powerful tool for debugging and testing Serial communication. The Serial Monitor. The tool is pretty intuitive, but let's take a look at its fields.
  • Sending data: This allows us to send commands directly to the microcontroller
  • Autoscroll: Very useful when we've already received enough information to fill the screen
and don't want to move it down manually.
  • Terminator: Choose whether or not to include the new line and carry return characters at the end of the message before
  • BaudRate: Defines the communication It must be the same as the microcontroller, or
packet loss or character misreading problems will occur.

Controlling and monitoring an LED

Let's make a simple code to control and monitor the NodeMCU LED from the Serial monitor. The code will monitor the Serial, and each time it receives the command “ON”, it will turn on the LED, when it receives “OFF”, it will turn off the LED when it receives “STATUS”, it will return the status of the LED in the Serial. We will create three functions to perform the actions.
  • turnOn() : To turn on the
  • turnOff() : To turn off the
  • statusLED() : To read the pin status and return information in the serial.
We initialize the Serial in the Setup function. In the loop() function, we check if there is any data in the input buffer of the serial, if there is, it saves the buffer values in the variable “payload”. Finally, we check the payload value to decide the action. Here it is important to note that we use an equality comparison and that “ON” is different from “ON “. For this reason, when sending the information through the Serial Monitor, we choose the “No line ending” option. And so is our final code. Compiled, written to nodeMCU. Open the Serial Monitor, remember to put the correct baud rate and the "No Line ending" and send one of our 3 commands. This is simple code, but very powerful. So, that was all for today. I hope you have enjoyed today's tutorial. If you have any questions, please ask in the comments. Thanks for reading.

ESP8266 – Knowing the NodeMCU GPIOs or Pinout

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

Introduction

When the subject is ESP8266, it is normal that our attention is on the Wifi module. We've already discussed some applications in previous articles, and there's still a lot of cool stuff to see in the future. We've looked at how the ESP8266 communicates with the world via wifi, and now we'll look at how it does it through its pins.

We will make a decision here. The ESP8266 is found in several modules. Each module with its pin provision. ESP-12 modules provide the most features. To make better use of these features and have a more protoboard-friendly module at hand, we will analyze the NodeMCU module with the ESP-12E.

Overview and Electrical Data

The NodeMCU pins are available in two rows with a spacing that allows them to fit on a breadboard (in particular, I find the pins a little thicker than they should be, and I think if they had more length and less width, it would be even more efficient).

  • The NodeMCU interferes just a little with ESP-12 pins. It does an untreated exposure of each of them.

It is interesting to see what NodeMCU adds or changes to the ESP-12.

Power Source

ESP8266 operates on 3.3V, ESP-12 exposes the VDC pin for direct power. The NodeMCU incorporates a voltage regulator (usually the AMS1117) that can receive a 5V to 10V input and deliver a stable 3.3V supply to the ESP-12.

But what advantage does this give us? nodeMCU is a development module. Choosing pins that fit the breadboard shows us this. Being able to receive 5V greatly increases the practicality of the power supply. 5V is the standard used on USB, so even a cell phone charger can keep everything running.

The power can be supplied directly via the USB connector (standard USB = 5V) or the Vin pin (5V to 10V). The regulator provides a maximum of 500mA.

The pins involved in the power are:

  • Vin: Positive voltage Operates with voltages from 5V to 10V.
  • GND (G): Reference voltage for voltage input and
  • 3V (3V): Output voltage with a value of 3.3V
  • VU: On some models, this pin is not connected to But Lolin's V3 model provides a 5V output provided directly by USB.

Some important considerations to keep in mind:

  • The 3V3 regulator provides a maximum of So be careful what you feed the 3V3 pins.
  • The Module can be powered by either USB or Vin But it is not recommended that it occur for both at the same time.

Serial – USB Adapter

The ESP-12 provides us with two UARTs, with UART0 (pins RXD0 and TXD0) being used in programming. The NodeMCU Module integrates a Serial-USB converter that greatly facilitates our work.

The USB connector can be used for power and data communication via Serial. For this reason, it is a sufficient condition for recording the ESP8266.

A point of attention here: The RXD0 and TXD0 pins are available as GPIO pins (respectively GPIO3 and GPIO1). But they need to be used very carefully. Enabling these pins as GPIO disables USB.

Digital Pins (GPIO)

Digital pins or GPIO (General Purpose Input Output) are pins intended for binary control. It can have a HIGH or LOW state and can operate both, as an input (for reading digital states) and as a digital control (turning on LEDs, for example).

If you take a look at the nodeMCU image, you will notice that it talks about 13 GPIOs (From GPIO0 to GPIO15). So we have 13 pins for input and output control? Not exactly.

Most microcontroller pins have more than one function, this function is defined through registers. In the case of NodeMCU, some GPIOs are already in use. And if we configure it as a digital pin, we lose some functionality.

Let's look at it on a case-by-case basis:

  • GPIO4 and GPIO5: Starting with the easiest. These two have only the GPIO function. It can operate as Input or Output.
  • GPIO0 and GPIO2: These pins play a very specific role in the ESP8266 startup. For that reason, they can only operate as
  • GPIO1 and GPIO3: As we have seen, these pins are used by USB so they are not recommended for use as GPIO in
  • GPIO9 and GPIO10: ESP8266 uses an external FLASH memory chip and communicates with it with a 4-bit SDIO interface. These two pins are on the list. By default, both are used in this But it is possible to set it to 2-bit mode and release these two pins. You gain in the number of pins, but you lose in memory access speed.
  • GPIO12, GPIO13, GPIO14, GPIO15: These pins can be used in other modes, but by default, they are free GPIOs for use as Input or

Ah, an important point to mention: ESP's GPIOs operate at 3.3V.

Analog Pinout

The Esp8266 only provides one analog input (ADC0 pin), and that's probably its biggest weakness.

Although the module operates with 3.3V, the analog input operates from 0 to 1V. Which significantly limits the resolution.

Main functions for GPIO in the Arduino IDE

To control the GPIOs, the Arduino IDE provides us with some functions. Among the main ones, times:

pinMode(pin, mode)

pinMode() defines the mode in which the pin will act. The possible modes are:

  • INPUT: The pin will be configured as a digital input
  • OUTPUT: The pin will be configured as digital output
  • INPUT_PULLUP: The pin will be configured as a digital input with a pull-up Here I leave a study recommendation for pull-up and pull-down circuits but simply put. It forces a value when nothing is connected to the pin. If it's a pull-up, it's HIGH, and if it's pull-down, it's LOW.

As an example, if we want to use gpio4 as an output, we will have:

pinMode(4, OUTPUT)

digitalWrite(pin, value)

The digitalWrite() function changes the value of the informed pin. Possible values are: HIGH or LOW.

As an example, if we want to change the value of gpio4 to HIGH, we will have:

digitalWrite(4, HIGH);

One point we need to note is that there is an expected logical sequence to control the pin. First, we define it as OUTPUT and only then send a command to change the state. But what happens if we forget to use pinMode or set it to INPUT?

For these cases, the digitalWrite() command automatically enables the INPUT_PULLUP mode. This procedure protects the microcontroller from short circuits.

digitalRead(pin)

The function reads the digital value of the selected pin, returning the HIGH or LOW value. As an example, to read the status of gpio4, we will have:

value = digitalRead(4)

Of course, the value variable needs to be declared before it can be used. And if the pin is not connected to anything, the value will vary randomly (unless pullup is enabled).

analogRead(pin)

This function reads the analog pin. Or almost. The function returns a value between 0 and 1023, with 0 being the equivalent of the GND voltage and 1023 being the value referring to the VCC.

As an example, to read the status of adc0, we will have:

value = digitalRead(A0)

Constants

There are some predefined constants to refer to the pins more practically. When using either function, you can use either the gpio number or the related constant.

Differences in other modules

Here we look at the pin arrangement of the nodeMCU Lolin V3 board. There are slight differences on other cards. In Lolin itself there are versions with the ESP-12E module and others with ESP-12F. In this case of Lolin, the most significant difference is a change of position between GPIOs 4 and 5.

ESP8266 Operational WiFi Modes

In previous articles, we connected the ESP8266 to a pre-existing WIFI network. It is the commonly used method in projects, especially when there is interest in internet access.

For these cases, the ESP8266 operates as a “station” on the network. But we can find scenarios where there is no WIFI network to connect. Can we still use the ESP8266 in these cases? Yes, we can!

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

ESP8266 Operational Modes

The ESP8266 WiFi module can operate in 2 different modes:

  • STA (the module operates as a station and is available to connect to an Access Point).
  • AP (the module creates a network with customizable SSID and Password. We will discuss how each mode works, its limitations, and how to use

STA Mode

We use the STA mode to connect the ESP8266 to a pre-existing Wi-Fi network. This connection is made from an Access Point, which will be responsible for managing information traffic.

For configuration and use on the Arduino platform, we use the ESP8266WiFi.h library. Simple to use and extremely powerful, this library offers us all the tools to configure the WiFi module, without overloading us with flags and registers.

For our configuration, there are two more relevant functions, begin() and config().

begin() function

The begin() function needs some parameters necessarily and others optionally. This is because this function is of type overload, which provides more flexibility when calling the function. For a better example, let's look at the begin() function in its full form and its minimal form:

  • Complete form: begin(ssid, password, channel, bssid, connect)
  • Minimum Form: begin(ssid, password)

Same function, two ways to call it. And both works. This is because it was built with more than one declaration format in the library.

Let's take a look at the parameters it accepts:

  • SSID: The name of the network we want to connect to. Required field, and can contain up to 32
  • password: password for the chosen Required field, must be between 8 and 64 characters.
  • channel: Defines the bandwidth to be This parameter is optional and can be useful in areas with many different networks. Choosing a good channel can minimize interference and increase network range. If omitted, it will be selected automatically.
  • bssid: One more optional parameter. If set to true, the function will return the MAC of the AP it was connected
  • Connect: A Boolean parameter which, if set to false, will save the parameters defined in the function, but will not connect to the

This information will be saved in a reserved area of FLASH and in case of loss of connection, the attempt to reconnect will occur automatically.

Another important point is that, by default, the station is configured as a DHCP (Dynamic Host Configuration Protocol) client. This means that when connecting, the ESP8266 will ask the Access Point for an IP address. If the AP has DHCP enabled, we will receive a random IP within the network range configured there.

Config() function

The config() function is not mandatory for a connection such as a station. But you will need it if you want to connect to the network with a fixed IP address. The function has the following format:

  • config(local_ip, gateway, subnet, dns1, dns2) Where the parameters represent:
  • local_ip: IP address we want to assign to the
  • gateway: Access Point IP address.
  • Subnet: IP mask of the network where we will
  • dns1 and dn2: optional fields for IP address of DNS servers (Domain Name Server).

When we call the config() function, the DHCP mode is automatically disabled. Then the station will force the use of the address we choose. This method is useful when connecting over a network that does not have a DHCP server, or when having a fixed address is an essential project requirement.

You need to be careful when choosing the IP address and the subnet, as if it's incompatible with the network configuration, we will connect, but we won't be able to interact with anything.

In the image, we have a code for configuration and connection as a station.

Access Point Mode (AP)

In AP mode, the ESP8266 creates its WiFi network, allowing stations to connect to it. The figure below should help you better understand how it works. The ESP8266 configured as AP, replaces the role of the router in the network (with some limitations, but the principle is the same).

Strictly speaking, the name of this mode is Soft Access Point, because the functionality as an AP does not use any hardware resources equivalent to that of a common AP. It's like a Virtual AP. This does not impact health, but it does severely impact performance.

The main limitation is the number of connections it can manage. Although the manufacturer suggests up to 8 stations connected, you will have serious problems if you go beyond 5. If your application has a heavy data flow, I recommend that you limit it to 4 connections.

Another limitation is that the created network is not connected to the internet. So keep in mind that this is a model for applications that work well on local networks and for a few devices.

An example application for this format is an access control system. Approach with your cell phone, connect to the ESP8266 network, and be authorized to open a door.

Setting up this mode is very similar to that of a station. We have an overload function for begin and another one for configuration.

softAP() function

It would be the equivalent of our station mode begin() function.

  • softAP(ssid): to create an open network, without a password.
  • softAP(ssid, password, channel, hidden, max_connection): to create a protected network.

Let's take one for each parameter:

  • SSID: The name of our network, can contain a maximum of 63 This is the only mandatory field in the role and cannot be empty.
  • password: This field contains the password that the station needs to enter to connect. If not informed, the network will be open and can be accessed without any security. If you include one, it must contain a minimum of 8 characters, following the WPA2-PSK network security standard.
  • Channel: As we discussed for the station, this field defines the wifi operation It must receive a numeric value from 1 to 13. If not informed, it will receive 1 as the default value.
  • Hidden: If set to true, the SSID will be invisible and cannot be detected by identifiers (in your mobile's WiFi network list, for example. The network can still be connected if the station writes
  • Max_connection: Defines the maximum number of stations allowed. Receives values from 0 to 8, with 4 as the default.

softAPConfig() Function

This function sets some parameters referring to IP addresses. It has the format: WiFi.softAPConfig(local_ip, gateway, subnet)

Where the parameters represent:

  • Local_ip: IP address of the access point
  • Gateway: IP address of the gateway (this is what stations will use as a switch)
  • Subnet: Defines the IP range to be

With the code, you will configure a simple access point visible to your cell phone or computer.

STA + AP Mode

As the name suggests, the esp8266 will operate both as a station (being able to connect to a network) and as an Access Point (allowing stations to connect to it) at the same time.

The purpose behind this method is to use esp8266 in mesh network configurations. The idea is interesting, but if the performance is not already excellent operating as AP, imagine as AP and STA.

The documentation for this format is very scarce and, in a way, abandoned by the manufacturer itself. Espressif, when launching the successor of ESP8266, ESP32, included a specific library for MESH.

Create Webserver with ESP8266 using SPIFFS

Hello friends, I hope you all are doing great. In today's tutorial, we will have a look at How to Create Web Server with ESP8266 using SPIFFS.

We've already seen how to create a web server and how to provide an HTML page on our ESP8266. We use the PROGMEM command to store an HTML code in FLASH memory. For a simple page, this works fine, but what if we have a more complex webpage? With a better style? What if we want to include images?

Today we will learn how to use SPIFFS with ESP8266 to store files (regardless of type) in FLASH memory.

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

What is SPIFFS?

  • SPIFFS (SPI Flash File System) is a system designed for managing SPI flash memory in embedded devices. Its main goal is to use minimal RAM to access files. It's very useful when using pen drives, memory cards, and the ESP8266's flash memory.
  • SPIFFS allows you to access files (create, read, write, delete) just like on a computer. But with a much simpler folder structure.
  • To show how the tool works, we will create a web server with a styled page and an image. Then when accessing the webserver, the browser will receive the HTML file, the CSS file, and the images.

Create Webserver with ESP8266 using SPIFFS

  • For that, we will need two things:
    • Library to manage SPIFFS.
    • Tool to load the files in FLASH.
  • The upload tool is a plugin called ESP8266fs that integrates python into the Arduino IDE.
  • Download the ESP8266FS-0,5.0.zip file from Github and unzip the files into Arduino's tools folder ( Possibly C:\program files x86\arduino \tools).
  • Restart Arduino IDE and the tool should appear available as shown in the image.
  • Now let's take a look at how it works.
  • Your sketch will always be saved inside a folder. The Arduino IDE cannot open an .INO file if it is not inside a folder with the same name.
  • Our upload tool will look inside that folder and look for another folder called “data”. Everything inside that folder will be transferred to the ESP8266's FLASH memory.

Our page will have 3 main objects:

  • An image that will change depending on the status of the LED.
  • A text with the status of the LED.
  • A button to change the status of the LED.

Files on Webserver

And to build this page we will use 4 files:

  • html, which will contain the page itself.
  • css, containing the styling to make the page more beautiful.
  • Image of the lamp
  • Image of the lamp
  • The two images were chosen from the pixabay repository. You can use another one. But I recommend not using very large files as it takes a little longer to load. I also recommend using some service to resize the image, such as tinypng.
  • In our index.html file, we will have:
  • In our style.css file, we will have:

Understanding ESP8266 Webserver Code

  • Created and saved, we used ESP8266 Sketch Data Upload to load the file into FLASH memory.
  • Before we look at the code, it's important to understand how the browser behaves when accessing a page.
  • When accessing the web server address, the browser sends an HTTP GET command in the path “/” and waits for an index file in response.
  • Inside index file it can be informed that it needs other files. What happens in our code.
  • In line 7 of the index.html file, it is informed that the style.css file will also be needed and that it is of type text/css.
  • Then the browser sends another HTTP GET command with the path “/style.css” and expects to receive a file with that name.
  • In line 13, the <img> tag informs the path to an image, and the browser sends another HTTP GET command to the address “/bulb-off.png”, this time the browser expects an image file.
  • The browser will send GET commands each time we click the Toggle button (“/toggle” path) and every 1 second to receive an updated status (“/state” path).
  • Doing yet another GET to the lit lamp image (path: “/bulb-on.png”).

So we will need to handle it in our .INO code the GET requests in the paths:

  • “/”
  • “/style.css”
  • “/bulb-off.png”
  • “/bulb-on.png”
  • “/toggle”
  • “/state”

Our style.css file sets sizes, alignments, and colors for components. We start our .INO file by importing four libraries:

  • h – That will take care of our WiFi connection.
  • h and ESPAsyncWebServer.h – Which will manage the webserver (including HTTP GET commands).
  • h – File System Library that will take care of our SPIFFS.

We define the pin for our LED. We create variables with SSID and password of the wifi network where we will connect. We created our server on port 80 and a variable to monitor the LED status.

  • The wifiConnect() function will connect the ESP8266 to the chosen wifi network by printing the IP address on the serial monitor.
  • Pay attention to this number. You will need to access the webserver from the browser.
  • The processor() function is responsible for updating the variable with the status of the LED.
  • We will use it in handling our GETs.
  • The toggleLed() function toggles the LED state. We will use it in the GET “/toggle”.
  • And finally, our setup() function. We start by setting our LED to OUTPUT (otherwise, our toggle won't work.
  • Next, we start Serial with a baud rate of 115200 to view the IP address on the Serial Monitor.
  • With SPIFFS.begin(), we initialize our filesystem in flash memory.
  • If an error occurs, our code stops here and reports on Serial Monitor. In that case, upload the files again.
  • And finally, we've included our GETs.

The “server.on” structure is an event manager provided by the ESPAsyncWebServer.h library. In short, we inform a route, a method (HTTP-GET, for our case), and action when receiving the request. But we need to take a closer look at some variations of the function.

  • The server receives a request for the “/” route with the HTTP GET method.
  • In request->send, we inform that the response is a SPIFFS file with the name index.html and that it will be sent in string format.
  • The last two fields (“false” and “processor”) inform that the index.html file is a template that depends on more information. This information will be provided by the processor() function.

It is necessary to send the index file with the updated LED state value.

For style files and images, we use a similar principle, but these files are not being changed before they are uploaded. So we only inform the origin, name, and type (if you want to know a little more about file types in HTTP, I recommend a study on MIME TYPES. Any type of file can be sent, but MIME standardizes what browsers can understand).

Lastly, we have the “/state” returning the stateValue variable on each update and the “/toggle” which changes the state before sending the same variable. The response format has a small change. As we are sending only one variable, we inform the MIME TYPE “text/plain”, the response code 200 (default for success over HTTP), and the variable converted to a string.

Results

  • With the code compiled and recorded, check the IP of the webserver in the Serial Monitor and access it in the browser.
  • Example: for IP: 10.10.10.11 access: http://10.10.10.11.
  • Attention: As we use port 80 on the web server, we use HTTP and not HTTPS. The result on the screen should look like the images below:

So that was all for today. I hope you have enjoyed today's lecture because it will improve the presentation of your project. If you got any queries, ask in the comments. Thanks for reading!!!

Create Web Server with ESP8266

Hello friends, I hope you all are doing great. Today, we will create a web server with ESP8266 microcontroller to control the activation of an LED. The goal is to understand how the ESP8266 connects to a WiFi network, how it sets up a web server, and how it is possible to exchange information between the browser and the esp8266.

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

Components Required

  • 1x Computer/notebook with Arduino
  • 1x Mini-USB cable.
  • 1x NodeMCU (ESP8266 Breakout Board)
  • Internet Browser (Chrome, Firefox, IE…)

ESP8266 Libraries for Arduino IDE

For this project, we will use two libraries:

  • ESP8266WiFi: This library carries all the functions necessary for the ESP8266 to connect to a wifi network.
  • ESPAsyncWebServer: This library carries the functions needed to create and manage an EB server.

Creating the code

  • We can divide the code into three main functionalities:
    1. Control the LED.
    2. Connect to Wifi
    3. Create the webserver.

And we'll treat this building in blocks.

Importing Libraries

  • The Libraries must be included at the beginning of the sketch so that their functions are already available elsewhere in the code.

LED Control with ESP8266

  • Our first step is to define the pin to be used. For our example, we will use the LED of the NodeMCU module.
  • And set this pin as output in the setup function.
  • We will also create a variable to monitor LED status. This variable is not used to control the LED, but it will be important for the webserver so, we will include it here.
  • So, we'll create a function that, whenever triggered, will change the state of the LED (and the variable).
  • The toggleLed() function makes a function nesting in its first line:
  • The digitalWrite() function receives as a value for writing, the inverse of the reading of the pin itself. So each time the function is called, it reads the current value of the pin and toggles its value.
  • The following conditional is only used to update the stateValue variable. To test the function, you can include it in the loop as follows:
  • With these inclusions, we will have this code:
  • With this code, the NodeMCU module LED, we expect to change state every 3 seconds. Remember to remove the data inside the loop function when you finish the test. We will not use them in the next steps.

Connect ESP8266 to WIFI

  • Now let's connect the ESP8266 to your WIFI network. We'll start by creating a variable to store the network name and another one for the password.
  • The connection could be executed directly in the setup function, but we will create a standalone function to make the code more organized and so that it can be reused if you want to create a reconnect function.

The wifiConnect() function will send a connection request and wait for it to be approved.

With Wifi.begin(), ESP8266 will search the network informed in the ssid variable and send a connection request, informing the password (just like what a cell phone would do).

The WiFi.status() function can return the following values:

  • WL_CONNECTED: assigned when connected to a WiFi network;
  • WL_NO_SHIELD: assigned when no WiFi shield is present;
  • WL_IDLE_STATUS: it is a temporary status assigned when WiFi.begin() is called and remains active until the number of attempts expires (resulting in WL_CONNECT_FAILED) or a connection is established (resulting in WL_CONNECTED);
  • WL_NO_SSID_AVAIL: assigned when no SSID are available;
  • WL_SCAN_COMPLETED: assigned when the scan networks is completed;
  • WL_CONNECT_FAILED: assigned when the connection fails for all the attempts;
  • WL_CONNECTION_LOST: assigned when the connection is lost;
  • WL_DISCONNECTED: assigned when disconnected from a network;

In this project, we are not handling connection failures, so we are only interested in the WL_CONNECTED return. The function will wait while this is not the connection status and, when identifying it, it will look for the IP address it received on the network.

Here is a point of attention. The WIFI network must allow the connection and provide an IP by DHCP. If any device can connect to your network just by offering the password, don't worry. This configuration must already exist.

We've added some information to be viewed on the Serial monitor, so the serial needs to be initialized before we call the wifiConnect() function.

  • This should be our code so far:
  • The expected result on the Serial Monitor is as follows:
  • From this point on, the ESP8266 can be found by network tools like the Advanced IP Scanner or a simple PING at the command prompt.

Creating the Webserver with ESP8266

  • Spoiler Alert: At the end of this step, you can view our webserver at the address
  • HTTP://”IP address”, for our case http://192.168.18.76.
  • We will start by creating an instance of AsyncWebServer operating on port 80.
  • In short, a webserver operates as a file manager that delivers on-demand. Then the browser makes a request, the web server responds and continues to wait for new requests.
  • All this happens following communication protocols (HTTP, FTTP, or both), rigorous error handling, and high-security logic.
  • The library takes care of preparing the backstage of the webserver, which saves us a lot of time and lines of code. But we still need to configure what happens on each request.

We will handle two requests:

  • When the page starts or refreshes
  • When we press the LED state change

The first will occur when we send a GET request to the root “/”. What the browser does automatically when we go to http://192.168.18.76.

  • The server will respond with status 200 (default success response), the information on the type of file sent ("text/html"), the HTML file (which we will create next and save in the variable index_html), and the return of the processor( ) (which we will also create now).
  • The processor function simply returns the value of the updated stateValue variable.
  • The HTML file the browser expects tends to be large for a variable, and even with the good SRAM memory space the ESP8266 has, it could cause problems.
  • That's why we'll use the PROGMEM utility so that the variable is written to FLASH memory.
 
  • Don't worry if you don't know HTML or javascript. We won't go into details, but we'll explain the most important ones for now.
  • On line 23, the page displays the value returned by the processor() function.
  • In line 24, the button calls the “toggleLED()” function when activated.
  • The toggleLED() function makes a GET request at address “/state” passing the toggle valceue.
  • After 1 second it refreshes the page to receive the updated value. We need to handle this request:
  • When the server receives the request at the address “/state” it calls the toggleLed() function
  • and just replies to the server that everything went fine. And last but not least: We started the server:
  • This will be our final code:
  • In our browser:

Conclusion

In this project, we saw a very simple application of the power that the ESP8266 WiFi has. In the HTML file, page styling could also be included to make the page prettier.

And with that base, it's possible to expand into several cool projects. A temperature monitor via Wifi? Security systems? Home automation systems? These are just a few examples. The limit is up to your creativity.

ESP8266 based WiFi Modules for IoT Projects

The Internet of Things (IoT) and the Industry 4.0. Distinct technological revolutions but with a common goal: To integrate equipment (digital or analog) to a computer network.

And to be part of this revolution, the developer goes out of its way to include wired ethernet modules or WIFI modules in its circuits. Which increases complexity, circuit size and development cost.

What if I told you that already has a built-in WIFI microcontroller? And that it fits in the palm of your hand? For just 1 US dollar?

Today I’m going to introduce you to the ESP8266 microcontroller, from Espressif. And for those of you who already program in 8Bit microcontrollers like the Atmega328 (one of the most common on Arduino) and struggle to build your code in the modic SRAM’s 2KB and Flash memory’s 32KB… The ESP8266 offers 32KB to RAM and 512KB to Flash Memory … expandable up to 4MB.

 Did I get your attention? So, let’s go to a summary of the specs, provided by the manufacturer itself:

  • 32-bit RISC architecture;
  • 80MHz processor (can be expanded up to 160MHz);
  • Operating Voltage of 3V;
  • 32KB of RAM memory for instructions;
  • 96KB of RAM memory for data;
  • 64KB of ROM memory to boot;
  • Flash memory preview by SPI (512KB to 4MB);
  • Wireless 11 b/g/n standard;
  • Operating modes: STA/AP/STA+AP;
  • WEP, WPA, TKIP, AES security;
  • Built-in TCP/IP protocol;
  • QFN encapsulation with 32 pins;
  • Main Peripherals: UART, GPIO, I2C, I2S, SDIO, PWM, ADC and SPI;
  • Architecture with prediction of operation in energy saving

At this point you may have noticed that I stated that the ESP8266 has a 512KB Flash memory, extendable up to 4MB, but then I said that the module only provides this memory per SPI. Before explaining this, I want to draw your attention to another important point: The ESP8266 has a WIFI module inside a QFN package. WIFI is radio frequency! And how does it work without an antenna? The answer is: It doesn’t work!

The ESP8266Ex chip (this is its full name) needs an antenna to be connected to your antenna’s specific pins as well as a FLASH memory IC.

Started to get complicated? Don’t worry. With the idea of making the chip more accessible, several modules were developed that already include an antenna and a memory chip.

Understanding the need to include an antenna for the WIFI, a memory IC in the SPI and making pins more accessible, several manufacturers started working on ore “friendly” ESP8266’s versions. Among the best known are the ESP-01, ESP-03, ESP-05, ESP-07, ESP-12E, ESP-12F and NodeMCU. All of them have the esp8266 microcontroller in common, but they vary in size, antenna availability, memory size and pin availability. There are others, but today we’ll talk a little about them.

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP8266AmazonBuy Now

ESP-01

It is the most common module in the ESP8266 range. It is compact (24.8 x 14.3 mm), the WIFI antenna is built in the board itself and has two GPIO pins that can be controlled according to programming. There are two significant drawbacks to this card:

  • The pins are not intended for connection to a breadboard. Although they fit well, they end up shorting So, they necessarily need wires to extend the pins.
  • The two available GPIOs play an important role in the board So it is necessary to pay attention to the level (high/low) when the board is initialized, or the board may mistakenly enter in programming mode. So, pins are safer operating as Outputs than as Inputs.

ESP-03

 

This version comes with a ceramic antenna, 7 GPIOs (two are those of the ESP-01 that require attention), a pair for UART, in size 17.4 x 12.2 mm. Smaller than 01? Yes! But that comes at a price: The encapsulation is another.

ESP-05

  • No GPIOs available, it actually doesn’t even have a built-in antenna.
  • This version was thought to incorporate WIFI to some other microcontroller (with the smallest possible size: 14.2 x 14.2 mm), so it has an external connector and UART pins to be manipulated by AT commands.

ESP-07

  • The ESP-07 has both a ceramic antenna and an external connector. Looks a lot like the ESP-03, but leaves the meager analog pin available.
  • In addition to incorporating a metallic cover that protects the circuit against magnetic interference.

ESP-12E and ESP-12F

Built-in antenna, 11 GPIOs, UART available, SPI available (not exactly, it’s still being used by the flash memory CI, but now you get the option to disable the memory and associate a larger one), an ADC pin (pause here to explain because it’s not that useful, The board operates with 3.3V, but the ADC is 0 – 1V. Low resolution, plus the big risk of damaging everything.).

The ESP-12E would be icing on the cake for the ESP8266’s boards, but the ESP-12F version handled an improvement in the antenna design and a little more pin protection.

NodeMCU

The NodeMCU module is to the ESP-12s as the Arduino UNO is to ATMEGA328s. A board with a protoboard compatible pinbus, all ESP-12 pins available, a 3.3V regulator to power the module (the VIN pin can receive 5V) and a UART – USB interface that turn the nodeMCU into a plug an play module.

There are versions with the ESP-12E (increasingly rare) and with the ESP-12F.

Now that we know a little more about the hardware, let’s take a look at how to program it.

There are different ways to programming the ESP8266. Different methods, different languages, among the most common, we have the ESP-IDF (manufacturer’s official. C programming) and others recommended, also, by the manufacturer: NodeMCU (Lua Script), Arduino (C++), MicroPython (you get one candy if you guess the language). It is possible to work with it in PlatformIO as well.

ESP-IDF

The ESP-IDF is the official Espressif solution. The SDK has a number of precompiled libraries and works with the Xtensa GCC compiler.

For a long time, the company has released RTOS and NON-OS versions in parallel. But since 2020 no NON-OS versions have been released (except minor bug fixes). Other modules from Espressif were born exclusive to RTOS versions, probably this was already part of the decision to bury the NON-OS. IN 2019, the company released a note stating that it would keep the main version, but that it would only operate in the correction of critical bugs. It even released some new features after that, but it doesn’t compare in quantity to the RTOS version.

This is without any doubt the most specialized tool that allows for the greatest customization at a low level. Drivers and libraries are customized for company modules. And specialization directly reflects on performance.

But the ESP-IDF lacks in complexity and size of the active community. Which ends up making the solution’s development a little slower. How does this happen? The programming is done in C- ANSI, in some cases with the directly treatment of registers, creating a more verbose code. More verbose? More chances for bugs. Also, active community is something that needs to be looked at when using any technology. Whether for creating new libraries or for sharing issues and solutions. The ESP-IDF user community exists, but it is much smaller than the others that will be presented here.

NodeMCU

The NodeMCU is an ambiguous term, it can either be used to indicate the NodeMCU module (hardware) or the NodeMCU development environment (software), both can be used together. But not necessarily. Let’s go to the software one.

The NodeMCU is a Lua-based firmware specific to the ESP8266 and uses a SPIFF (SPI Flash File System) based file system. This firmware is installed directly in FLASH memory, which allows the code’s execution in real time, without the need for compilation.

It offers a library structure for native functionality and for sensor’s integration, such DS18B20 or BME280, which make programming more dynamic.

The NodeMCU has been popular for quite some time. But it has three serious problems that have started to reduce its use.

  • The Firmware NodeMCU, installed in FLASH, takes up a lot of Especially if the full version is included.
  • It was developed based on the NON-OS version, so, firmware bugs started to get more complex to
  • The memory management is quite complex in some cases. Because it didn’t compile, some memory overflow issues could only be noticed at runtime. (This was the reason I stopped using this method).

Arduino

The Arduino platform, undoubtedly the best known in the world when it comes to microcontrollers, is also on the manufacturer’s list of nominees.

The Arduino was built as software-hardware relationship that makes microcontroller’s development more accessible to non-specialists. The hardware complexity was minimal (in some cases none) and the software started to be treated in a high-level language (C++), allowing even object orientation.

Because it is so accessible, some members of the software’s community have started to be collaborators in building libraries (Only to control LCD displays, I know four), some sensor’s manufacturers offer official versions as well. Constantly updated material. Etc. Etc.

The Arduino architecture started with the Arduino Uno board (which uses an ATMEGA328), expanded support to other boards and… for some time now, it has support for ESP8266 in different modalities. There is good compatibility with standard Arduino libraries and it has its own.

MicroPython

I Don’t know the MicroPython in practice (yet), but as the name advertises, it allows programming in Python. Like NodeMcu, it deploys a firmware to FLASH memory and has well- defined libraries for hardware usage.

The space occupied in Flash is well optimized (not even compared to NodeMCU chaos). It seams to have a very active community. As for programming complexity I don’t have much information. But if you program in Python, I think it’s worth the experience.

PlatformIO

The PlatformIO is not really a development platform, but it allows an integration with other platforms to simulate the board. If you don’t have an ESP8266 on dang yet, it might be a good choice for your first steps.

However, there is a natural limitation when simulating a module whose flagship is WIFI.

Don’t you know where to start?

Personally, I think that the Arduino environment is perfect for prototyping. It’s easy to get results pretty quickly to validate a proof of concept. But in some cases you can go beyond that. If your project doesn’t demand maximum performance from the ESP8266, even the production version can be built here.

For a project that requires a lot of hardware precision, I don’t recommend intermediaries. Nothing will perform better than IDF.

For educational purposes, our next articles will use the NodeMCU board programmed on the Arduino platform.

Latest Proteus Libraries for Engineering Students V2.0

Hi Friends! Hope you’re well today. Happy to see you around. In this post today, I’ll walk you through Latest Proteus Libraries for Engineering Students V2.0.

We have been designing proteus libraries for our blog readers for quite a while now. You might have visited our Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0. We keep working on those libraries and make sure the bugs are removed and you always get the updated version of those libraries.

We are going to share the most advanced and upgraded version of Proteus Libraries V2.0 we have designed for our readers. These libraries are more robust, fast, and efficient than previous versions. Moreover, we have converted some digital sensors to analog sensors, helping you pick from a wide range of libraries for your projects. If you think some sensors or modules are missing in the Proteus database that should be included, leave your valuable suggestion in the section below. We’ll try our best to design and simulate those in proteus.

Before further ado, let’s jump right in.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2ResistorAmazonBuy Now
3ACS712AmazonBuy Now
4DHT11AmazonBuy Now
5DHT22AmazonBuy Now
6DS18B20AmazonBuy Now
7Flame SensorsAmazonBuy Now
8Arduino Mega 2560AmazonBuy Now
9Arduino NanoAmazonBuy Now
10Arduino UnoAmazonBuy Now

Latest Proteus Libraries for Engineering Students V2.0

We’ll be covering both Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0.

Arduino Libraries for Proteus V2.0

Arduino boards are open-source electronic development boards that you can use in your projects. Arduino Libraries for Proteus V2.0 contain the following Arduino boards.

1. Arduino UNO Library for Proteus V2.0

Arduino UNO is a microcontroller board based on the Atmega328 microcontroller. We have designed Arduino UNO Library for Proteus V2.0 which you can download from the link given below. We’ve previously designed the Proteus Library for the Arduino UNO V1.0 board and the below figure shows the comparison of both V1 and V2 Arduino boards. You can see the V2 board is more compact and small-sized compared to the V1 Arduino UNO board.

In this library, we’ve also interfaced LCD with the Arduino UNO. If you find any difficulty in interfacing the board with the LCD, you can approach me in the section below. I’d love to help you the best way I can.

Download the Arduino UNO Library for Proteus V2.0 by clicking the link below:

Download Arduino UNO Library for Proteus V2.0

2. Arduino Mega 1280 Library for Proteus V2.0

Arduino Mega is an electronic board that features an Atmega1280 microcontroller. You can use this board to develop stand-alone electronic projects or you can also incorporate it into embedded projects. Again, the following figure shows a comparison between Arduino Mega 1280 V1 and V2. The V2 board is compact and small-sized compared to the V1 board.

We have developed the Arduino Mega 1280 library for proteus V2.0 which you can download to simulate Arduino Mega 1280 in proteus.

Download the Arduino Mega 1280 Library for Proteus V2.0 by clicking the link below:

Download Arduino Mega 1280 Library for Proteus V2.0

3. Arduino Mega 2560 Library for Proteus V2.0

Arduino Mega 2560 is a sophisticated, application-type microcontroller board that features an Atmega2560 microcontroller. This board comes in handy when you require more input and output pins and more memory space to store the code for your electronic project. We have developed Arduino Mega 2560 Library for Proteus V2.0 to help you simulate this board in the proteus. Moreover, we’ve also interfaced LCD with this board so if you have any questions about it, you can ask me in the section below:

]TEPImg6]

Click the link below and download the Arduino Mega 2560 Library for Proteus V2.0.

Download Arduino Mega 2560 Library for Proteus V2.0

4. Arduino Mini Library for Proteus V2.0

Arduino Mini is a small-sized, powerful open-source microcontroller board based on the Atmega328 microcontroller. The board is 1/6th of the size of the Arduino UNO board and can easily rest on hard-to-reach places. We have designed Arduino Mini Library for Proteus V2.0 that you can download to simulate Arduino Mini in Proteus.

Click the link below and download the Arduino Mini Library for Proteus V2.0:

Download Arduino Mini Library for Proteus V2.0

5. Arduino Pro Mini Library for Proteus V2.0

Arduino Pro Mini is a small-sized microcontroller board that includes an Atmega328 microcontroller. The Proteus library V2.0 is designed for Arduino Pro Mini, moreover, we have also interfaced the board with the LCD 20x4.

Click the link below and download the Arduino Pro Mini Library for Proteus V2.0.

Download Arduino Pro Mini Library for Proteus V2.0

6. Arduino Nano Library for Proteus V2.0

Arduino Nano is a powerful and bread-board-friendly microcontroller board based on ATmega328p/Atmega168 microcontroller. We have developed the Arduino Nano Library for Proteus V2.0 which you can download to simulate Arduino Nano in the Proteus workspace.

Click the link below and download the Arduino Nano Library for Proteus V2.0:

Download Arduino Nano Library for Proteus V2.0

Analog Sensors Libraries for Proteus V2.0

Analog Sensors Libraries for Proteus V2.0 contain the following Analog Sensors.

Vibration Sensor Library for Proteus V2.0

An analog vibration sensor, also known as a piezoelectric, is mainly employed to detect the vibration of industrial machinery. The sensor gets activated if the vibration of the machines goes above the standard value. Vibration sensors are used to monitor the small changes in temperature, acceleration, pressure, and force.

We have done a little work and designed Analog Vibration Sensor Library for Proteus V2.0. Earlier we designed the proteus library for V1 version analog vibration sensors. The V2 version is more robust, compact, and advanced compared to the V1 version. Four vibration sensors are included in the proteus library and they have both digital and analog output pins which you can interface with Arduino boards or microcontrollers.

You can download the analog vibration sensor library for proteus V2.0 by clicking the link below:

Download Vibration Sensor Library for Proteus V2.0

Sound Detector Sensor Library for Proteus V2.0

A sound detector sensor is used to detect the sound in the environment. This sensor is only used for sound detection, not for sound recognition.

We have designed the Sound Detector Sensor Library for Proteus V2.0 that you can download to simulate this sensor in proteus. An LC filter is used on the analog output of the sensor since we need to convert the peak to peak voltage into Vrms. Know that you don’t require this LC filter in the real sensor circuit. We have simulated two sound detector sensors in proteus as they have different outputs because of different voltages on the test pin.

Click the link below and download the Sound Detector Sensor Library for Proteus V2.0:

Download Sound Detector Library for Proteus V2.0

Analog Flex Sensor Library for Proteus

An Analog flex sensor, also known as a bend sensor, is a special type of sensor used to detect the value of bend in the application. This sensor is mainly employed indoor sensors, robot whisker sensors, and stuffed animal toys.

We have developed an analog flex sensor library for proteus that you can download to simulate this sensor in Proteus. Know that Test Pin is included in the pinout of this sensor in proteus only, you won’t find this pin in the real sensor. This pin will determine the value of the bend. The HIGH value at this pin will give the value of bend and the LOW value at this pin will indicate there is no bend. We have also interfaced the Arduino board with the sensor where the analog input pin of the board is connected with the voltage appearing across the voltmeter.

Click the link below and download the Analog Flex Sensor Library for Proteus:

Download Flex Sensor Library for Proteus

Analog PIR Sensor Library for Proteus

PIR (Passive Infrared) sensor is a small, inexpensive, low-power sensor used to detect heat energy in the surrounding. The sensor monitors if the human body has come in or out of the sensor’s range.

We have designed Analog PIR Sensor Library for Proteus that you can download to simulate this sensor in Proteus. Moreover, we’ve also developed a simulation of this PIR sensor with an Arduino board. Know that, besides Arduino boards, you can also interface this sensor with PIC or Atmel microcontrollers. We’ve added four PIR sensors file in the proteus that are the same in terms of working but they come in a different color. Again, a test pin is added in the pinout of this sensor in proteus only, you won’t find this pin in real. This pin is added to sense the motion in the proteus workspace.

Click the link below and download the Analog PIR Sensor Library for Proteus:

Download PIR Sensor Library for Proteus

Water Sensor Library for Proteus

A water sensor is a sensor used to sense the presence of water. The water’s electrical conductivity is measured using this sensor to sense the presence of water. This sensor is widely used in applications where we need to monitor rainfall, water level, and water leakage.

We have designed the water sensor library for proteus which you can download to simulate this sensor in proteus. The Test pin is added to detect the water in the proteus simulation. We’ve also interfaced this sensor with the Arduino board where we have connected the analog input pin of the Arduino board with the output of the water sensor appearing across the voltmeter.

You can download the water sensor library for Proteus by clicking the link below:

Download Water Sensor Library for Proteus

Soil Moisture Sensor Library for Proteus

A soil moisture sensor is employed to analyze the water content in the soil. The sensor uses capacitance to monitor the dielectric permittivity of the soil which defines the function of the water content.

We have designed the Soil Moisture Sensor Library for Proteus where we have connected the test pin with the variable resistor. This resistor is used to define the soil moisture content in the proteus simulation. The maximum resistance on the test pin shows zero volts across the voltmeter, referring to the zero moisture value of the water content. The sensor is also interfaced with the Arduino board as shown below.

Click the link below and download the Soil Moisture Sensor Library for Proteus:

Download Soil Moisture Library for Proteus

IR Proximity Sensor Library for Proteus

The IR proximity sensor is used in robots to detect obstacles. This sensor is widely used for path navigation and obstacle avoidance in electronic projects.

We have designed the IR Proximity Sensor Library for Proteus which you can download to simulate this sensor in Proteus. The Test pin is used for hurdle detection. HIGH value on this pin means there is an obstacle in front and LOW value on this pin means there is no hurdle.

LC filter is included in the simulation which you don’t require in real. This filter is used to convert the Peak to Peak value we get on Proteus into the Vrms value.

[TEPImg16]

You can download the IR proximity sensor library for proteus by clicking the link below:

Download IR Proximity Sensor Library for Proteus

That’s all for today. Hope you find this article 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. Thank you for reading this article.

FET: Definition, Symbol, Working, Characteristics, Types & Applications

Hello friends, I hope you all are happy, healthy and, content. We have been discussing transistors lately, from the basic definition to the types and characteristics of transistors we have covered it all. If you have a brief idea about transistors, you must be aware of the field effect transistor or you might have heard or read about it somewhere, it is one of the earliest known types of transistors which is our topic of discussion today.

Field Effect Transistors were made to cover up the lacking of previously known transistors which occupied large space and produced a lot of noise, another major problem was the low reliability of previous versions. So, let's get started with the FETs.

Definition of Field Effect Transistor

Let us define field effect transistor first,
  • "The Field effect transistor is a unipolar transistor made up of semiconductor material, which uses an electric field to control the current flow."

History of Field Effect Transistors

  • To know how the field effect transistors evolved throughout the ages, let us have a quick trip to history, the days when we did not have a large amount of resources to materialize our concepts.
  • The first attempt to make a field-effect transistor was made by Julius Edgar in 1925, and sadly he failed miserably but he was lucky enough to get the concept patented.
  • In 1934, Oscar Heil tried his luck but failed to make a successful attempt.
  • In 1945, the Junction field-effect transistor was the first FET device to be constructed by Heinrich Welker.
  • In successive years several attempts were made and different types of materials were introduced for making field-effect transistors and their related types. All these successful and unsuccessful attempts led to the formation of the modern-day Field Effect Transistor.

Unipolarity of Field Effect Transistor

Unipolarity of the field effect transistor means that the transistor uses either holes or electrons for working, depending on the type of material being implied for making, unlike the bipolar junction transistors which employ both the electrons and holes for their functioning.

Symbol of Field Effect transistor_ FET

  • The following figure shows the symbol of a field effect transistor.
  • Three terminals can be seen in the figure namely gate, source, and drain represented by D, G, and S.
  • The direction of the arrowhead reflects the direction of the electric field.
  • The symbol is slightly different for two different types of field-effect transistors FETs, they can either be N channel FET or P channel FET, you will learn the symbols of different FETs in their respective sections of this article.

Why Field Effect Transistors are named so, or what is the meaning of FET?

Now you must be thinking about how the field effect transistor got its name? What does it mean by a FET? There are multiple assumptions behind it, the one that I felt to be appropriate is the one that, a weak electrical signal entering through an electrode generates a larger electric field through the other parts of the transistor as well, so they are named field-effect transistors. If you know any other reason, why we call them field effect transistor other than this, you can let me know in the comment section below, I'm looking forward to your response!

BJT vs FET

A lot of times, FET is compared with the BJT let's have a brief overview of their peculiarities in this section. These are some of the significant differences between the two of them;

  • BJT is a bit noisy than FET.
  • BJT has a higher output impedance than FET.
  • BJT is current controlled meanwhile FET is voltage controlled device.
  • BJT has a lower input impedance than FET.

Working of Field Effect Transistor FET

Basic construction of a field effect transistor FET

Unlike the other types of transistors, the field effect transistors are not made up of typical collector, emitter, and base, although the number of components is the same but the name and functions of each component are entirely different. To understand the working of the field effect transistor, let us first discuss its basic components one by one.

Source
  • The source is represented by the symbol S. It acts as an electrode of the field effect transistor through which the charge carriers enter the channel when voltage is applied.
  • As the name suggests, the source of a field-effect transistor works as a providing source of charge carriers.
Gate
  • It is represented by the letter G, wherever you see a G, immediately assume it's a field effect transistor, in the case of transistors. The conductive story of the field effect transistor begins with applying the voltage to the Gate, which is passed on to the other components.
Drain
  • The drain is represented by symbol D. The drain is the electrode of the field effect transistor which provides the channel to charge carriers helping them leave the circuit.

Working of FET

  • As you have a brief idea about the main components of a Field Effect Transistor and their function, we are going to discuss the working of FET.
  • The current always flows from the source S towards the Drain D.
  • A voltage is applied across the Gate and Source terminal which creates a conductive channel between the source S and Gate G.
  • The electrons or holes flow from the source S to Drain D in the form of a stream through the channel.
  • There are several other things involved in the working and function of a field effect transistor according to their types, which we are about to discuss in respective sections. So, stay tuned!
  • Here arises a simple question which is often left unasked and answered too, why the field effect transistors FETs are called voltage-controlled devices?
  • The FETs are called voltage-controlled devices because the current in the drain represented as ID depends on the voltage across the gate G, unlike the bipolar junction transistor which is a current-controlled device.
  • The gate voltage is very important for the conduction of current towards the Drain.
  • There are two phenomena that influence it one is depletion of the channel and the other is the enhanced state of the channel. Let us discuss them one by one.
  • Depletion of channel: Consider an N channel FET, it has the majority of electrons as charge carriers, by making the gate more negative we would repel the electrons from the gate and these electrons would saturate the channel increasing its resistance. This makes the gate region thinner because of the minimal traffic of electrons, but the conduction channel is said to be depleted due to increased resistance.
  • Again consider the n channel FET, now think yourself, what would happen when you will make the gate G of the FET is more positive? The traffic of electrons would rush towards the gate! It would make the gate region thicker due to greater traffic but on the parallel lines, the conduction channel would be enhanced due to less resistance.

Types of Field Effect Transistor

We can divide the field effect transistor into the following types based on their structure;
  • Junction Field-effect transistor JFET
  • Metal oxide Field Effect Transistor MOSFET

Junction Field-effect transistor JFET

  • Junction field effect is one of the simplest types of field effect transistors.
  • They are unipolar in function and either work with electrons and holes, the same thing which is peculiar to the simple field effect transistors.
  • The junction field-effect transistor has a very high input impedance level.
  • Unlike the bipolar junction field-effect transistor, it makes a little noise or is somehow silent as compared to it.
  • The structure of the Junction Field-effect transistor is based on its type, in general, JFET is made up of two n-type and one p-type semiconductor material and vice versa.
  • The symbol of the junction field effect transistor is as follows;

Types of JFET

There are further two types of junction field effect transistors
  • N Channel Field Effect Transistors
  • P Channel Field Effect Transistors
We will now discuss these two types of junction Field Effect Transistors - JFET in detail.

N Channel Field Effect Transistors

Construction of N Channel FET Let's discuss the construction of N channel Field Effect Transistor first,
  • A bar of n-type semiconductor material primarily silicone is taken which acts as the substrate.
  • The bar is then diffused with two p-type silicone bars which are smaller in size than the n-type silicon bar, on the two extreme ends of the substrate bar. Just imagine you are placing and gluing two small blocks on the extreme right and extreme left sides of a larger block made up of wood or any material you can stick together!
  • Now we are done with diffusing the p-type materials into our n-type substrate, the leftover region conducts the current and is labeled as Channel. These channels are responsible for the conductive action of the Field Effect Transistors when voltage is applied.
  • After we are done with the formation of the channel, we will now see how the main parts such as Gate, Source, and Drain are formed out of these diffused semiconductor blocks.
  • The two diffused p-type silicon bars which have now formed the PN junction with the n-type material are now joined together to form the Gate.
  • The two ends of the channel which was formed earlier after the diffusion process are metalized to be converted into source and drain.
  • The N channel Field Effect Transistors imply electrons as the majority charge carriers. They are more efficient than the p channel junction Field Effect Transistors because electrons travel faster than the holes.

P channel junction Field Effect Transistors

Construction of P channel FET
  • The same process is repeated for the construction of the p channel junction Field Effect Transistor.
  • The p-type material substrate is taken in form of a large wafer or bar and then diffused with two smaller n-type bars.
  • The channel formed after diffusion is then metalized at both ends to form the source and drain.
  • The PN junction formed by the two n-type semiconductor materials is then connected to form the Gate.
  • So this is how the p channel junction Field Effect Transistors are constructed.
  • The p channel junction Field Effect Transistors imply holes as Majority charge carriers as they are unipolar.

Working of Junction Field Effect Transistor

  • The Junction Field Effect Transistor always works in reverse biasing condition, that is why they have a very high input impedance.
  • In the case of the Junction Field Effect Transistor, the gate current is Zero which is denoted by; IG=0
  • The input voltage which is represented by VGS is the controlling factor for the output current which is represented by ID.
  • You must be thinking how we control the width of the channel through which the current is conducted? The answer is simple, we alter the width of the PN junction on both sides of the channel which increases resistance to the flow of current.

As we already know that the Junction Field Effect Transistor only works in reverse biasing conditions let us now discuss a few scenarios to know how the output is generated under different circumstances.

Zero biasing condition of Junction Field Effect Transistor

  • When no external voltage VGS is applied to the gate the resulting voltage to the drain would be zero which can be written as VGS = VDS = 0
  • The depletion regions would have the same thickness as they had earlier because the voltage is not being applied yet.
  • In this zero biased condition the drain current is produced, let me tell you how! The charge carriers in the absence of a potential difference start moving from the source to drain producing a drain current that is opposite to the conventional flow of current.
  • So in the zero biased condition, only drain current exists in Junction Field Effect Transistor.

Reverse Biasing condition of Junction Field Effect Transistor

Small Reverse Voltage application scenario
  • In the presence of a potential or small voltage the gate-source voltage VGS on which the Drain current ID is dependent, on applying small reverse potential width of the depletion region increases.
  • Due to the increase in the width of depletion regions on both sides, the channel finds it difficult to conduct current.
  • This difficulty of the channel to conduct current results in voltage drop.
  • The width of the depletion region increases more towards the drain terminal, one can think of it as accidental but in science, nothing exists within reasoning and logic, the depletion region increases more towards the drain because the voltage drop is higher at the drain side.
  • There is a lesser amount of Drain current ID because of the shrinkage of the conduction channel.
Large reverse voltage application scenario
  • In this case we apply a higher negative voltage which is our Gate to Source voltage, represented by VGS
  • The depletion regions of both the corresponding PN Junctions, keep on increasing in width.
  • Eventually, both the depletion regions meet each other or you can say touch each other.
  • Here is a question for you, what would happen when both the depletion regions would meet or diffuse into each other? They would eventually block the conduction of the current!
  • The point at which the particular voltage blocks the conduction channel completely is called the cut-off voltage or sometimes pinch-off

MOSFET_  metal-oxide field-effect transistors.

The second type of field-effect transistors is the  MOSFET, metal-oxide field-effect transistors.

Metal-oxide field-effect transistors are one of the most common types of transistors used widely.

Features of MOSFET

  • The MOSFET consumes lesser power than other transistors.
  • They are exceptionally scalable and if you remember Moore's law, they are the best practical manifestation of it.
  • MOSFETs have high switching speeds that is why they are used for generating pulse trains. Do you know what is a pulse train? A pulse train is the square waveform of asymmetrical waves which are periodic but non-sinusoidal in nature.
  • .metal oxide field-effect transistors are considered ideal for digital circuits, analog circuits, and linear circuits as well.
  • Sometimes metal-oxide field-effect transistors - MOSFETs are also called IGFET, Insulated Gate Field-Effect Transistors.

Basic Structure of MOSFET

  • Let us now discuss the basic structure of metal oxide field-effect transistors MOSFET.
  • The metal oxide field effect transistor MOSFET has four components, unlike the JFET.
  • The components of MOSFET include Source S, drain D, body B, and Gate G.
  • The gate is separated by the body of the transistor through the insulating material
  • MOSFET is very similar to the JFET, but the main difference lies in the insulation of Gate Electrode from the conduction channel, either P channel or N channel, with the help of a thin layer of primarily SiO2 or Glass.
  • The insulation of the Gate terminal with the metal oxide layer helps in increasing the input resistance. The insulation can increase the value of input resistance into Mega Ohms.
  • For a detailed outlook on the MOSFET, its construction, working and applications you can refer to the detailed article present on our website.

Symbol of The metal oxide field effect transistor MOSFET

  • The following symbol is used to represent MOSFET.
  • The Arrowhead indicates the direction of current and I already know that you are aware of this!
  • Now you must be thinking, why the symbolic representation is only showing three terminals, please do not search for the fourth one! Because the source is always attached to the body terminal and is represented as one terminal.
  • So you can only spot the three terminals naming Gate G, Drain D, and Source S.

Types of MOSFET

Following are the four commonly known types of MOSFET;
  • N-Channel Enhancement mode MOSFET
  • P-Channel Enhancement mode MOSFET
  • N-Channel Depletion mode MOSFET
  • P-Channel Depletion mode MOSFET
Detailed outlook on all these types of MOSFET can be found in our article regarding MOSFET.

Characteristics of FET

  • The Current Voltage, I-V characteristics of the Field Effect Transistor is plotted between the applied voltage VDS and Drain Current ID.
  • The graph for studying the characteristic curve of a field effect transistor_ FET is plotted between the varying values of Drain Current represented by ID along the y-axis, with the varying values of VDS along the x- axis.
The graph shows the following regions;
  • Ohmic Region
  • Cut off region
  • Saturation or Active Region
  • Breakdown region
Refer to the graph for better understanding. We will now discuss each of the regions in detail.

Ohmic Region

  • This is the extreme left side of the graph which represents the value of Drain Current ID when the applied voltage of the transistor between the source and gate is Zero i.e VGS= 0
  • The conductive channel is small but not narrow in this case.
  • Depletion regions on the corresponding sides are equal in size and haven't started expanding yet.
  • Our Field effect transistor acts as a voltage controlled resistor at this instance of the IV characteristics curve.

Cut-off Region

  • This is the second region of our graph represented by purple the purple lines.
  • This cut-off region is also called as pinch-off region because the VGS voltage , the one which controls the current of the transistor is terribly high enough to make the circuit work as an open switch.
  • At the pinch off region the conductive channel for current is almost closed due to the Increased thickness of depletion regions on both sides.

Saturation Region

  • The saturation region is also called the active region of the graph.
  • In this region the Field effect transistor acts a good conductor.
  • The value of applied Voltage VGS, the voltage between gate and source drives the transistor.
  • The Drain Source Voltage VDS has minimal effect on the current ID of the transistor at this very instant.

Breakdown Region

  • This is the last and terminal region of characteristics curve for the field effect transistor, you can observe this region on the extreme right corner.
  • The Voltage between the source and drain represented by VDS is very high at this point.
  • The voltage is high enough that the conductive channel is broken and maximum current passes through the channel into drain.

Applications of Field Effect Transistors

  • Field Effect Transistors have revolutionized the electronic world, there is an endless list of uses of field effect transistors, we are going to discuss a few important ones in this section.
  • Field Effect Transistors FETs are frequently used in Integrated Circuits because of their smaller size and compactness.
  • FETs are used in operational amplifiers as VRs, Voltage Variable Resistors.
  • They are also used in tone controls for mixer operations on TV and on FM as well.
  • Field Effect Transistors are also used in logic gates.
  • Field Effect Transistors are widely used in the production of digital switches as well.
We will now discuss some of the most advanced applications of field effect transistors now,

FET as Buffer Amplifier

  • First things first ,let us first discuss what does a buffer do? A buffer makes sure that the signal either digital or analog is successfully transferred to the preceding wave.
  • A voltage buffer helps in amplifying the current without disturbing the actual voltage level.
  • So, as you are well aware of the function of a buffer, we will discuss how a Field Effect Transistor acts a buffer amplifier.
  • A buffer amplifier separates the previous stage of the signal from the next upcoming stage, drain of the Field Effect Transistor works for this purpose.
  • Lastly , you must be thinking which characteristic property helps the Field Effect Transistor in achieving this, i have the answer for this question of yours! The high input impedance and low output impedance make a Field Effect Transistor an excellent buffer amplifier.

FET as Analog switch

  • We have been discussing the use of Field Effect Transistors in analog and digital switches lately, we will be discussing their use in analog switches now.
  • We have discussed it earlier as well in our characteristics curve and operational scenarios of the Field Effect Transistor when the output voltage equals the input voltage making the FET works as a switch.
  • When the VGS which is the gate source voltage as you already know is absent, the FET works as a small resistance , although a little bit of drain current is present but its value is almost negligible.
  • The mathematical expression can be written as

VOUT = {RDS/ (RD + RDS (ON)}* Vin

  • If you remember, the cuttoff region of I-V characteristics curve of our Field Effect Transistor, when the max negative voltage is applied to the Gate source region and eventually the Field Effect Transistor_ FET starts acting as a very high resistance.
  • That resistance lies in the range of Mega Ohms.
  • In this case the output voltage Vout is nearly equal to the input voltage which was VGS.

FET as Phase shift oscillator

  • Field Effect Transistors are ideal to be used as phase shift oscillators.
  • Phase shift oscillators are used to generate signals with wide range of frequencies.
  • Field Effect Transistors can be used for amplifying as well as for feedback loop operation, that is the reason they are excellent to work as phase shift oscillators.
  • Field Effect Transistor_ FETs have high input impedance, so there is a very less loading effect when they are used as phase shift oscillators.
  • Most of the times N channel JFETs are used for this purpose.
  • You can observe the Field Effect Transistors as phase shift oscillators in GPS units, musical instruments and many other places where audio signals are modulated such as voice synthesis.

FET as Cascode amplifier

  • The word case code has been derived from the phrase " Cascade to Cathode".
  • Cascode circuits are made up of two components, the first one is the transconductance amplifier and the second one is the buffer amplifier.
  • Cascode amplifiers are generally made using Field-Effect Transistors due to their high input resistance.
  • We use cascode amplifiers because of their quality of having low input capacitance, otherwise, the normally used common amplifiers have a higher value of input capacitance in general than the cascode amplifiers.
  • Although the voltage gain is the same for both the amplifiers which is again a win-win situation for
  • Cascode amplifiers using Field-Effect Transistors.

FET in Multiplexer

  • Let us first discuss the function of a multiplexer, a multiplexer collects different signals from different sources to present as a single output signal. Imagine a whole year of hard work and the end result is summarized in a single result card after the exam!
  • Junction Field-Effect Transistors are used to construct the multiplexer circuit.
  • Each Field Effect Transistor act as an SPST.
  • In case you don't know about the SPST, let me tell you, it is the single pole single throw switch that generates one output from one input.
  • An SPST is used as an on-off switch in circuits.
Consider the circuit diagram given below;
  • All input signals get blocked when the control signals are made more negative than the Gate source voltage VGS.
  • This condition blocks all the input signals.
  • By turning any one of the control voltages V1, V2, or V3 to zero we can obtain a single desired output wave.
  • Consider if ye turn V2 to Zero we will obtain a triangular signal.
  • If we turn V3 to zero, you can yourself figure out from the circuit diagram, the wave signal you would get, Go! Scroll up!
  • So this is how the Field Effect Transistors are used in multiplexers.

FET as Low noise input amplifier

  • How you define noise? A sound that is unpleasant to the ears or when talking of signals a disturbance that causes unnecessary turbulence in the desired output making it meager or weak.
  • Noise is produced in many mechanical and electrical instruments but sometimes for a few things it is tolerable and sometimes it is not!
  • Just imagine disturbing noise when you are streaming a video or audio, a loud signal which blurs out music during your sunny beach day on your radio, nobody wants that! That is why Field effect transistors are used for low noise amplification.
  • Noise has nothing to do with signal strength which is why it is always there, even when you have ended your live stream!
  • Noise production is a drawback of many electronic devices but the bright side is that our Field effect transistors make a little less noise especially if they are used in the front end of the signal receiver.
  • Field-effect transistors are a bit noisy too, but I have a solution for it, MOSFETs are used where even a little bit of noise can't be tolerated, don't worry we would talk about MOSFETs in our next article!
  • So, lastly, we can say that, if we use a Field-effect transistor_ FET on the front end, there is lesser amplification of undesirable signal in our generated output.

FET as Current limiter

  • Junction Field Effect transistors can be used to make a current limiting circuit.
  • By this characteristic and arrangement, constant-current diodes and current regulators are made, let's discuss the process, but firstly refer to the circuit diagram for better understanding.
  • When there is an excess of supply voltage due to any discrepancies in the system, the Junction Field Effect transistor immediately starts operating in its active or saturated region, I hope, by now you are well aware of the active region of the Junction Field Effect transistor, if not, refer to the section of I-V characteristics graph and its explanation!
  • At this instance, the Junction Field Effect transistor acts as a source of the current itself and prevents any further load current.

So friends, this last segment concludes our discussion on Field Effect Transistors(FET), I hope you have learned something new from this discussion. For any suggestions or constructive criticism or a little bit of appreciation, you can use the comment section below. See you soon with the next topic, have a good day ahead!

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