proximity Archives - Electronic Guidebook https://electronicguidebook.com/tag/proximity/ A place to help you with your electronic needs Fri, 17 Sep 2021 00:14:58 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 https://electronicguidebook.com/wp-content/uploads/2020/02/cropped-electronicGuidebookLogoTransparent-1-32x32.png proximity Archives - Electronic Guidebook https://electronicguidebook.com/tag/proximity/ 32 32 230945861 What are ultrasonic sensors?An in-depth guide https://electronicguidebook.com/what-are-ultrasonic-sensorsan-in-depth-guide/?utm_source=rss&utm_medium=rss&utm_campaign=what-are-ultrasonic-sensorsan-in-depth-guide Fri, 17 Sep 2021 00:14:54 +0000 https://electronicguidebook.com/?p=983 Imagine not having your five senses! How would you navigate the real world?  Our five senses help us make ‘sense’ (pardon the pun) of the physical world around us. They help us see (sight) where we are going, hear (sound) music, feel (touch) raindrops, smell perfumes and taste foods.  They do much more than those […]

The post What are ultrasonic sensors?An in-depth guide appeared first on Electronic Guidebook.

]]>
Imagine not having your five senses!

How would you navigate the real world? 

Our five senses help us make ‘sense’ (pardon the pun) of the physical world around us. They help us see (sight) where we are going, hear (sound) music, feel (touch) raindrops, smell perfumes and taste foods. 

They do much more than those things of course, but you get the jist.

Sensors in the electronic world play pretty much the same role (and probably why they are called sensors for that reason).

They help computing and electronic systems by allowing them to get physical real world data.

One of those sensors helping these types of systems and used in many applications is the Ultrasonic Sensor.

But, what exactly are ultrasonic sensors?

Ultrasonic sensors are a type of proximity sensor which are used for detecting the distance of an object, or the presence of objects, without the need of physically making contact with those objects. The ultrasonic sensor uses ultrasonic sound waves (hence the name) to detect objects.

This is just the tip of the iceberg when it comes to the ultrasonic sensor. If you want to learn more about these awesome sensors, read on! 

Deeper look at sensors

Since an ultrasonic sensor is a subcategory of Proximity sensors, which is furthermore a subcategory of the broader term Sensor, it will help to learn a bit more about sensors, as well as proximity sensors. 

But, if you aren’t too concerned with learning about sensors or proximity sensors, you can skip straight to the section all about ultrasonic sensors. 

What is a sensor

Computing and electronic systems in the most simplest form consist of inputs, a processor and outputs.

Let’s consider a computer. It has inputs (mouse, keyboard), a processor (Central Processing Unit), and outputs (printer, speakers, monitor).

So what is a sensor? 

A sensor is a type of input device whose main function is to ‘sense’ physical changes in the environment (real world) and provide this information to the processor of the system. 

Us humans have our own sensors. 

Five of them!

We have the ability to make sense of the environment around us through Touch, Smell, Sight, Taste and Sound. 

Just like a computing system, we too also have a processor (our brain), and outputs (arms, legs).

So, imagine you are at a party and the DJ plays your favourite song.

You are able to sense the sound waves traversing the airwaves using one of those five senses (in this case sound through your ears).

This information is sent to your brain (processor) which realises this is your favourite song! It then informs your body(output) to move uncontrollably (or controllably depending on your dancing skills) to the beat of the song. 

Sensors in computing and electronic systems work in the same manner. They provide information from the world to the processor who can deal with that information as needed. 

For example, let’s take a look at a fan heater. 

This fan heater will have a temperature sensor which has the job to sense the ambient temperatures to ensure that the temperature you set is maintained. 

If temperatures start to rise, the sensor will sense this rise, and then relay this information to the processor. The processor can then suspend heating until temperatures fall back to the levels you set. 

Why we use sensors

But, are sensors really that essential? 

The simple answer is yes! 

There are many benefits to using sensors in systems. 

Let’s go back to the heater. If it did not have a sensor, the temperature would rise above the level you set making the room hotter than you would like. 

Sensors provide a means of feedback so that changes can be made if needed.

Other advantages include;

  • Making systems more efficient
  • Predictive and preventative maintenance
  • Increasing accuracy 

What are proximity sensors?

Now that we know what role a sensor has in a computing or electronic system, we can take a closer look at Proximity Sensors.

Just like we have different sensors that have different roles, and function in different ways, the electronic world has many different types of sensors each with its own unique sensing ability. 

There are sensors to detect temperature, smoke, gas, altitude, speed, acceleration, and many more. 

What about a proximity sensor? What does it do? 

