Wk4 - Acquiring Data 2 & Generating Signals Flashcards
What is the purpose of an analog-to-digital (A/D) converter?
It converts a continuous voltage signal into a digital numerical equivalent. More bits = higher resolution, but higher cost.
WWhat are two-state signals? Give some real-world examples.
Signals that have only two possible states, typically represented as voltage present or voltage absent. They vary like an analog signal but not continuously.
Examples include a door open/close switch, high/low water level, person present/absent, and alarm on/off.
How many bits does an A/D converter need to accurately digitize a two-state signal?
One bit. Two-state signals can be represented by 0 or 1, corresponding to the two possible states.
Does acquiring 2-state signals require an A/D converter?
No, the IoT device can sample them directly. These signals are sometimes called digital signals.
What is Pulse Width Modulation (PWM)?
A technique used to vary the average output of a digital signal by changing the ratio of on to off time, called the duty cycle.
How does PWM allow for perceived analog output?
Even though a digital signal is ON or OFF, by regulating the width of the ON pulse, we can vary the average output. The more time the signal is ON relative to OFF, the higher the average output.
If a light is flashed rapidly enough (i.e. > 100 times/second), humans will not perceive that the signal is simply on or off – humans will perceive only the average level of the signal.
Why does PWM work for generating perceived analog signals?
Humans can’t perceive rapid on/off switching above 100 Hz, so it appears as a continuous signal, like dimming a light.
What are some applications of PWM?
Varying light brightness, controlling motor speed, regulating microwave oven power output, and generating analog signals.
What function is used to control the state of a digital output in software?
Use the digitalWrite(pin, value) function, where value is either HIGH (1) or LOW (0).
Can the D1 Mini generate a true analog signal?
No, it requires a separate D/A converter, but PWM can be used to simulate analog output.
Can we generate a continuously variable analog signal?
We use a digital-to-analog (D/A) converter to generate an analog signal.
What is the function used to read digital inputs in software? What does it return?
digitalRead(). It returns a 1 or 0.