© Analog Devices Inc.
Application Notes | July 16, 2021
A simple way to measure temperature using one GPIO digital interface
Question: How can I make an analog measurement if I only have a single GPIO left on the FPGA/microprocessor for my system?
Answer: A voltage-to-frequency converter can be used instead of an analog-to-digital converter.
As the need for sensing capabilities becomes more prevalent in modern applications focused on machine health and other Internet of Things (IoT) solutions, so does the need for simpler interfaces with fewer I/Os and smaller device footprints. The density of devices connected to a single microprocessor or FPGA is continuing to increase, while application space—and as a result, the number of I/O pins—can become constrained. In an ideal world, all applications would have an ASIC providing a small integrated solution.
However, ASIC development is time consuming, costly, and doesn’t provide the flexibility to be repurposed for other uses. As a result, more and more applications are using microprocessors or small form factor FPGAs to get product development done in a timely and cost-effective manner. In this article, we will explore a temperature-to-frequency converter that can provide accurate temperature results while only using a single GPIO pin. It will also demonstrate how using a voltage-to-frequency converter can be adapted to a variety of sensing applications.
Figure 1. The simple temperature-to-frequency converter.
Motivation
Some sensor measurements, such as temperature, humidity, and barometric pressure, are inherently dc and don’t change at rates fast enough—nor do they require resolutions accurate enough—to warrant an ADC and the design considerations that go along with it. Most ADCs require fast, accurate clock generation and timing, a stable voltage reference, a reference buffer with very low output impedance, and analog front-end circuitry to properly signal condition a transducer output before it can be digitally quantized and used by the system monitoring it. In the case of sensing ambient temperature, a discrete application might use a thermistor in a Wheatstone bridge whose output would then be gained up by an instrumentation amplifier and then fed into an ADC.
This design is over-engineered and requires more space, power, and computation cycles necessary for an application where the measurement might only need to be made once every 15 seconds.
What alternative measurement solution can be used to reduce the number of components and complexity associated with an ADC signal chain but still measure an analog voltage? The solution is a voltage-to-frequency converter, such as the LTC6990, configured in voltage-controlled oscillator (VCO) mode can be used to measure an analog voltage without an ADC. In this example, the AD8494, a precision thermocouple amplifier, is configured as an ambient temperature sensor whose output voltage serves as the input to the LTC6990, resulting in a temperature-to-frequency converter signal chain.
How to Convert a Temperature Input to a Frequency Output?
Today, many modern electronic appliances require an on-board temperature monitoring system. The method of converting analog signals to pulse-width modulated signals or digital signals is well documented. However, if the measurement solution would require an ADC, there are drawbacks associated with cost, accuracy, and speed. Typically, the more accurate the measurement, the more expensive the solution. This circuit delivers a low cost, versatile, and easily interfaceable solution whose accuracy can vary as determined by the needs of the temperature measurement system.
The AD8494 is a precision thermocouple amplifier, but it also can be used as an ambient temperature sensor by shorting its inputs to ground. The output is then defined as:
In this circuit where a unipolar supply is used, –VS = ground (0 V) and an offset voltage must be applied to the REF pin of the AD8494 in order to bias the output voltage above ground, even if ambient temperatures are negative.
The output voltage of the temperature sensor, VOUT, is defined as:
In VCO mode, the LTC6990 frequency output is defined as:
Since the output voltage of the AD8494 is VCTRL to the LTC6990, Equation 1 can be substituted for VCTRL in Equation 2, and setting RSET = RVCO yields the following:
From here, Tambient can now be solved for. The voltage units cancel out, which yields Equation 5:
Okay, I Have a Frequency Output. How Is This Useful?
The beauty of a frequency output is that you can use a single GPIO pin to get a sensor measurement. If the synchronous counter circuit in Figure 2 is used, then the rising edge of a clock will always be observed at its CLK_IN input. If the FOUT of the LTC6990 is used as the input clock, then the counter will increment every time a rising edge on FOUT is detected, creating a period counter. If the time interval between each measurement is constant, then the number of periods within a given time interval can be counted and frequency can be determined either by using floating point math or a lookup table. By dividing the acquisition time TAcquisitions by the number of periods counted, we get the period of FOUT. Taking the inverse of this relationship results in Equation 6.
Figure 2. A 4-bit synchronous counter with LTC6990 output as its clock input.
Figure 3. Example Verilog code.
The example Verilog code shows a function that can be used to count the number of periods by using a single GPIO input on an FPGA. The larger the acquisition period, the more accurate the measurement will be. In the case of the following code, a 16-bit counter is used to provide additional resolution. This also assumes the logic that controls the measurement acquisition time is performed at a higher level in the architecture.
Figure 4. Transfer function of the temperature-to-frequency converter.
Conclusion
In this application, a new type of temperature-to-frequency converter is discussed. It provides an accurate, low cost method to measure temperatures. If the temperatures exceed the industrial range of –40°C to +125°C, a thermocouple can be installed at the inputs of the sensor.
As a conclusion, the following plot shows the error of the measurement system. It demonstrates the linear relationship between the ambient temperature and the output frequency as well as the accuracy of the system.
While this solution may not provide a very fine temperature resolution result, for applications where roughly ±2°C error is acceptable, this provides a cheap and simple interface for measuring temperature.
Figure 5. Temperature error.
Additionally, the concept of using a voltage-to-frequency converter can be adapted to measure other types of transducer outputs without the need for an ADC.
References
About the Authors: Chau Tran joined © Analog Devices in 1984, where he works in the Instrumentation Amplifier Products (IAP) Group in Wilmington, MA. In 1990, he graduated with an M.S.E.E. degree from Tufts University. Chau holds more than 10 patents and has authored more than 10 technical articles. He can be reached at chau.tran@analog.com. Naveed Naeem joined Analog Devices in 2016 as a product test development engineer. Prior to joining ADI, he worked as an electrical engineer for an automotive sensors company for 3 years. His interests include sensor applications, analog-to-digital converters, audio applications, and software development. In 2013, he graduated with a bachelor’s degree in electrical and computer engineering from Worcester Polytechnic Institute. He can be reached at naveed.naeem@analog.com.