Proximity sensors are a classification of sensors that have the ability to detect objects without the need of physically touching them. 

However,you aren’t limited to only one type of proximity sensor to achieve this. There are a variety of technologies used such as light, sound, infrared, electromagnetic, and capacitance, in proximity sensors that give them the ability to detect objects.

However, the main type of proximity sensor that we are concerned with in this article are Ultrasonic Sensors

What are ultrasonic sensors?

So, how does an ultrasonic sensor detect objects without physical touch?

An ultrasonic sensor detects objects using ultrasonic sound waves (hence the name). 

Ultrasonic sound waves (or ultrasound) sit at a frequency (greater than 20kHz) much higher than the upper audible limits that the human ear is capable of hearing (which is around 20kHz).So, you won’t hear any annoying sounds when near ultrasonic sensors.

However, while you might not be able to hear it, the physical properties of ultrasound do not differ from normal sound that we hear.  

Construction of an ultrasonic sensor

A typical ultrasonic sensor is broken into two parts;

  • Transmitter (generates the sound waves)
  • Receiver (which captures the sound waves when it reflects back from an object)

Below is a picture of what a typical ultrasonic sensor looks like. 

To achieve the high sound frequencies, the ultrasonic sensor uses Piezoelectric Crystals. They oscillate at a high range of frequencies. 

A typical ultrasonic sensor comes with 4 pins;

  • VCC (connects to the positive rail of the power supply. Usually +5V)
  • TRIG (connects to a digital output pin of a microcontroller)
  • ECHO (connects to a digital input pin of a microcontroller)
  • GND (connects to ground rail of the power supply)

I shall explain more about the connections of the ultrasonic sensor with a microcontroller later on. 

Working principle of an ultrasonic sensor

Let’s take a look at how this sensor goes about using ultrasound to find an object.

Looking at an example will help make things a bit more clearer.. Below is a diagram of an ultrasonic sensor placed in front of a wall. 

  1. The first step involves the ultrasonic sensor converting electrical energy to a sound wave. This sound wave is emitted from the ultrasonic transmitter.  
  1. Next, the sound wave travels through the air until it encounters an object, person, animal, etc (in this example a wall) 
  1. The sound wave then hits the object (wall) and reflects back toward the ultrasonic sensor
  1. Finally the receiver of the ultrasonic sensor receives the reflected wave and a time stamp is calculated with the help of a microcontroller.(I shall explain in more detail how to calculate the distance using this time variable in the next section) 

How to calculate the distance of an object using an ultrasonic sensor?

Calculating the distance of an object using this sensor comes down to a fundamental equation which you would have learned about in high school science class, along with the fact that we know that the speed of sound, which is roughly 343 m/s (through dry air at around  20 °C).

Below is a fundamental equation to calculate speed, distance and time, which you might recall from science class;

Where V represents speed, d is distance and t is time.

Rearranging this equation to calculate distance we get;

We know that sound travels around 343 metres/second, so the next thing we need to calculate the distance of an object is time (which is obtained from the ultrasonic sensor). 

Note, the time value needs to be halved to calculate the distance of the object. This is because the time value the ultrasonic value will present to us, is the time it takes the sound wave to leave the transmitter, hit the object and return back to the transmitter.

We just need the time for the first part (which is the sound wave hitting the object) to calculate the distance of the object. 

To do this, we can either halve the time value when calculating the distance, or halve the total distance value at the end.

Let’s look at an example to clear things up. 

Say there is a wall about which you are trying to calculate how far away it is. The ultrasonic sensor gives you a time value of 0.005 seconds.

Option 1

Take this time value and divide it by 2. This now gives us a time value of 0.025 seconds.

Now, use this value and the speed of sound (343m/s), to calculate the distance. This gives us; Distance = 0.025 x 343 = 0.8575 meters.

Option 2

Use the initial value the ultrasonic proximity sensor gives us, calculate the distance and then divide it by 2. 

So, first calculate the distance; d = 0.005 x 343 = 1.715 meters. Now, take this value and halve it; 1.715 / 2 = 0.8575 meters.

So, using either option will yield the same result. 

Another important note is to make sure you are using the same units in your calculations. If you are calculating for meters per second, ensure your time values are in seconds and not milliseconds. 

What do I mean by this? 

Well, that time value we obtained from the ultrasonic sensor, can be either 0.005 seconds or 5 milliseconds. 

However, since the speed of sound is metres per second (m/s) and not meters per millisecond (m/ms), you will need to use time in the form of seconds which is 0.005. 

Can an ultrasonic sensor be used on its own?

