Interfacing Linear Sensors, III

8 February 2012

Location, Location, Location

Before building our board, it is a good idea to floorplan it (See Fig. 8).

We will mount our board in a plastic faceplate as we did for the first project (See Fig. 9). Again, we will cable power from our power supply using standard banana jacks and have all connections to the board removable without soldering. This is always a good idea with prototypes and flexible designs that can be reused.

Since we may need bias voltages at our sensors, I decided to use the same three-pin interface we used on the last design for our sensors. The reason for this design is two-fold. First, even passive sensors need to be biased, so as long as we have voltage at our sensor point, we can bias it right there. Second, there are many active sensors (such as the compensated temperature sensor previously discussed) that output a linear signal that we can take advantage of with our board, as long as we supply a power signal. Also, any of our active linear sensors can still plug into the first project’s board and be used as a threshold detector. For example, the active temperature sensor can plug into our Hall Effect interface board and be used to create a thermostat.

 
Fig. 8 – Our placement diagram indicates where our connectors and components will be placed and documents where our socketed bias components are. xx

 
Fig. 9 – Our prototype board mounts in a plastic faceplate and uses plug in cables and connectors for quick assembly/disassembly.  

 
Fig. 10 – Our cadmium sulfide photo cell sensor input cable uses a screw terminal block for easy connection to our sensors.  

 
Fig. 11A – I used an ice cube to calibrate our thermistor for zero degrees Celsius.  

 
Fig. 11B – To calibrate the upper range of our thermistor, I used boiling water.  

We will use the shielded 1/8 inch stereo audio jacks and cables again because they are low cost, easy to deal with, and the shielding can help reduce induced noise – especially important with low-level signals to which we may want to interface.

The external trimpots for adjustments will use three-terminal plugs, and we will make cable ends that quickly plug in and unplug for disassembly. We need two trimpots per channel. Our sensor outputs are just two-terminal connectors and we will use the same techniques for cabling, including the shielded RCA jacks and cables.

We will socket our chips, and we will use a socket for our biasing resistors. This allows us to adjust and re-bias the stages to accommodate different sensors without having to remove the board and unsolder components. The LED is a two-pin header that allows us to remotely locate the ‘power on’ indicator. Note that the current limiting resistor is already in series with the LED. If the cable shorts out, it will not short out our power supply.

The jumper feeds our –VCC signal to the low rail of the Op-Amp. For almost every application, we will want our Op-Amp to use ground as the negative reference. There may be times when we want a negative voltage signal that can swing below ground (if we remove the zener diode at the output stage). For the extra cost of a three-pin header used as a selection jumper, I put it in there.

Testing Our board

I placed a couple of test points on the prototype for ease of probing. First, I placed a header pin with a loop bent into it at ground. This makes a handy connector point for my meter’s ground terminal. I also placed a probe point for +8V and –8V. 

Without the Op-Amp not plugged in, I applied power to verify that the regulator and the charge pump were working. The meter registered +7.98V at the positive rail and a clean –7.96V at the negative rail. So far, so good.

I next probed the center tap of the zero-adjust trimpots, while turning the knobs to verify my offset adjustment ranges. As expected, both gave me a –2.6 to +2.6 adjustment range. The range will be changed later for some specific applications.

I placed the jumper on the ground position so that the Op-Amp was operating from ground to +8 V instead of +8V to –8V. With power off, I inserted the Op-Amp into the socket and turned on power again. No smoke – a good sign always.

To demonstrate the flexibility of this sensor interface board, I dug into my assorted parts bin and pulled out a cadmium sulfide photocell and a thermistor I had lying around. Not knowing the characteristics, I used a meter to see what range of resistance they exhibited in ambient conditions.

I made a cable that allowed me to quickly and easily change components and biased the photocell with a 100K series resistor to the power supply. As more light hits the cell, its resistance decreases. As the cell gets dark, its resistance increases (See Fig. 10).

Without a calibrated light source and fixture, I was unable to calibrate this to any specific standard. I used an LED flashlight 6 inches away from the photocell to adjust the zero point. I then covered up the cell and adjusted the gain to full range. I was able to adjust the levels so at a dark level (all background lights off), I would get a 3.3V output. This would be useful for example to adjust a photo cell to detect ‘dusk’ and enable a motion detector to control lights in a 3.3V microcontroller-based design. I realized that I should have socketed the gain set resistor so I could get more gain if needed.

As an example of a calibrated scenario, I decided to see what kind of performance our thermistor exhibited, so I set up a calibration station using an ice cube and a pot of boiling water. By measuring a 28K resistance at freezing (see Fig. 11A) and a 700 Ohm resistance at boiling (See Fig. 11B), I could establish a detection range; here freezing to boiling or 0 to 100 degrees Celsius.

Using Ohms law, I could calculate the series resistor from the 8V supply to be 16.8K Ohms. This would give me a 0V reading at boiling, and a 5V reading at freezing when adjusted. 

To demonstrate how this board can increase the resolution of your A/D, I decided to set up one of the channels to measure a 12V battery voltage on a charger. I set the range to be zero volts (reading zero volts at the output) to 15V (reading 5V at the output). I chose 15V as the upper range, since a battery charger often will go to 14.4V to charge a 12V lead-acid battery. I wanted enough range to read the charge voltage as well as the battery voltage.

To do this, I set the attenuation resistors to use a 10K series resistor (Rs) and a 5K Ground resistor (Rg). This brings the signal range into the summer from zero volts to 5V at 15V in. Note that with the gain trimpot set to zero Ohms, the output amplifier becomes a unity gain amplifier, so it will pass the zero to 5V out directly. Assuming I am using an 8-bit A/D converter, this range provided a resolution of 58.5 millivolts per step (256/15).

On the second channel, using the same attenuation resistors, I then set the zero offset adjustment to read a zero volt output at 10V input (I had to change Rdown). I then adjusted the gain to read a 5V output at a 15V input. Note that tuning this board is an iterative process. Once the zero point is set, adjust the gain stage, recheck the zero level, and recheck the gain level until it is stable.

What advantage does this provide? We now have our 8-bit A/D examining a range of 10V to 15V or 5V/256 steps or 19.5 millivolts per step. We have just about tripled our resolution by adjusting the offset (starting range) to a higher point. By limiting the range some more, we could have quadrupled it so that our 8-bit A/D is performing like a 10-bit A/D. Of course, software will have to add the offset to get a real-world value, but you can see the value of having this type of function added to your sensors.

Conclusion

Low cost analog sensors easily and accurately measure and monitor the conditions we wish to keep tabs on. This is useful as part of an energy management system, integrated control function for instrumentation, process control, safety, security, and on and on.

We now have a universal sensor interface module that can adapt to virtually any type of analog sensors. This allows tuning and adjusting for interfacing to our microcontrollers, and calibration to a known standard – like temperature – or a relative standard – like dusk light level.

There are so many possible uses. I look forward to seeing what you can come up with. Have fun.

Dr. Gizmology


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

JuanMed February 27, 2012 at 8:38 am

Vote -1 Vote +1

Hi! Just a little doubt: finally, what zener diode is it in the input stage of the interface? I mean the zener diode in parallel with the 1M ohm  resistor in the input.  Thanks!

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

SELECT id,views_count FROM wp_bs WHERE bs_date='2014-04-25' AND bs_post_id=4866