Computer Science Tutorials
Created by @1061999
You can find this tutorial online at https://hackclub.com/workshops/control_an_led
Raspberry Pi has become an integral part of IoT projects.
The Internet of Things (IoT) is a system of interrelated computing devices, mechanical and digital machines, objects, animals or people that are provided with unique identifiers and the ability to transfer data over a network without requiring human-to-human or human-to-computer interaction.
In this project, we are going to use a “drag and drop” IoT project builder platform called Cayenne. With this platform, we can read sensor data, control actuators, etc. without having to worry about complicated code writing.
First of all, we are going to control an LED bulb using the Cayenne app (Cayenne can also be accessed through a browser).
All equipment is available for purchase from most electronic retailers. A great place to find it may be where you purchased your Raspberry Pi.
Turn on your Raspberry Pi and connect it to your network.
Positive end of the LED should be connected to GPIO 17 of Raspberry Pi. The negative end can be connected to any of the GND available in the Raspberry Pi.
Follow the Raspberry Pi GPIO specification sheet for clarification.
⚠️ Don’t forget the resistor - directly connecting the LED will sometimes damage it!
Fill in the information needed as specified below:
First field: Name it as Light switch
Second field: Select Raspberry Pi
Third field: Select Integrated GPIO
Fourth filed: choose 11, since we have connected our LED to GPIO 17 which is on pin 11.
Enable Invert Logic
Leave the other two fields as is.
Then click add button below.
That’s it, you have successfully configured your Raspberry Pi. A button should appear on the interface. Now click that button that you have created, and you should see the LED turning ON! 💡
You have completed your very first IoT project. Since Cayenne is very easy to use, you can make your own projects by hooking up different modules and sensors. All you need is that maker mind and that passion to learn how things work. If you have any questions, Google is always your best helper!
We will be adding projects to this series in the future. For now, you can check out Cayenne’s website for more beginner-friendly tutorials!
Hack it away!