No, unfortunately it cannot be used on its own. 

The ultrasonic sensor needs a microcontroller or microprocessor to unleash its full potential.

A microcontroller has two main functions when used with the senor;

  • Trigger the sensor to transmit a wave
  • Obtain the time of the reflected wave and calculate distance

Trigger the ultrasonic sensor to transmit a wave

The first function the microcontroller has is to trigger the ultrasonic sensor to transmit a sound wave. 

To do this, the TRIG pin on the sensor needs to be high (+5V) for a duration of around 10 microseconds (the ultrasonic sensor’s datasheet will also have the exact value it needs to be high for).

A microcontroller has many capabilities from analog to digital conversion, timing, serial communication, digital to analog conversion, and much more.

It also has a set of Digital Input and Output pins with each pin being bi-directional (this means you can assign a specific pin to be either an input or an output when programming the microcontroller). 

These digital pins allow you to control a wide variety of outputs (motors, LED’s, fans, etc), and gather information from many different types of inputs (buttons, switches, sensors, etc).

When set as an Output, the pin can be set to be either a Logic High (+5V), or a Logic Low (0V).

This is perfect for an ultrasonic sensor! You can connect the TRIG pin to one of the Digital I/O pins which has been set to an output. 

You then just have to program the microcontroller to make the TRIG pin a logic high, set a delay for 10 microseconds and then make the pin a logic low. 

The ultrasonic sensor will then transmit a sound wave. 

Calculate the time of the reflected wave

Earlier in the working principle section, I mentioned that the timestamp is calculated with the help of a microcontroller. This is because the ultrasonic sensor does not have the ability to calculate time on its own.

Lucky for us, the microcontroller also has the capability of timing using a set of Timers. 

Timers have many applications with the two main ones being; generating time delays, and measuring the time between two events.

‘Measuring the time between two events’ is perfect for use with the ultrasonic sensors. This means that we can measure the time between the Sound wave transmitted, and the Receiver receiving the reflected wave.

Another key pin of the sensor is the ECHO pin which gets connected to a digital pin of the microcontroller that is set as an input.  

When the receiver of the sensor detects the return of the reflected wave, the ECHO pin is set to a ‘logic low’ which is then read by the microcontroller. This helps us know when to stop the timer. 

Below are the sequence of steps of what happens inside a microcontroller’s code from triggering the ultrasonic sensor to calculating the time. 

  1. Trigger ultrasonic sensor to transmit a sound wave via TRIG pin
  2. Start the timer 
  3. Reflected wave returns, and is detected by sensor’s receiver
  4. ECHO pin goes low
  5. Stop the timer
  6. Acquire time value
  7. Calculate distance

Ultrasonic sensor connection to a microcontroller

The connection of the ultrasonic sensor to a microcontroller is pretty basic as it only has four pins that need to be connected.

Another great thing is that the ultrasonic sensor and microcontroller both operate at the same voltage which is +5 volts. 

Below is the connection of an ultrasonic sensor and a microcontroller. 

A note to make is tha thet ECHO and TRIG pins can be connected to any of the digital pins of the microcontroller. 

However, since the digital pins can be either an input or output (depending on how you configure them when programming the microcontroller), you will have to make sure you configure the pins according to which of the ultrasonic sensor pins are connected to them (ECHO is an input and TRIG is an output). 

Standard specifications of an ultrasonic sensor

Ultrasonic sensors have a certain set of specifications that help you choose the right one for the application. 

While there are a wide variety of ultrasonic sensor brands available, they are not identical in their specifications. 

However, below is a list of average values an ultrasonic sensor might typically have;

  • Operating voltage: 3.3V – 5V
  • Operating current: 8mA
  • Nominal Frequency : 40kHz
  • Coverage distance: 0.2m (0.65ft) – 6m (19.7ft)
  • Resolution: ~1cm (0.4 inches)
  • Sound pressure: 112dB (min)
  • Measuring angle: 15 degrees
  • Input pulse: 10 microseconds 

What materials can an ultrasonic sensor detect?

I was recently using the ultrasonic sensor for a simple project which was to detect when someone entered the room. 

Initially I had set up the sensor at a height that was aiming at the torso (mid-section) of a person. However, when it came to testing, the ultrasonic sensor hardly detected me when I entered its sensing area(or it was not effective 100% of the time, which isn’t ideal).

Then I just moved the sensor to floor level (now aimed at my legs), and I started getting better results. 

What was the difference? 

I was wearing shorts! I had no fabric material covering my legs, whereas my t-shirt was absorbing the sound waves rather than reflecting them.

