WorldWide Drilling Resource

Measuring “Real-World” Events by Britt Storkson Owner, P2FlowLLC In electronics, when we say “real-world” events, we don’t mean national news or political events. We mean events we would like our electronics to monitor and respond to. We could call these events voltage, current (amperage) temperature, force, pressure (force over an area), proximity, light (both visible and invisible to the human eye), sound, smell, and the presence of or absence of certain chemical elements, such as oxygen or carbon monoxide. All of these events must be converted to a voltage the microprocessor can read or measure as an input. This input is called a signal. Some inputs like voltage and current are easy to measure. A voltage signal can be directly read by many microprocessors. Current flow (amperage) is simply a voltage across a resistance. All of these real-world signals are varying voltages, which are called analog voltages. Other events are more complex and require sensors that convert the real-world event into a voltage to be read by the micro- processor. Pressure sensors, for example, convert force across an area into a voltage that can be read by the microprocessor then the information is used to make decisions based on the microprocessor program. The sensor voltage output can be directly proportional to the signal applied to the sensor. This means, using a light sensor for an example, if we double the amount of light hitting the sensor, we double the voltage the sensor outputs. Or the sensor voltage output can be inversely proportional...meaning if we reduce the light output by half, the voltage output of the sensor will double. The microprocessor can use this information in either form if the microprocessor program is written correctly to interpret it. To make a light sensor, we would determine at what brightness (or lack thereof) we wanted the light to turn on. This is done by measuring the voltage at the turn on point. likewise, to turn off the light sensor we would measure the voltage we wanted our microprocessor to turn off the light at. Internally, the microprocessor is constantly measuring the voltage the sensor outputs. This analog voltage is converted into a digital “word” the microprocessor can use. This is done with an analog-to-digital converter. Simply put, the higher the voltage measured by the microprocessor, the larger the digital word that is converted. Conversely, the lower the voltage meas- ured by the microprocessor, the smaller the digital word that is converted. In the microprocessor program we compare the measured voltage with the voltage value we want the microprocessor to “trip on” at, as well as another voltage value we want the microprocessor to “trip off” at. There’s usually a “deadband” between them where we don’t want the microprocessor to do anything. This greatly improves stability because the microprocessor output isn’t rapidly switching on and off. Also, time delays are almost always used with this application, again for stability reasons. Most microprocessors make several thousand decisions per second and can switch off and on rapidly without these time delays, and we don’t want that. For optimum stability, the voltage signal is measured again and again with a short time delay between measurements. All of the voltage measurements must be above or below the desired trip point after many measure- ments or the microprocessor won’t react to it. We call these measurements “samples” and we count the number of samples we do before making a decision. The greater number of samples, the greater the stability, but the trade-off is slower reaction time. Nearly everything a microprocessor reacts to coming from the “real world” is filtered this way. Even switch presses have delays built into them. We want the switch to react with a deliberate press, but not react because of an unintentional bump. While simple and inexpensive, these voltage measurement routines are very powerful and allow us to have an unprece- dented “view” of the world around us. They can also make decisions and respond appropriately to most any condition. Britt Britt Storkson may be contacted via e-mail to michele@ worldwidedrillingresource.com 52 MARCH 2016 WorldWide Drilling Resource ® WWDR ’s May issue is in the making! Get in on the action by calling (850) 547-0102 DEADLINES: Space Reservation - M Ar c h 25 t h Display & Classified Ad Copy - A pr i l 1 s t

RkJQdWJsaXNoZXIy NDk4Mzk=