Table of Contents

Adding external Analog Sensors

One external analog sensor can be connected to the Kniwwelino through the A0 pin available on the outer area. The analog A0 pin is capable of measuring voltages from 0-5v. To work with such a Sensor, you need additional material: an analog sensor (potentiometer e.g.), as well as wire to create a closed circuit using the pins of the Kniwwelino.

With the Kniwwelino Blocks, you can read an analog voltage value (0-5v) on pin A0 which will be available as values from 0-1023 in .

In the following we describe how to connect an external potentiometer to the Kniwwelino to read an analog value.

Preparing the Kniwwelino Board for an external analog sensor

Take a scrap piece of wire and solder it to the outer two of the three pads below the “enable AD” label of the Kniwwelino Board. After the two pads are connected by the soldered wire, cut of the rest of the wire. Check if both pads are connected and the third inner pad is left open.

Connecting an external potentiometer with alligator clips

You need:

To connect the Potentiometer:

Now your potentiometer as acting as a voltage divider which provides 0-3.3v on the center pin - depending of the rotation of the potentiometer axis.

As soon as you program Kniwwelino read an analog value on pin A0 (see below), you will retrieve the analog voltage from 0-5v as a numeric value from 0-1023.

Instead of using a rotary potentiometer, you can also use a sliding potentiometer:

Connecting an external potentiometer with wire

You can also connect your potentiometer with wire, by adopting the same approach as for connecting external LEDs (winding and tape), or by soldering them.

Programming external analog sensors

You can read the current value of the analog sensor with the following block.