After doing some research, I confirmed my conclusions were right. Ultrasonic sensors are not good with soft or irregular objects, as they might either absorb the wave or redirect them elsewhere. 

I know, my project isn’t full proof due to the fact that someone might be wearing pants which will cause the same issues as before. 

The ideal objects for detection using an ultrasonic sensor are large, flat surfaces. Objects such as;

  • Metals
  • Ceramics
  • Glass
  • Wood

Common applications of ultrasonic sensors

The ultrasonic sensor has many different applications where it makes use of its unique capabilities for sensing without the need for physical contact. 

As you can imagine, there are a multitude of industries that could make use of this sensor. But, rather than naming all of them, I will list some of the more common applications where you might find an ultrasonic sensor. 

  • Car parking sensors– lets you know if you are getting too close to a wall, another car, or any object (can be located in the front of the back of the car)
  • Level control – detect, monitor and regulate levels of liquids within a closed container
  • Anemometers – measuring wind speed and direction
  • Robotics – help robots navigate their surroundings by detecting objects 
  • Counting  – used in manufacturing factories to count goods on conveyor belts
  • Medical – Produce images of internal organs, identify tumors and monitor health of babies inside the womb

Again, this isn’t an exhaustive list by any means. There are many more applications with similarities to those mentioned above, so rather than naming them all of them I will save you the time by not repeating myself. 

Can you use an ultrasonic sensor with an Arduino or Raspberry pi?

Yes, you can use an ultrasonic sensor with an Arduino or a Raspberry Pi.

As we saw earlier, the sensor requires a brain (either a microcontroller or microprocessor) to process the information it sends them.

Both the Arduino and Raspberry pi come as development boards that have a microcontroller or microprocessor which are capable of the functions required to operate the ultrasonic sensor.

These boards also have convenient pin slots for inputs, outputs, VCC and GND that you can connect the sensor’s pins to.

Why do we need ultrasonic sensors

But, why use ultrasonic sensors at all? 

While you could survive without having to rely on ultrasonic sensors, utilising their abilities far outweigh not using them.

The most obvious reason we need this type of sensor is to detect objects without the need of physical touch. Also, if you need to acquire the distance of the object (to within a 1cm) this sensor will be beneficial.

Below are some other examples of why you might need ultrasonic sensors.

In the simple case of parking a car, you might be the best parallel parker in the world, but sooner or later your senses are going to fail you, and mistakes will happen (in the form of bumping the car in front or behind).

However, if you enlist the abilities of an ultrasonic sensor, you now have an ‘extra pair of eyes’. While you still have to park the car, you can be assured that the sensor will be a more efficient guide. 

Another example is counting products on a conveyor belt. Sure, you could hire a human to do it. But, us humans have our limits of efficiency and effectiveness. Sooner or later, fatigue is going to set in and errors will be made. 

An ultrasonic sensor does not get tired, therefore you have higher efficiency. 

So, we need ultrasonic sensors as they make systems more efficient, effective, and accurate. 

Advantages and disadvantages of ultrasonic sensors

Everything in life comes with its good side as well as bad. 

The same is true for ultrasonic sensors too. Below is a list of the advantages and disadvantages of the sensor.

Advantages of ultrasonic sensors

  • Detection without the need of physical contact
  • Color and transparency of an object does not affect detecting abilities 
  • Low current consumption
  • Can give accurate distance of object (near to 1cm / 0.4in)
  • Effective during the day as well night
  • Can operate in ‘high-glare’ environments 

Disadvantages of ultrasonic sensors

  • Acoustic noises near the operating frequency of sensor can cause interference in readings
  • Cannot work in a vacuum 
  • Unable to detect soft or irregular shaped objects well 
  • Temperature fluctuations can affect the speed of the sensor’s ultrasonic sound waves 

Other alternatives to ultrasonic sensors

As you now know, the ultrasonic sensor is a type of proximity sensor which utilises sound to detect objects.

But, you are not limited to just using ultrasonic sensors for detection. There are many other types of proximity sensor available each using different methods and technologies to achieve detection on an object without the need of physical touch. 

Each will have its own set of unique characteristics as well as advantages which will make them suitable for particular applications.

Let’s take a quick look at each type of proximity sensor.

Inductive proximity sensor  – Uses the law of induction to detect metal based objects. This means other non-metal based objects cannot be detected using this type of sensor.

Capacitive proximity sensor – This type of proximity sensor is able to detect both metal and non-metal based objects. It does so by detecting the change in capacitance within the sensor when objects enter its sensing field.

