Build An Interfacing Linear Sensor

12 March 2012

  •  
  • A fast and easy way to hook up and calibrate different types of analog sensors

By Jon Gabay

It’s an analog word. Real-world processes and events happen in the analog domain. Temperature for example isn’t just On or Off. It has a magnitude. But a heating system will rely on a thermostat to tell it to turn on or off, basically a digital function.

Our control systems are also digital. At the heart of every microprocessor and microcontroller are digital logic elements representing On and Off states. Control functions, monitoring conditions, algorithms, and even user interfaces are built from logic concepts that ride over these digital states.

Sensors can be analog or digital. The Hall Effect sensors we discussed in section one measures an analog field and turns this into a digital function. It basically detects a threshold level as to when to change an output state. Like a temperature thermostat, it basically indicates ON – there is a magnetic field strong enough – or OFF – there is no magnetic field strong enough to trip the switch.

Sensors come in a variety of flavors to detect and measure many phenomena. Typical sensors are temperature, pressure, light level, shock, vibration, acceleration, field strength, sound level, ph, salinity, humidity, and more.  This is good for us Gizmologists, but comes with a problem to solve. Different types of sensors output different types of signals. And, to be useful, we need to have some way to calibrate to standards.

This article describes a project that you can build which results in a fast and effective way of interfacing a variety of linear sensors to a microcontroller’s A/D section. This provides protection to the microcontroller and lets us easily interface virtually any type of sensor we want, getting the most accuracy and being able to calibrate it.

We invite you to dive into the technology, implement the design and share your innovations with us in video segments. Make sure you read the rules* below, but here is how it works:

  1. 1. Follow Jon Gabay’s article (here) and build the board design.
  2. 2. Create a short – 1 to 2 minute video, describing your application of the design.
  3. 3. Send me an email, at (jennifer.delony@ubm.com), with the video file.
  4. 4. I will send you back an online Amazon Gift card valued at $100.00 (US dollars).

*Limit of 1 (one) gift card per person. Offer limited to the first 50 (fifty) participants who fulfill the four guidelines stated above. Offer ends April 30, 2012.

All parts referenced here are available at the Avnet-Express website. Schematics, prototype layout pictures, and design information is freely available here to encourage students, hobbyists, engineers, inventors, and gizmologists to be creative and focus on creating systems and circuits to solve problems, reduce energy and greenhouse gasses, improve life, and make the world a better place.

On the Level

Mostly, discrete sensors are two terminal devices. This means that they will exhibit a change in voltage, current, or resistance based on the conditions to which they are sensitive and exposed. A good example of this type of sensor is a thermistor like the B57863S 103F 40 (see Fig. 1).

A thermistor exhibits a change in resistance as temperature changes. This part is a Negative Temperature Coefficient (NTC), which means that its resistance decreases as temperature increases. Conversely, PTC types of thermistors feature increased resistance as temperature rises.

   
Fig. 1 – A thermistor is an example of a passive transducer that exhibits a change in resistance as temperature changes. xx Fig. 2A – Some linear sensors really do have linear characteristics like this ambient light sensor.
 
xx

 
 
Fig. 2B – Some linear sensors exhibit a curved transfer function that can use curve fitting algorithms or lookup tables to correct.   Fig. 3A – This 2 terminal temperature sensor uses internal circuitry to generate a current based on temperature.  

 
 

Fig. 3B – This 3 terminal temperature sensor uses power to linearize the response and provide higher accuracy.

 

  Fig. 4 – Some sensors eliminate linear output stages and communicate directly with a microcontroller in digital format. These are typically more costly than the simple transducer based linear sensor.  

Another thing to keep in mind with sensors is that not all linear sensors are truly linear. For example, an ambient light sensor like the ALS-PDIC243-3B exhibits a very linear response with current compared to light level (See Fig. 2A). Conversely, an air mass flow rate sensor like the D6F-P0010A has a curved output voltage response as flow rate varies (See Fig. 2B). Here software techniques like curve fitting algorithms or lookup tables can be the easiest methods for improving accuracy.

There are single-ended and differential types of sensor amplifiers. A single-ended sensor is usually referenced to ground. A differential sensor amplifier amplifies the difference between two terminals. Both have their place, and both have their advantages and disadvantages. In this design, we will use single-ended sensor interface techniques because it is simpler at the start. (Keep an eye on future installments when we delve into differential sensors and sensors that can operate well beyond the voltage limits of the Op-Amps and power supplies we use.)

