Page 145 - KEC Khaitan C6 Flipbook
P. 145
∑ You (the Micro:Bit) ask for something.
∑ The API (the waiter) takes your request to a website or app (the kitchen).
∑ The website or app sends back the information (your food).
For example, if your Micro:Bit wants to send temperature data to ThingSpeak, it uses an API Key
(like a secret password) to send the data. The ThingSpeak API then saves the data so you can
see it later. So, an API helps different devices and websites talk to each other—just like a waiter
helps you talk to the kitchen
SENDING DATA FROM SENSORS TO THE CLOUD
The Micro:bit has many sensors, like a temperature sensor, and can measure things like light or
distance. But what if you want to store that data online and see it later from any device? This
is where ThingSpeak helps. By connecting your Micro:bit to the ThingSpeak platform, you can
upload data from your sensors to the cloud and view it on the ThingSpeak website.
Here's how you can send the data from your Micro:bit’s sensor to the cloud using the WiFi shield.
Follow these simple steps to make it happen.
Step 1 Set Up ThingSpeak
Before we start sending data from the Micro:Bit, we need a place to store it. ThingSpeak
is a website that helps us save and view our data in an easy way. Let’s create an account
and set up a channel to store our Micro:Bit data.
1. Open a web browser and type https://thingspeak.com in the address bar and press
Enter.
2. Click on the Sign-Up button and do the following:
∑ Fill in the required details:
o Email Address
o Location
o Your Name
o Username (choose any name you like)
o Password (make sure to remember this)
∑ Click on Create Account.
∑ You may receive a confirmation email. Open your email and click on the
confirmation link to activate your account.
3. Log in to ThingSpeak
∑ Once your account is created, go back to ThingSpeak.
∑ Click Log In and enter your username and password.
4. Create a New Channel
∑ Click on New Channel (you will find this on the homepage after logging in).
Building Smart Solutions: An Introduction 143