Infrared (IR) proximity sensor – Has a very similar working principle to the ultrasonic sensor. But, rather than emitting a sound wave, this sensor emits a beam of infrared light. Also, just like sound waves emitted by the ultrasonic sensor cannot be heard, the light emitted by the IR sensor is invisible to the naked eye. 

Photoelectric proximity sensor – also emits a beam of light like the IR sensor, but is not limited to just infrared light.

Magnetic proximity sensor – This type of sensor employs technology which is capable of sensing magnetic based objects.

If you want a more in-depth guide about these types of proximity sensor, check this article.

The post What are ultrasonic sensors?An in-depth guide appeared first on Electronic Guidebook.

]]>
983
What are proximity sensors? An in-depth guide https://electronicguidebook.com/what-are-proximity-sensors-an-in-depth-guide/?utm_source=rss&utm_medium=rss&utm_campaign=what-are-proximity-sensors-an-in-depth-guide Tue, 07 Sep 2021 00:19:12 +0000 https://electronicguidebook.com/?p=968 The world we live in today is riddled with Sensors.  Whether it be in your smartphone, an aeroplane, street lights, your car and many other places. Sensors are used in computing, as well as electrical and electronic systems. They are crucial in providing data from the real world to help the system make necessary changes. […]

The post What are proximity sensors? An in-depth guide appeared first on Electronic Guidebook.

]]>
The world we live in today is riddled with Sensors

Whether it be in your smartphone, an aeroplane, street lights, your car and many other places.

Sensors are used in computing, as well as electrical and electronic systems. They are crucial in providing data from the real world to help the system make necessary changes.

They also help make these systems more efficient and accurate. 

There are many different types of sensors, each with a particular set of skills, making them suited for different applications. 

One of those types is the Proximity Sensor.

But, what are proximity sensors?

Proximity sensors help detect objects without the need of physical touch. They can detect the movement of an object, or the mere presence of it. Once they have detected an object, they can send this information to the brain (usually a microprocessor) of the system for further processing. 

This is only the tip of the iceberg for proximity sensors. There are many different types, each suited for a different type of application.

So read on to learn more about proximity sensors. 

Deeper look at sensors

Since the proximity sensor is a subcategory of the general term Sensor, it will help to learn a bit more about sensors.

But, if you aren’t too concerned with learning about sensors, you can skip this section and go to the next part which will cover everything about proximity sensors. 

What is a sensor

Computing and electronic systems in the most simplest form consist of inputs, a processor and outputs.

Let’s consider a computer. It has inputs (mouse, keyboard), a processor (Central Processing Unit), and outputs (printer, speakers, monitor).

So what is a sensor? 

A sensor is a type of input device whose main function is to ‘sense’ physical changes in the environment (real world) and provide this information to the processor of the system. 

Us humans have our own sensors. 

Five of them!

We have the ability to make sense of the environment around us through Touch, Smell, Sight, Taste and Sound. 

Just like a computing system, we too also have a processor (our brain), and outputs (arms, legs).

So, imagine you are at a party and the DJ plays your favourite song.

You are able to sense the sound waves traversing the airwaves using one of those five senses (in this case sound through your ears).

This information is sent to your brain (processor) which realises this is your jam! It then informs your body(output) to move uncontrollably (or controllably depending on your dancing skills) to the beat of the song. 

Sensors in computing and electronic systems work in the same manner. 

They provide information from the world to the processor who can deal with that information as needed. 

For example, let’s take a look at a fan heater. 

This fan heater will have a temperature sensor which has the job to sense the ambient temperatures to ensure that the temperature you set is maintained. 

If temperatures start to rise, the sensor will relay this information to the processor. The processor can then suspend heating until temperatures fall back to the levels you set. 

Why use sensors?

But, are sensors really that essential? 

The simple answer is yes! 

There are many benefits to using sensors in systems. 

Let’s go back to the heater. If it did not have a sensor, the temperature would rise above the level you set making the room hotter than you would like. 

Sensors provide a means of feedback so that changes can be made if needed.

Other advantages include;

  • Making systems more efficient
  • Predictive and preventative maintenance
  • Increasing accuracy 

What are proximity sensors?

Now that we know what role a sensor has in a computing or electronic system, we can take a closer look at Proximity Sensors.

Just like we have different sensors that have different roles, and function in different ways, the electronic world has many different types of sensors each with its own unique sensing ability. 

There are sensors to detect temperature, smoke, gas, altitude, speed, acceleration, and many more. 

What about a proximity sensor? What does it do? 

Proximity sensors are a classification of sensors that have the ability to detect objects without the need of physically touching them. 

