Due to climate change, our lives are affected by the changing weather patterns that naturally occur. Using the components of this kit, you should be able to make devices capable of sensing changes around your home and person, and alert or change your environment to off-set danger or cost.
This component here is a temperature and humidity sensor.
The three legs at the bottom of the module have labels. These labels are: GND, DATA and VCC when read left to right.
VCC stands for Voltage Common Connector, or Power
DATA means module information output
GND stands for Ground.
We’ll be connecting each leg to a breadboard to form a circuit.
This here is a breadboard.
It has two pairs of rails on the edges of the board. These rails are positive (red) and negative (blue). Power is transferred through the positive rail. Ground is transferred through the negative rail.
The inner columns have numbers and letters denoting the position of each plug. Imagine each hole as the plug of an extension board. From these, we can power many different devices and modules.
The bottom image is what the breadboard looks inside. The dark sections are made of conductive metal.
This is a GPIO Board. This allows us to access all 19 usable pins of a plugged in Microbit as well as the Voltage (3.3V or 5V) and Ground pins (GND).
The GPIO Board should be plugged into the Breadboard where the legs under the 5V pin and 3.3V pin are in plugs e1 and f1.
The broad part of the T-shape should hang off the breadboard.
This is our circuit for the Temperature and Humidity sensor.
We will have one end of a wire plugged into the same column as the 5V, and the other end anywhere on the positive rail.
Another wire will connect the positive rail to the same column as the VCC leg of the sensor.
Another wire will connect the column with the module’s GND leg to the negative rail, and another wire connecting the negative rail to the GND pin of the GPIO Board.
Finally, we’ll have a wire connecting the column DATA is connected to the same column as P15 on the GPIO Board.
In order to code our Microbits, the first thing we need to do is add the extension we’ll use that is compatible with all the components. This extension is called "iot-environment-kit".
First, we’ll tap on Advanced then Extensions.
Next we’ll search “iot” in the search bar. This is what the extension looks like. =>
When we tap on it and load it, it will add a number of new categories on our side menu. The one we’ll be focusing on is Octopus.
Next, we’ll create a new Variable. This variable will be named Temperature and we’ll want to set that temperature variable to the input from the sensor.
However, we don’t want Temperature to be set to 0 all the time. How we’ll access the input from P15 (which is connected to the temperature and humidity sensor) goes like this:
Octopus > more > value of dht11...
Next we want to show our values coming in, so we’ll get a Show String block to tell us what we are measuring then add a Show Number beneath it.
Inside show number we’ll want to put the round Temperature variable.
Once you’re done, you can download your code to your Microbit and test it!