All About Circuits

Digital Circuits

Microcontroller Principles


20 questions By Tony R. Kuphaldt

Page 4 of 7 0 of 20 answers revealed (0%)
  • Question 10 of 20

    A microcontroller is a specialized type of digital computer used to provide automatic sequencing or control of a system. Microcontrollers differ from ordinary digital computers in being very small (typically a single integrated circuit chip), with several dedicated pins for input and/or output of digital signals, and limited memory. Instructions programmed into the microcontroller’s memory tell it how to react to input conditions, and what types of signals to send to the outputs.

    The simplest type of signal “understood” by a microcontroller is a discrete voltage level: either “high” (approximately V) or “low” (approximately ground potential) measured at a specified pin on the chip. Transistors internal to the microcontroller produce these “high” and “low” signals at the output pins, their actions being modeled by SPDT switches for simplicity’s sake:



    It does not require much imagination to visualize how microcontrollers may be used in practical systems: turning external devices on and off according to input pin and/or time conditions. Examples include appliance control (oven timers, temperature controllers), automotive engine control (fuel injectors, ignition timing, self-diagnostic systems), and robotics (servo actuation, sensory processing, navigation logic). In fact, if you live in an industrialized nation, you probably own several dozen microcontrollers (embedded in various devices) and don’t even realize it!

    One of the practical limitations of microcontrollers, though, is their low output drive current limit: typically less than 50 mA. The miniaturization of the microcontroller’s internal circuitry prohibits the inclusion of output transistors having any significant power rating, and so we must connect transistors to the output pins in order to drive any significant load(s).

    Suppose we wished to have a microcontroller drive a DC-actuated solenoid valve requiring 2 amps of current at 24 volts. A simple solution would be to use an NPN transistor as an “interposing” device between the microcontroller and the solenoid valve like this:



    Unfortunately, a single BJT does not provide enough current gain to actuate the solenoid. With 20 mA of output current from the microcontroller pin and a β of only 25 (typical for a power transistor), this only provides about 500 mA to the solenoid coil.

    A solution to this problem involves two bipolar transistors in a Darlington pair arrangement:



    However, there is another solution yet - replace the single BJT with a single MOSFET, which requires no drive current at all. Show how this may be done:



    Reveal answer
  • Question 11 of 20

    A microcontroller is used to provide automatic power factor correction for an AC load:



    Examine this schematic diagram, then answer the following questions:

    How can the microcontroller sense the power factor of the AC load?
    How many discrete steps of power factor correction can the microcontroller engage through its four output pins?
    What would the MCU’s output be to correct for a load drawing 15 amps with a lagging power factor of 0.77? Assume a line frequency of 60 Hz, and a correction algorithm that adjusts for the best lagging power factor (i.e. it will never over-correct and produce a leading power factor).
    What is the corrected (total) power factor with those capacitors engaged?
    Reveal answer
  • Question 12 of 20

    This microcontroller is programmed to vary the perceived brightness of an LED by means of pulse-width modulation (PWM) control of pin 0’s output:



    Pseudocode listing Declare Pin0 as an output

    Declare X as an integer variable

    LOOP

    Set Pin0 LOW

    Pause for 100 - X microseconds

    Set Pin0 HIGH

    Pause for X microseconds

    ENDLOOP

    Determine what the value of X must be to set the LED’s brightness at 80%, and also what the frequency of the PWM signal is.

    Reveal answer