Description: This technique uses digital I/O pins to multiplex analog voltages into an analog input on the microcontroller. The method is most suitable for signals that do not need to be sampled frequently and it may be extended to accommodate a large number of inputs, though for a large number of inputs, the use of a separate analog multiplexer or a microcontroller with an integrated multiplexer would often be a better choice.
The AT90S1200A used for the test has a single comparator, but an analog multiplexer was formed using two of its digital bidirectional I/O ports. Notice that for each analog input, there is a 100k resistor, a 0.01 µF capacitor, and a diode. The resistor-capacitor combination forms a low-pass filter, and switching of the charged capacitor is the means by which multiplexing is effected. The technique takes advantage of bidirectional I/O ports to switch from outputs to inputs. In the case of many AVR controllers, the input of the comparator shares a pin with a bidirectional I/O bit. This allows the pin to be held at ground and then ungrounded when using it as an input for the comparator.
Most of the time, the circuit is in the "filtering" state. The inputs are sampled periodically at a low duty cycle as the sampling duty cycle affects cross talk among the inputs. During filtering time, pin 12, which is the input to the comparator, is held at ground and pin 12 (the I/O pin is an output, written with a logic low), Pin 14, which is the multiplexing pin, is open. Under these conditions, the filter capacitor is kept charged to the input voltage (V1).
When it is time for the input voltage to be connected to the comparator input, pin 12 is opened (the I/O pin is made into an input) and the multiplexing pin, pin 14, is connected to +5V (made into an output pin and written with a logic high). This causes the positively charged plate of the capacitor to be connected to +5V through the diode. This results in a Vdd minus one diode drop, minus the voltage on the capacitor being applied to pin 12.
Vpin12 = Vdd - Vdiode - Vin
Where
Vpin12 = the voltage applied to the analog input of the comparator, pin 12,
Vdd = the power supply voltage, 5 volts in this example,
Vdiode = the voltage drop across the diode, which is somewhat dependent on the current through the input resistor, and
Vin = the input voltage applied to the input of the RC filter.
One thing that should be apparent from looking at the expression above is that input voltages are restricted to the range of 0 volts to Vdd-Vdiode, or 0 to about 4.4 volts. As voltages approach 4.4 volts, the current through the diode will become very low, and a noticeable linearity may develop.
The circuit design employs a microcontroller, specifically the AT90S1200A, which is equipped with a single comparator. The use of two digital bidirectional I/O ports allows for the creation of a rudimentary analog multiplexer. Each analog input is connected through a 100kΩ resistor, a 0.01µF capacitor, and a diode, forming a low-pass RC filter. This configuration is crucial for filtering high-frequency noise and stabilizing the input voltage before it is read by the comparator.
The operation begins in a filtering state where the I/O pin (pin 12) is configured as an output, holding it at a low logic level (ground), while the multiplexing pin (pin 14) remains open. This setup keeps the capacitor charged to the input voltage, allowing it to stabilize before sampling. When sampling is required, pin 12 is switched to input mode, allowing the voltage across the capacitor to be read. Simultaneously, the multiplexing pin is set to output a high logic level (+5V), which facilitates the transfer of the stored voltage from the capacitor to the comparator input through the diode.
The mathematical relationship governing the voltage at the comparator input illustrates the limitations of the input voltage range due to the diode's forward voltage drop. This design consideration is essential for ensuring that the analog signal remains within the operational limits of the microcontroller's ADC, preventing saturation or erroneous readings. The overall architecture allows for efficient multiplexing of multiple analog signals while maintaining signal integrity through careful filtering and voltage management.This technique uses digital I/O pins to multiplex analog voltages into an analog input on the microcontroller. The method is most suitable for signals that do not need to be sampled frequently and it may be extended to accommodate a large number of inputs, though for a large number of inputs, the use of a separate analog multiplexer or a mincrocontroller with an integrated multiplexer would often be a better choice.
The AT90S1200A used for the test has a single comparitor, but an analog multiplexer was formed using two of its digital bidirectional I/O ports. Notice that for each analog input, there is a 100k resistor, a .01 uf capacitor, and a diode. The resistor-capacitor combination form a low pass filter and switching of the charged capacitor is the means by which multiplexing is effected.
The technique takes advantage of bidirectional I/O ports to switch from outputs to inputs. In the case of many AVR controllers, the input of the comparitor shares a pin with a bidirectional I/O bit. This allows the pin to be held at ground and then ungrounded when using it as an input for the comparitor.
Most of the time, the circuit is in the "filtering" sate (see the illustrations above). The inputs are sampled periodically at a low duty cycle as the sampling duty cycle affects cross talk among the inputs. This is discussed in more detail below. During filtering time, pin 12, which is the input to the comparitor is held at ground and pin 12 (the I/O pin is an output, written with a logic low), Pin 14, which is the multiplexing pin, is open.
Under these conditions, the filter capacitor is kept charged to the input voltage (V1). When it is time for the input voltage to be connected to the comparitor input, pin 12 is opened (the I/O pin is made into an input) and the multiplexing pin, pin 14, is connected to + 5V (made into an output pin and written with a logic high). This causes the positively charged plate of the capacitor to be connected to +5V through the diode. This results in a a Vdd minus one diode drop, minus the voltage on the capacitor being applied to pin 12.
Vpin12 = Vdd - Vdiode - Vin
Where
Vpin12 = the voltage applied to the analog input of the comparitor, pin 12,
Vdd = the power supply voltage, 5 volts in this example,
Vdiode = the voltage drop across the diode, which is somewhat dependent on the current through the input resistor, and
Vin = the input voltage applied to the input of the RC filter. One thing that should be apparent from looking at the expression above, is that input voltages are restricted to the range of 0 volts to Vdd-Vdiode, or 0 to about 4.4 volts.
As voltages approach 4.4 volts, the current through the diode will become very low, and a noticeable linearity may develop.
The microcontroller-based water level controller and motor protector manages the on and off states of the motor based on the water level in the overhead tank (OHT). It regulates the tank's water level through a microcontroller, thereby providing automatic protection...
Many of today's appliances feature displays and buttons. Instead of relying on motors and gears, numerous household items now incorporate embedded microcontrollers. This exploration focuses on how to experiment with microcontrollers at home.
Microcontrollers serve as the central processing units for...
A simplified block diagram of the MiniLOGGER is presented. The CMOS analog multiplexer, 4051, provides output for an 8-channel single-ended input to the analog-to-digital converter chip, CA3162, which operates in free-running mode. The digital output is a 4-bit BCD format,...
Utilize a high-performance microcontroller (Piccolo TMS320F28035, 12-bit resolution, +/- 4 LSB offset, +/- 60 LSB gain) to measure the voltage across stacked battery cells and control related analog electronics for charge equalization. The microcontroller will also save data in EEPROM...
The reflected infrared (IR) signal detected by the photodiode is sent to a signal conditioning circuit, which filters out unwanted signals and amplifies the desired output.
The circuit begins with a photodiode that captures the reflected IR signals. The photodiode operates...
For those who prefer convenience, it is possible to turn the bedroom light on or off without leaving the bed simply by clapping hands. This concept inspired the design of a clap-activated light control system. Various clap switch projects can...
Model railroad turnouts, often referred to as switches, can be controlled in various ways. The simplest method is manual control, operated by hand. Remote activation is typically achieved through pneumatic (air) or electrical means. The project discussed in these articles...
Cymbet Corporation provides rechargeable solid-state batteries designed for advanced microcontroller power backup applications. The company is recognized as a leader in thin-film energy storage technology.
Cymbet Corporation's rechargeable solid-state batteries are engineered to deliver reliable power solutions for microcontrollers, which are...
This document presents an overview of the hardware design of the Handy Cricket.
The Handy Cricket is a compact electronic device designed for educational and recreational purposes, primarily aimed at children. The hardware design incorporates various components that work together to...
We use cookies to enhance your experience, analyze traffic, and (if you allow) serve personalized ads.
By clicking Accept All, you agree to our use of cookies.
Learn more