However,you aren’t limited to only one type of proximity sensor to achieve this. There are a variety of technologies used such as light, sound, infrared, electromagnetic, and capacitive, in proximity sensors that give them the ability to detect objects.

We shall cover the different types of proximity sensors in the next section. 

Different types of proximity sensors and their working principle

Now that we know the basic principle of a proximity sensor, let’s take a look at the different versions, and how each of them is able to detect objects with its own unique abilities. 

Inductive proximity sensors

First on the list are Inductive Proximity Sensors.

This type of proximity sensor is able to detect objects based on the law of Induction. Due to this, they are limited to only sensing Metal Objects.

Inductive proximity sensors are further divided into two categories;

  • Unshielded 
  • Shielded 

The main difference between the two is their Sensing area

This comes down to the electromagnetic field generated by the coil. In the Unshielded version of the sensor, the electromagnet field is not restricted, therefore it has a wide sensing area.

Whereas, in the Shielded version, the electromagnetic field is concentrated, reducing the sensing area more toward the front of the sensor. 

Working principle of Inductive proximity sensors

Below are the main stages of operation for inductive proximity sensors;

  1. The coil generates a high-frequency electromagnetic field which originates from the coil located in the oscillation circuit
  2. This field sensing area is dependent on whether it is Shielded or Unshielded.
  3. Now, if a metal object enters this electromagnetic field, the metal object will be induced with a current known as an Eddy current due to electromagnetic induction.
  4. If the metal object gets closer to the sensor, the eddy current is going to increase. 
  5. This means that the oscillation circuit whose job it is for generating the electromagnetic field is going to have a greater load on it to keep up with the increase in eddy current.
  6. A separate circuit inside the sensor is responsible for monitoring the load on the oscillation circuit and when it crosses a set threshold it will stop the oscillation circuit. 
  7. This indicates the presence of an object. 

Capacitive proximity sensors

Next up, we have Capacitive proximity sensors

Objects are detected when their capacitance (and therefore a change in capacitance) is registered within the sensor. 

Unlike inductive proximity sensors, this version is not limited to detecting only metals. 

Metallic and non-metallic objects which range from liquids, metals, wood, plastic, etc, can be detected using capacitive proximity sensors. 

The internal construction is very similar to a Capacitor.

As you might know a capacitor consists of two conducting plates, which are separated by something known as a Dielectric

Similarly, the sensor consists of the two plates (electrodes) whose capacitance changes as an object moves toward it. 

Working principle of capacitive proximity sensors

The working principle is very similar to an inductive proximity sensor. 

As you just saw, the capacitive proximity sensor also has an oscillation and detection circuit. Below are the main stages of operation;

  1. The internal plate (electrode) is connected to an oscillation circuit which generates an electrostatic field. 
  2. When an object enters the electrostatic field, the capacitance of the plates increases
  3. This increase causes a greater load on the oscillation circuit (just like with the inductive proximity sensor).
  4. The detection circuit ‘detects’ this increase and stops oscillation, thereby indicating the presence of an object. 

Ultrasonic proximity sensors

The Ultrasonic proximity sensor detects objects by using sound.

Ultrasonic sound waves (hence the name), are used so they are not audible to humans (therefore you won’t hear anything if you are near these sensors).

A typical ultrasonic sensor is broken into two parts;

  • Transmitter (generates the sound waves)
  • Receiver (which captures the sound waves when it reflects back from an object)

The great thing about this type of proximity sensor is that you can measure the distance of the object. This comes down to knowing the speed of the sound, and the time it takes for the wave to make a return trip.

Below is a fundamental equation to calculate speed, distance and time, which you might recall from science class;

Where V represents speed, d is distance and t is time.

Rearranging this equation to calculate distance we get;

We know that sound travels around 343 metres/second. So, to calculate the distance of an object we just need to acquire the time.

Note, the time value needs to be halved to calculate the distance of the object. This is because the time value the ultrasonic value will present to us, is the time it takes the sound wave to leave the transmitter, hit the object and return back to the transmitter.

We just need the time for the first part (which is the sound wave hitting the object) to calculate the distance of the object. 

To do this, we can either halve the time value when calculating the distance, or halve the total distance value at the end.

Let’s look at an example to clear things up.

Say there is a wall about which you are trying to calculate how far away it is. The ultrasonic sensor gives you a time value of 0.005 seconds.

Option 1

Take the time value and divide it by 2. This now gives us a time value of 0.025 seconds. Now, use this value and the speed of sound (343 m/s), to calculate the distance. This gives us; Distance = 0.025 x 343 = 0.8575 meters.

Option 2

