- Published: Wednesday, 01 September 2010
- Written by Jon Chandler
When developing an embedded application using analog sensor inputs, testing at specific sensor levels can be difficult. For example, in my icemaker controller project, actions need to occur at certain water levels. Using the actual sensor and a reservoir is time consuming, requiring filling and pumping out water to check sensor points.
Fortunately, simulating sensor operation is easy. Many sensors, including my pressure sensor, output a 0 - 5v signal proportional to the input parameter. A potentiometer (variable resistor) can easily simulate the sensor signal.
The schematic of a simple pot circuit is shown to the left. End ends of the pot's resistive element are connected to ground and 5 volts. The ADC input is connected to the pot's wiper which is a sliding contact along the resistive element. The circuit acts like a voltage divider. If the wiper is positioned near the ground terminal, the output voltage approaches zero. As the pot's knob is turned, and the wiper movers towards the 5v input, the wiper terminal will be at a higher voltage.
Simulating a range of sensor values is as simple as turning the knob.
Discuss this article in the forums (10 replies).