- “Fundamentals of the Electronic Counters.” Hewlett Packard, 1997.
- Johansson, Staffan. “New Frequency Counting Principle Improves Resolution.” Proceedings of the 2005 IEEE International Frequency Control Symposium and Exposition, 2005.
- Kamal, Ibrahim. “5 Hz to 500 kHz Frequency Meter.” IKA Logic, April 2008.
- Synchronous Counter. ElectronicsTutorials, 2019.
About the Authors: Chau Tran joined © Analog Devices in 1984, where he works in the Instrumentation Amplifier Products (IAP) Group in Wilmington, MA. In 1990, he graduated with an M.S.E.E. degree from Tufts University. Chau holds more than 10 patents and has authored more than 10 technical articles. He can be reached at chau.tran@analog.com. Naveed Naeem joined Analog Devices in 2016 as a product test development engineer. Prior to joining ADI, he worked as an electrical engineer for an automotive sensors company for 3 years. His interests include sensor applications, analog-to-digital converters, audio applications, and software development. In 2013, he graduated with a bachelor’s degree in electrical and computer engineering from Worcester Polytechnic Institute. He can be reached at naveed.naeem@analog.com.
InnovationLab acquires flexible printed battery technology from Evonik
German printed electronics specialist, InnovationLab, has acquired the TAeTTOOz printable battery technology from Evonik.
Sponsored content by Fusion
Manufacturers Reassess their Supply Chains
Prevailing obstacles since the COVID-19 Pandemic in 2020 have manufacturers reassessing their supply chain strategies. The following major disruptions that occurred entering 2022 added to existing setbacks, or created new ones altogether:
Motorola secures chip supply with GlobalFoundries deal
The US semiconductor foundry has entered into a long-term agreement to safeguard the supply of chip solutions for Motorola Solutions' radios, which are widely used by public safety, critical infrastructure and enterprise organisations.
Nexperia and Kyocera to develop GaN automotive power modules
Nexperia and Kyocera AVX Components (Salzburg) GmbH, have entered into a partnership with a focus on power components – the companies aims to jointly developing GaN applications for electric vehicles.
Intel invests $700 million in new Oregon mega lab
The US chipmaker plans to invest more than USD 700 million for a 200,000 square-foot, research and development mega lab focused on data center technologies and addressing areas such as heating, cooling and water usage.
Obsolescence management cannot be an afterthought
“Obsolescence has always existed. However, it usually only becomes really critical for companies when the exception mutates into the norm. And in recent years we have unfortunately experienced this unwanted development not only with semiconductor chips, but increasingly with many other components, materials and raw materials,” says IIOM President and COGD Chairman Dr Wolfgang Heinbach.
Tower record 1Q22 revenues of $421 Million, a 21% YoY
Tower Semiconductor reported first quarter 2022 revenue of USD 421 million, an increase of 21% compared to USD 347 million in the first quarter of 2021.
Gallium Semiconductor opens its Nijmegen R&D center
Gallium Semiconductor has officially held the grand opening of its European R&D center in a ceremony in Nijmegen, the Netherlands.
Ferrotec to add manufacturing capacity with new plant in Malaysia
Ferrotec, a global supplier of materials, components, and precision system solutions, is establishing a new manufacturing facility at Kulim Hi-Tech Park, Kedah, facilitated by the Malaysian Investment Development Authority (MIDA).
Sponsored content by Proval Service
Since 25 years your partner for SMT stencils and solder pallets.
25 years of experience makes Proval Service not just a supplier but your trustful and grounded partner to support you with SMT stencils and solder pallets. A qualified and unite team can satisfy every customer's need during the whole process.
Skeleton targets the Polish market – teams up with ZPUE
Supercapacitor specialist, Skeleton Technologies, and ZPUE, a Polish manufacturer of electrical devices for electrical power distribution utilities, have entered into a commercial agreement to provide energy storage solutions to the Polish market.
ERP partners with Flip to fulfill EOL and Obsolete component solutions
Flip Electronics has signed a franchised distributor partnership agreement with ERP Power (ERP) to distribute its End-of Life (EOL) semiconductor products.
Foxconn and DNeX build and operate wafer fab in Malaysia
Dagang NeXchange Berhad (DNeX) and Foxconn subsidiary Big Innovation Holdings (BIH), plan to set up a joint venture company to build and operate a new 300mm wafer fab in Malaysia.
Imec and semiconductor partners target greener chip manufacturing
Nanoelectronics research and innovation center, imec, says that it has managed to pool together stakeholders from the semiconductor value chain – from companies such as Apple and Microsoft, to suppliers, including ASM, Kurita, SCREEN and Tokyo Electron – to participate in its Sustainable Semiconductor Technologies and Systems (SSTS) research program.
SiPearl reaches milestone – 100 employees
The European chip designer has exceeded 100 employees across its six sites in France (Maisons-Laffitte, Grenoble, Massy, Sophia Antipolis), Germany (Duisburg) and Spain (Barcelona).
Arrow names Jörg Strughold as president EMEA components
Arrow Electronics announces that Jörg Strughold will take over as president of its components business in EMEA. He succeeds Martin Bielesch who has decided to leave the company.
€14 billion to attract semiconductor players to Germany
EUR 14 billion in state support is the German governments new strategy to attract more chipmakers to the country.
10 different companies have expressed interest in Toshiba
Back in April 2022, Toshiba Corporation announced that it had resolved to solicit proposals on strategic alternatives from potential investors and sponsors. The Japanese company is seeking to enhance its corporate value and has since the announcement been holding discussions with the potential partners.
Avnet breaks ground on German expansion
In order to better serve its customers’ local and global needs, Avnet is expanding in two locations in Germany. Avnet Embedded broke ground on a new manufacturing site in Eschbach and Avnet EMEA plans to build its third European logistics centre in Bernburg.
Viettel & Qualcomm team up on 5G infrastructure development
Viettel Group and Qualcomm Technologies plans to collaborate and develop a next-generation 5G Radio Unit (RU) with massive MIMO capabilities and distributed units (DUs). This focuses on helping to expedite the development and roll-out of 5G network infrastructure and services in Vietnam and globally.
Applied Materials opens Montana expansion – create 200 new jobs
The company has opened its latest expansion in Montana, a new semiconductor manufacturing center set to create 200 jobs in the Flathead Valley.
How to easily select the right frequency generation component
Question: What is the right frequency generation component for my application?
Bell Semiconductor is suing companies left and right
In late April, Bell Semiconductor, a Pennsylvania-based technology and intellectual property licensing company, filed lawsuits against Micron, Infineon, Nvidia and seven other companies alleging infringement of one of its patents.
Load more news