6 things I learn from my beginner Raspberry Pi projects
This is not a technical writeup. Rather, it is just my ramblings of the Raspberry Pi.
Raspberry Pi (Raspi), the mini, credit card size, 1GB RAM computer. Portable, light-weight and functional. When I bought my Raspi, my aim was to dabble in robotics. Ultimately, my goal is to create a self-driving toy car that will shoot darts when it senses any unsuspecting passer-by. Okay, it is one of the lame project ideas that I thought it will be funny to create.
Right now, I’m far from that stage. In fact, all I ever did accomplish with my Raspi is to integrate Google AI API and light up some LED as you can see from the instagram posts. While setting up, writing and running the Fizzbuzz test on LED lights, I make some wonderful discovery in this world of electronics. Here are 7 things that I learn from running my beginner Raspi projects.
6. Some RPi buzzword: General-purpose input/output (GPIO)
I first come across GPIO during a developer meetup. The developer is presenting his embedded system operating on Node.js. I can’t exactly remember what he is doing, other than the fact that there is some temperature sensors somewhere. Although I don’t understand most of the presentation, it is fascinating. Raspi has a 40-pin GPIO header and it is used for controlling logic, either as an input or ouput.
5. GPIO numbers have a weird sequence
Speaking of GPIO, the numbering of GPIO seems to be random. Though, I’m pretty sure nothing in computer hardware is random. For example, GPIO5 is nowhere close to GPIO4. And the “last” GPIO pin is not labeled with the “last” GPIO numerical value.
4. Secure Shell (SSH) and Virtual Network Computing (VNC) viewer
In order to control the Raspi, you can connect a keyboard, a mouse and a monitor to the USB ports and HDMI port on the Raspi. But I find it much easier to work from a laptop. Enter SSH and VNC viewer. SSH allows me to program and copy files to the Raspi from my laptop. With VNC viewer, I could easily display the screen of the Raspi on my laptop.
Time to connect the breadboard, LED and Raspi.I bought a kit of jumpers, breadboard, resistors and a bunch of hardware stuff which I don’t know about for less than 20 dollars. We described the end of the jumper as female and male for obvious reasons. Male connector is a protrusion that plugs in and a female connector is a receptor that receives. Put more crudely and in more visual terms, male has a sticking out “pin” while female has a “hole”.
2. Circuits, breadboard, power, voltage and current
Now comes the fun part: Hardware. Plugging things in and testing. This is where I realise how important my secondary school physics is: Ohm’s law. Ohm’s law is a formula used to calculate the relationship between voltage, current and resistance in an electrical circuit.
Ohm's Law Voltage: The difference in charge between two points
Current: The rate at which charge is flowing
Resistance: A material's tendency to resist the flow of charge (current)
Current(I) = Voltage (V) / Resistance (R)
If there is too much current, the LED will burn. Hence, a resistor is added into the circuit to make sure the LED works correctly.
At the soul of any hardware is the software. Python is a general-purpose programming language. You can use it for data science, scrapping website, build apps, home automation and of course to power Raspberry Pi. Python code is generally easier to read and supports various programming paradigms. Together with a few other open source library, writing the python code for Raspberry Pi is a breeze. You can view the LED telegram-bot controller at Github.
Here are the 6 basic things that I learn from my Raspberry Pi project. I just order a smart robot car chasis kit, it only costs me about $10! Stay tune for more of my tinkers.