Using Inputs

Posted on Feb 6, 2014

A control program usually requires more than turning outputs on and off. They switch on and off because an event has happened. This event is then connected to the input of the microcontroller to `tell` it what to do next. The input could be derived from a switch or it could come from a sensor measuring temperature, light levels, soil moisture, air

Using Inputs
Click here to download the full size of the above Circuit.

quality, fluid pressure, engine speed, etc. In this chapter we will concern ourselves with digital on/off inputs. As an example let us design a circuit so that switch SW 1 will turn an LED on and off. The circuit diagram is shown in Fig. 11. 1. This circuit uses the 16F84 microcontroller with a 32-kHz crystal. It can of course also be performed with any of the microcontrollers discussed previously, including the 16F818 using its internal oscillator, in which case the crystal and 2 68pF capacitors are not required. In the circuit diagram SW1 is connected to A0 and LED1 to B0. When the switch is closed A0 goes low or clear, so we wait until A0 is clear. The code for this is:

Leave Comment

characters left:

Related Circuits

  • New Circuits



    Popular Circuits

    Remote Thermometer circuit
    White LEDs Flashlight
    Little dipper
    Audio booster
    Sound Effects Generator Circuit
    15W FM RF Amplifier with 2SC2539
    7 Segment Display Counter based 74LS90
    Ultra Fast Battery charger circuit Schematic Diagram
    tesla tc plans
    Processor Fan Control
    Automatic Windshield Washer Control
    High-Voltage Regulator With Short Circuit Protection
    DMAl2 Main schematic circuit diagram
    Touch delay switch circuit diagram CD4013 composed
    Dual power supply circuit contactor mutual investment 2