In the previous tutorial, we covered how to interface a SIM900A GSM-GPRS modem with Raspberry Pi, Arduino, and desktop computers. SIM900A can communicate data with the controlling device over the universal asynchronous receiver/transmitter (UART), I2C, or SPI protocol. The modem is a piece of mobile equipment with an IMEI number that’s capable of all cellular…
RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
In the previous tutorial, we covered the AT commands that are supported by a SIM900 GSM-GPRS modem. We’ve already discussed how to interface a SIM900A GSM-GPRS modem with Raspberry Pi, Arduino, as well as other microcontrollers and desktop computers. Now, it’s time to use this modem to make and receive calls, and send and receive…
RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
In the previous tutorial, we learned how to interface a SIM900 GSM-GPRS modem with Raspberry Pi (RPi) and a desktop computer. We employed serial UART communication to “talk” with the SIM900 modem. By using bidirectional data communication with the modem via a standard UART interface, we were able to make/receive calls and send/receive SMS messages on RPi and…
RPi Python Programming 24: I2C explained
In the previous tutorial, we covered how to interface a NEO-6M GPS module with Raspberry Pi (RPi). The module communicates with RPi over the universal asynchronous receiver/transmitter or UART protocol. The UART is the most common point-to-point data communication protocol. But, it’s not the only serial communication protocol. In embedded electronics, I2C and SPI protocols are…
RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
In the previous tutorial, we discussed the basics of the I2C protocol. In most of the embedded devices, either UART otherwise I2C is used for console messages. In this tutorial, we will discuss serial communication in Raspberry Pi using the I2C protocol. I2C in Raspberry Pi For serial communication over the I2C protocol, the Broadcom…
RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi
In the previous tutorial, we discussed synchronous serial communication in Raspberry Pi using I2C protocol. In this tutorial, we will use the I2C interface of Raspberry Pi to communicate with a digital sensor. The digital sensor that we will talk with is the ADXL345 accelerometer. ADXL345 is a small, ultra-low power, 3-axis accelerometer sensor that…
RPi Python Programming 06: Python basics
In the previous tutorial, we discussed the Python language, its applications, implementations (including CPython, Jython, IronPython, and PyPy), and IDEs. We also learned how to write Python scripts and modules, and how to run Python scripts through an integrated development environment (or IDLE) and a Bash shell. Before we jump to controlling hardware via Python…
RPi Python Programming 05: Introduction to Python
In the previous tutorial, we successfully set up a Raspberry Pi (RPi) Linux desktop. Now let’s learn Python. We could start with how to control the hardware by using Python scripts, but that would defeat the purpose of using Raspberry Pi and a Very-High-Level-Language (VHLL) — such as Python — to control electronics. Certainly, you can…
RPi Python programming 04: Setting up Raspberry Pi Linux computer
In the previous article, we discussed the role of an operating system. We explored how Linux, as an open-source operating system, can be modified and used for mobile, desktop, server, cloud, mainframe, supercomputer, cluster, and embedded computing. Raspbian, the official OS for the Raspberry Pi (PRi), is based on Debian. This is a Linux distribution, which…
RPi Python Programming 03: Raspberry Pi as Linux System
In the previous article, we reviewed several Raspberry Pi models and considered which are most suitable depending on the application. Most of the time, you will be using RPi as a Linux computer. Raspbian, the official operating system for Raspberry Pi, is a variant of Debian OS (a Linux Distribution). Other operating systems are available, but…
RPI Python Programming 02: Raspberry Pi Models
In the previous tutorial, we introduced Raspberry Pi (RPi), including the operating systems it can run, programming languages it can use, as well as its advantages and limitations. We also discussed other single-board computers that are comparable to the RPi. The following models of Raspberry Pi have been released since 2012: Raspberry Pi 1 Model B…
RPi Python Programming 01: Introduction to Raspberry Pi 4
Raspberry Pi is a credit-card sized, single-board computer developed by the Raspberry Pi Foundation, a UK-based charity that works to ensure global access of computing and digital technology. It was initially developed as a low-cost microcomputer to impart digital skills to kids. It comes without any power supply or peripherals as it’s meant to be programmed…
RPi Python Programming 10: Object-oriented Python
In the previous tutorial, we learned about the sequences and unordered collections in Python, including the operations, functions, and methods applicable to them. However, there can be more complex data structures in an application, which are known as user-defined classes and objects. Any application uses data (values/objects/user-defined classes/objects) and code behavior (how the data is…
RPi Python Programming 11: Python GUI with Tkinter
In the previous tutorial, we learned about the object-oriented features of Python, which are important for organizing code and structuring our applications. Now, let’s discuss how to design graphic interfaces in Python. Embedded applications developed on microcontrollers typically have LEDs, character LCDs, or small graphic LCDs as display devices. However, these displays do not have…
RPi Python Programming 12: Tkinter and TTK widgets
In the previous tutorial, we learned about the window widget in Tkinter and designed a blank GUI main window (which is not a child to any other window in the GUI application). Child windows serve as a container for other widgets There is no point of blank windows so there must be other widgets included…
RPi Python Programming 08: Python lists and byte arrays
In the previous tutorial, we learned about basic syntax and several elements of Python’s language. Python offers six types of sequences: strings, bytes, byte arrays, range, tuples, and lists. Importantly, the strings, bytes, range, and tuples are immutable sequences that cannot be modified once defined. It’s only possible to create or destroy these sequences. This…
RPi Python Programming 09: Python sets and dictionaries
In the previous tutorial, we learned about manipulating data values in lists and byte arrays. Python also has mutable unordered collections, including sets and dictionaries. Let’s review these two and learn how to manipulate the data values/objects in sets and dictionaries. Sets Sets are unordered mutable collections of items. The items in a set can…
RPi Python Programming 20: Interfacing the SIM900A GSM-GPRS modem and hacking earphones
In the previous tutorial, we learned how to use Raspberry Pi’s (RPi) serial hardware port for serial data communication over the universal asynchronous receiver/transmitter (UART) protocol. Most of the embedded devices have the UART port for exchanging console data. In fact, most of the sensor modules that are designed for peer communication with controllers/computers have the…
RPi Python Programming 07: Python basics (part 2)
In the previous tutorial, we learned about Python’s syntax — meaning its identifiers, keywords, comments, statements, literals, and data types. We also learned that Python is object-oriented and that these objects can be mutable or immutable. Python objects that point to a group of values are iterable, which, in this case, is referred to as…
RPi Python Programming 27 – SPI protocol explained
In the previous tutorial, we discussed interfacing with the ADXL345 accelerometer sensor with Raspberry Pi using the I2C interface. UART, I2C, and SPI are the most common serial communication interfaces used in embedded systems. UART is used for point-to-point full-duplex asynchronous serial communication between two devices. I2C is used for synchronous serial communication among multiple…



