Important is the fact that some sensors can create voltage levels that can damage electronics. For example, we can bias the thermistor or ambient light level sensors to operate only in a safe voltage range that cannot damage the circuitry. But sensors like the AB3529BF  or the APS2509S-T-R are piezo electric. They will play nicely when used in a controlled range. It is not uncommon, however, for shock sensors to put out a 100-volt spike, for example.

This means that some sort of protections will be built in to protect the sensitive electronics.  We also want to protect from negative voltages that can also damage sensitive circuits.

We also want to get as much range and accuracy from our sensors as possible. This means clever biasing, offsetting, and amplifying the often weak signals that come from our sensors. In the case of the high-voltage piezo, it can also mean attenuating and current limiting.

Finally, we want a way that we can calibrate our sensors. This means we can build more than one and they will behave the same way. It also means that we can conform to standards. A resistance meter would not be very useful if each resistance meter gave you a different reading.

Integrated vs. Discrete

Our design can use two classes of analog sensors – discrete or integrated. The discrete types of sensing elements like photo cells have characteristic transfer curves of their performance. They are just sensor materials that exhibit a linear electrical response that we need to adapt to our applications. The other types are active sensors that incorporate circuits inside the sensor to improve performance or linearity.

An example of this type of sensor is the 5962-8757103YA, which is more than just a transducer. It contains active circuitry (See Fig. 3A) that helps to linearize and improve the accuracy. Active sensors may also carry with them the need to supply power and ground.

A good example of a powered sensor is the AD22100KRZ active temperatures sensor (See Fig. 3B). This is a monolithic temperatures sensor with on-chip signal conditioning, which performs linearization to better than + / – 1% across the full scale range. Its output is an analog voltage and, as such, can take advantage of our board.

A third type of active sensor does not need our board. An example of this sensor is the TMP006AIYZFR – an integrated contact-less thermo-pile infrared temperature sensor. This absorbs infrared energy emitted from an object based on its temperature. Note the SCL and SDA outputs. This is accessible directly over a SMBus serial data link so that no analog interfacing is needed (See Fig. 4).

Since the non active sensors are usually very low cost compared with the higher priced active sensors, our board will let us interface to and build boards with the lower cost passive types of linear sensors. This also allows us to develop and create our own sensors for things like liquid level detection, which can have different characteristics depending on the types of liquids we are measuring.

…Continue
 


Page 1 | Page 2 | Page 3


Visit Building Innovation for more great projects from Dr. Gizmology.
Also available in the Building Innovation series: Build a 'Hall Effect' sensor interface and Build your own crack 'POTS'

S. Wimmer February 23, 2012 at 9:40 am

Vote -1 Vote +1

"Fig. 2A – Some linear sensors really do have linear characteristics like this ambient light sensor."
LOL: anybody notice the logarithmic x-axis? :-)

    Jea May 29, 2012 at 7:11 pm

    Vote -1 Vote +1

    There are 8 zones, and when you add a new sensor by psnirseg the set button, when the sensor detects a movement you can select which zone to add that sensor too, very simple and easy to use.

Y Pascal March 20, 2012 at 7:31 am

Vote -1 Vote +1

I do. As well the logarithmic y-axis ;)

feernegeata December 5, 2012 at 5:50 am

Vote -1 Vote +1

I used to be more than happy to discover this web-site.I needed to many thanks for your time and efforts because of this wonderful read!! I undoubtedly enjoying each little little bit of it and I have you bookmarked to check out new stuff you blog post.

Am I Allowed To just say what a relief to find somebody who truly knows what theyre discussing on the net.

[url=http://lvsalebz.posterous.com/]discount LV handbags[/url]

Leave a Reply

*Required

* * *
CAPTCHA Image

*

New Products From Avnet

  • HP 3PAR StoreServ 7000

    The world’s most advanced storage platform has extended its midrange offerings, delivering effortless, efficient, bulletproof, and future proof storage to the entire midrange. Store all of your data on a single system that supports advanced features, such as storage federation and automated tiering, and which enables you to start small and grow without disruption.

  • Advantech RISC Computing Platforms

    UBC-DS31 is powered by a Freescale ARM Cortex-A9 i.MX6 dual core processor, with 1GB DDR3 memory & 4GB flash onboard. It has 2D and 3D graphics built in, and supports dual displays with up to 1080p high resolution output on low power consumption.

The Way Back Machine

The Way Back Machine

Connect With Us

Find us on Facebook

Follow us on Twitter