Analogue

An app for the Kookaberry

Developed by
Tony Strasser

AustSTEM

This demonstrates the conversion of an analogue to a digital signal; its display as a histogram; and the generation of a control signal when a threshold signal value is reached.

Directions

Step 1: Setup

Plug a potentiometer into P4 and a LED into P2 using the 3-wire leads.

       

Step 2: Running the app

Navigate to the Analogue app and press Button B to run

What is showing on the screen?

  1. Top Row: Name of the app
  2. Second Row:
    • % value of the analogue voltage being applied at P4
    • Histogram showing the % value graphically. An adjustable threshold level (50%) is shown as a % of a “full” histogram.
    • A light bulb icon is shown when the threshold level is exceeded. P2 is also turned ON.
  3. Third Row: Prompts for peripherals
  4. Fourth Row: Button A is Exit and Buttons C and D move the threshold value up or down

Step 3: Using the app to turn a light on when a threshold is reached

Turn the potentiometer to vary the analogue input level at P4

In the screenshots above,

  • the first shows the LED OFF because the input level (36%) is below the 50% threshold level.
  • the second shows the LED ON because the input level (60%) is above the 50% threshold level. The LED connected to P2 will alsp light up.
  • the third is the same as the first except that the threshold level has been reduced (by pressing Button C) to 25% and the input level is 20%.

The input can be any compatible analogue input such as a potentiometer, light sensor, hygrometer, sound sensor etc.

The output can be any compatible digital on/off device such as an LED, motor, buzzer etc.

How does it work?

The potentiometer is an analogue input device which adjusts the voltage at the input connector (P4) between Vcc (3.3v) and Ground (0v). The Kookaberry can recognise analogue signals on P4, and converts the analogue to a quantised digital signal by sampling and measuring the instantaneous level at high speed. The circuit that does this is called an Analogue-to-Digital Converter (ADC).

The digital value of the level of the input analogue signal is displayed on the screen as a vertical bar (a histogram).

When the input signal level is at, or beyond, the threshold level, output P2 is turned ON. This means that the voltage level at P2 is raised from ground (0v) to the Kookaberry’s working voltage (Vcc) of 3.3v. In other words, from a digital 0 to a digital 1.

Threshold detection also displays a lightbulb on the screen and lights an LED on the front of the Kookaberry

Peripherals used by this app

Version:


Last updated:1 week ago


Device:Kookaberry


Radio code:


App ID:...


lib_dependencies:Kapputils.py


root_dependencies:Kappconfig.txt


Downloads

Download on GitHub
Image

Support

Issues resolved in the support forum:

8 out of 11
View support forum

Leave a Reply