📖🎹Outputs (Low Power)

Fundamental Circuit Tutorial
Output (Low Power) Circuit Tutorial

This is a standard circuit for turning things ON/OFF.

 

 

 

In this tutorial we will use an LED as our output device. Since this is a standard circuit students may substitute the LED for their own low power device (e.g. piezo speaker).

Instructions

Schematic

 

Program Code

We can see from our programming outputs tutorial that we can make pins High/Low.

 Download the following example code:

' Turn device On and Off Example (TOGGLE)
' Toggle.txt
' Kic8 

  ' Our example assumes your device is connected to Out2
  SYMBOL MyDevice = 2

DO

  ' Turn the device On/Off
  Toggle MyDevice

  ' Pause for a short while (1 second) - to see changes..
  Pause 1000
  
LOOP

We call this sourcing because the pin is the source of the 5 Volts needed to power our device. By making our pin go HIGH we turn our device ON.

 

  Sinking Power

Another aproach is to allow power to flow into the chip, we call this sinking. Modify your circuit so that the LED connects to the 5 Volt power instead. By making our pin go HIGH we turn our device OFF (try the above piece of code again and observe).

Schematic

 

  Is your circuit low power?...

You need to look at the power ratings for your device, this tells you how much electric current is required. The rating for a single LED (see component reference) is25mA

The maximum safe current for a single I/O Pin is 25mA.

The maximum safe total current for all I/O pins on a port is 100mA

When sourcing power, the KicChip limits an I/O pin to 25mA using an internal resistor.

There is no internal resistor for sinking power, so an external resisitor must be used.