Use the initial value the ultrasonic proximity sensor gives us, calculate the distance and then divide it by 2. So, first calculate the distance; d = 0.005 x 343 = 1.715 meters. Now, take this value and halve it; 1.715 / 2 = 0.8575 meters.

So, using either option will yield the same result. 

Another important note is to make sure you are using the same units in your calculations. If you are calculating for meters per second, ensure your time values are in seconds and not milliseconds. 

Working principle of ultrasonic proximity sensors

Below are steps of operation for ultrasonic proximity sensors;

  1. Transmitter emits an ultrasonic wave
  2. Wave traverses through the air
  3. The wave encounters an object hits it thus causing it to reflect back toward the ultrasonic sensor
  4. Receiver ‘receives’ the reflected wave 

Infrared proximity sensors

While ultrasonic sensors use sound to detect objects, Infrared Proximity Sensors (or IR sensors) use infrared light. 

The infrared sensor works in many ways like its ultrasonic counterpart. Just like the sound waves are inaudible to the human ear, the infrared light is invisible to the naked eye as its wavelength is longer than visible light. 

If an object is able to give off heat, it will also give off infrared radiation. 

This type sensor comes in two varieties;

  • Active
  • Passive

Active Infrared Sensors have the capacity not only to detect IR radiation, but to produce their own IR radiation. 

An active IR sensor consists of two parts; a Infrared Light-Emitting-Diode (LED), and a Receiver. 

They are commonly used in robotics for obstacle detection. 

Passive Infrared Sensors on the other hand can only detect IR radiation and have no means of producing it. 

A passive IR sensor consists of the following parts;

  • Two strips of a pyroelectric material
  • An infrared filter (only lets in IR light)
  • Fresnel lens (which takes in light an concentrates at a particular point)

Working principle of infrared proximity sensors

Active Infrared Proximity sensor

  • The IR LED emits a beam of infrared light
  • That beam hits an object and is reflected back toward the sensor
  • The receiver then receives the reflected beam 
  • The relative distance of the object is then calculated

Passive Infrared Proximity sensor

  • The sensor will have a particular sensing field of view, as well as sensitivity to IR levels (which you should be able to change as you desire)
  • When an object, person, animal, etc (that gives off IR radiation) enters the field of view, and has an IR reading above the threshold of the sensor’s IR level, a signal is then sent to the processor within the IR sensor indicating an object is present. 

Photoelectric proximity sensors

Next up are Photoelectric Proximity Sensors.

This type of sensor also uses light as its means of detecting objects. However, Infrared light is only used some of the time and is not necessarily the only type of light source used. 

The basic functionality of light being transmitted and reflected back to detect objects is the same. 

But, when it comes to photoelectric proximity sensors, there are three varieties;

  • Reflective
  • Through beam
  • Diffuse 

Working principle of Photoelectric proximity sensors

Reflective Photoelectric proximity sensors

  • A light beam is emitted from the transmitter
  • That light beam bounces off a reflector and back to a detector
  • If the light beam is able to reflect back with no interruption, this means there is not object present
  • However, if the beam does not return to the transmitter, this indicates the presence of an object 

Through beam Photoelectric proximity sensors

  • This setup of the sensor consists of two separate modules that are not part of the same housing; an Emitter and a Receiver
  • The two modules are set up at some distance apart (but maintaining a direct line of sight between the emitter and receiver modules)
  • The emitter emits a light beam to the receiver
  • Under normal conditions, the light beam is unbroken
  • If the beam is broken, it means there is a presence of an object or person

Diffuser Photoelectric proximity sensors

  • Instead of the light reflecting of a reflector (like with the reflective photoelectric sensor), the object being detected acts as the reflector
  • Emitter emits beam of light
  • Light bounces of object and returns back to receiver 
  • Presence of object detected

Magnetic proximity sensors

Last, but not least, is the Magnetic Proximity Sensor. 

This type of sensor is used to detect magnetic objects (things like permanent magnets and electromagnets). 

As you know, all magnetic objects are surrounded by a magnetic field. The sensor has technology which is able to detect this magnetic field. 

Here are different ways (or principles) that a magnetic proximity sensor might use to detect the presence of a magnetic field;

  • Reed switch
  • Variable reluctance 
  • Magneto resistive 
  • Hall-effect 

There are a couple of key characteristics of magnetic sensors; Rated operating distance and Repeatability.

Rated operating distance is the distance at which the magnetic sensor gets tripped (senses a magnetic field). 

Repeatability is the distance at which the sensor starts to repeatedly switch. 

Working principle of magnetic proximity sensors

Below are the working principles of the different types of proximity sensor.

