Raspberry Pi Zero GPIO programming

Work in progress…

Introduction

In this series of tutorials, we are going to write computer program to run on a mini computer, called Raspberry Pi Zero W.

Computer program, is a collection of instructions that a computer understands and does things accordingly.

We are going to use Python programming language. Sometimes, I refer it simply as ‘scripts’.

There are a variety of softwares we can write. They do different things, such like serving a website, plays videos, minecraft games and handling financial transactions.

The kind of software you write depends on what kind of hardware, devices you would like the computer to operate on.

This series focus on use GPIO (General-purpose input/output ). GPIO is a set of generic pins on the computer board. We attach devices, such like LED lights, motor, button to the pins.

We will use Python scripts to sends electronic signals to each pin or receive signals from some pins. With that,computer can control these devices and human can interact with the computer .

For example, we can create a pair of scripts to send and receive morse codes (tutorial 1 and tutorial 5). We can add motion sensors to detect movement, then do something about it.

Bill of Materials

Tutorials

Tutorial 1: Morse Code Generator

Controlling a LED to send a sequence of morse code signals. Use python script to generate a sequence of morse code by reading user input sentence.

Ref LED: https://gpiozero.readthedocs.io/en/stable/recipes.html

Tutorial 2: Morse Code Sender

In this tutorial we add a buzzer and a tactile button to the mix. We can type in any morse code ourselves.  Our script reads button input signals (press/release? holding press)

Tutorial 3: Light Sensor

We use a light sensor to detect ambient light changes. When it is too dark, the led lits up, and when it is bright enough, the led switches off automatically.

Tutorial 4: Morse Code Receiver

Receive light signals and translate it back to text message. We can even display the message on another LED panel.