Variable reluctance magnetic proximity sensor

  • It is made up of a permanent magnet and a ferromagnetic pole surrounded by a coil of wire.
  • When a magnetic material passes the tip of the ferromagnetic pole, an analog voltage is induced within the sensor 
  • This voltage is sent to a control unit and converted to a digital signal for further processing

Magneto resistive proximity sensor

  • Has something known as a Measuring Cell which consists of resistors with miniscule ferromagnetic and non-magnetic layers
  • Two of the resistors form what is known as a Wheatstone bridge circuit. 
  • When a magnetic field is present, the wheatstone bridge produces a larger signal proportional to the magnetic field. 
  • A threshold value is defined and a comparator is used to switch the output signal. 

Reed switch magnetic proximity sensor

  • Is a type of switch (hence the name), that is magnetically actuated.
  • Made up of two ferromagnetic reeds (or contact blades), housed in a glass capsule
  • In the presence of a magnetic field, the contacts close.

Hall-Effect magnetic proximity sensor

  • Consist of a Semiconducting material (like Silicon).
  • When placed in a magnetic field, the voltage changes depending on the strength of the magnetic field.

Which is best proximity sensors

Phew!

That was quite a list wasn’t it? If you weren’t aware that so many types of proximity sensors existed, now you do!

You might be on the hunt for a proximity sensor yourself, or you might just be curious as to know which is the best proximity sensor?

Well that question really comes down to the application and the needs of the application it will be used for. So, let’s take a look at the advantages and disadvantages of each type of proximity sensor. 

Inductive proximity sensors

Advantages

  • Detection without the need for contact
  • Resistant to most environmental factors such as dust and dirt
  • Can sense a wide range of metals
  • Cheap
  • Longer lifespan due to no moving parts

Disadvantages

  • Limited to a small distance it can sense objects 
  • Can only detect objects that are metal
  • Performance can be affected by certain temperatures 

Capacitive proximity sensors

Advantages

  • Can detect a wide variety of materials (not limited to metals)
  • Able to detect objects through non-metallic walls
  • Has sensitivity control via a potentiometer (able to control for which materials you want to sense)
  • Long lifespan due to no moving parts

Disadvantages

  • Low sensing range
  • Can be on the expensive side

Ultrasonic proximity sensors

Advantages

  • Color and transparency of object does not affect detection
  • Works well in extreme conditions
  • Can be used in the dark
  • Not affected by light sources 
  • Low current consumption
  • Able to give distance measurements to the nearest centimeter/inch

Disadvantages

  • Cannot be used in a vacuum 
  • Cannot detect soft surfaces such as fabrics, or surfaces with severe imperfections 

Infrared proximity sensors

Advantages

  • Can be used anytime of the day
  • Secured communication via line of sight 
  • Can measure distance of soft objects

Disadvantages

  • Other sources of infrared light (like the sun) can affect the sensor’s readings
  • Performance deteriorates over longer distances 
  • Passive infrared sensors can only detect objects that give off their own IR. 

Photoelectric proximity sensors

Advantages

  • Can sense a wide range of materials
  • Long lifespan
  • Long sensing range 
  • Fast response time 

Disadvantages

  • Can get contaminated over time 
  • Color of object can affect the sensing range 
  • Installation of through beam versions of the sensor can be quite complex

Magnetic proximity sensors

Advantages

  • Small packages 
  • Large sensing range
  • Long operating periods and low power consumption
  • Low cost

Disadvantages

  • Limited to only detecting magnetic materials
  • Reed switch versions have lower lifespan due to moving parts

Common applications of proximity sensors

As mentioned at the start, sensors can be found everywhere. They are part of your daily lives helping make it more efficient and accurate. 

The proximity sensor is one of those sensors helping to enrich our lives. 

With the different types of proximity sensor available, and each having its own ability for specific purposes, it has many uses for many different applications. 

Below is a list of the general applications that the range of proximity sensors covered above can be used in;

  • Object detection, positioning, inspection and counting in automated production lines in manufacturing companies
  • Capacitive touch switches on consumer electronic products like smartphones, keypads etc 
  • Collision detection for robots
  • Washrooms; to turn taps/faucets, as well as hand dryers on and off without the need for contact
  • Unmanned vehicles; Self driving cars, and planes 
  • Passive infrared sensors used in security systems in businesses and homes 
  • Detection of fluid levels, composition and pressure (using capacitive proximity sensors)
  • Wind speed and direction on Anemometers (Ultrasonic)
  • Parking sensors in automobiles 

The post What are proximity sensors? An in-depth guide appeared first on Electronic Guidebook.

]]>
968