Arduino tends to call daughter cards shields, while the Raspberry Pi community calls them hats. The Pi Cap is a hat. It plugs into the GPIO header of a Raspberry Pi and provides 13 capacitive touch pads. There is a traditional push button, an LED, and a prototyping area. While the Pi Cap does consume all of the GPIO pins, several are broken out near the GPIO header.
When I started researching how to make Raspbian run a script at startup and shutdown, I found a ton of links and questions asking for help. None of them helpful. Why? Because they were wrong. At least, they are now.
/etc/rc.d doesn’t matter!
It turns out, Raspbian Jessie does not use SysV for init (anymore). So it does not matter what you scripts you put in /etc/rc.d. Pretty simple but missed by many!
Here is a correct Raspberry Pi Startup Script Tutorial.
The Key is systemd
Once I started researching how to make systemd do what I wanted, new problems emerged. The syntax for systemd is not as straightforward as I first thought. Thanks to readers, I was pointed towards the RedHat systemd manual. After reviewing it, I was able to create a service that runs at startup and shutdown.
In the end, I was unable to prevent this process from running during reboot. There seem to be some more layers to make sure systemd knows the difference. In the end, I decided it was not necessary to avoid the reboot.
The RetroPie project enables retro-gaming with a Raspberry Pi. All of the Pi models have enough computing power to emulate the major 8-bit and 16-bit computers of the 80s and 90s. With the Pi 3 I have even been able to play PS1 games with no problem. My current project is to put my Raspberry Pi running RetroPie into an old Super Famicom (SFC), or SNES, case. The catch? I want the original SPST power switch to work. And by work, I mean allow the Raspberry Pi to shutdown properly when the switch goes into the off position. To accomplish this task, I am building a Raspberry Pi soft power controller.
Here’s a block diagram of the power controller. The basic blocks in a Raspberry Pi soft power controller include the LDO, a switching supply for the Pi, an AVR-based microcontroller, and the Raspberry Pi. This post will describe each of these hardware blocks.
One design objective was to draw as little current as possible when off. For my RetroPie, I will not be running on battery. However, I do not like the idea of wasting energy when something is turned “OFF.”
This overview is a multi-post write-up. This first part is on the hardware. In the next post, I will explain the AVR’s firmware. Later, I will come back to the Raspberry Pi side of the project.
The Arduino serial monitor is usable when you want to watch data from an Arduino. However, it does not have a built-in method for saving the data. Here are some ideas if you want to build an Arduino data logger with or without a PC.
Important note on Arduino Data Logger examples
With all of these examples, please remember that whenever you open the Arduino’s serial port, the board will reset. So if your log file shows “Initializing SD card…” with a few data lines in between, it is because there is a reset happening.
In that code you can see data logging started and then restarted. What happened is that after programming, the board starts logging. Then when you open the Serial Monitor, the data logger restarts.
To solve this issue, either disable auto-reset, add a 3-4 second delay at the start of setup(), wait for a character to be received, or wait for a button press. That will give you time to open the Serial Monitor.
This week’s MQTT Tutorial connects a Raspberry Pi, ESP8266 (or Arduino), and a PC together. Remember last week’s post provided an overview of message brokers and MQTT. We learned that MQTT is a hub and spoke protocol for sending messages between IoT devices. Clients can subscribe or publish messages to a central server, called a broker.
Now it’s time to connect our IoT devices together!
MQTT is an easy way for Internet of Things (IoT) devices to communicate with each other. This light-weight protocol can be used with a simple 8-bit Arduino to a Raspberry Pi to a multi-core PC to Amazon Web Services. It is that versatile.
This MQTT Tutorial is broken into two parts. Part one is an MQTT Introduction. You’ll understand how publish/subscribe message brokering works. Next week, Part two will be a tutorial on using MQTT to communicate between a PC, Raspberry Pi, and ESP8266.
This screen is what I needed in my IoT project. The Pi+Screen will act as the primary controller for all of my things. The problem is I didn’t know much about writing GUI applications in Linux. So what could I do to create a Raspberry Pi GUI?
Python is popular in Pi projects, so I decided to stick with it and find out what GUI toolkits are ready to go. “Ready to go” means they install easily on Raspian and work well on the Pi.
Here is how I got Qt5 for Python up and running to create a Raspberry Pi GUI.
What makes the Raspberry Pi so attractive? At $35 it is an unbelievable value for a single board computer. Since its introduction, a price race to the bottom has begun.
The C.H.I.P. claims to have started shipping the $9 computer. Which, many pointed out, doesn’t cost $9 once you add things like support for display. I would like to point out, I was an early backer and have yet to receive one.
The Raspberry Pi Zero has the same processing capabilities as its predecessors and only costs $5! Does that make it a slam dunk? Well, here’s a few applications to help decide if the size-reduced bare board is worth $5.
The seventh AddOhms TutorialCast has gone “live”. (Gone “uploaded” sounds wrong.) Being able to understand difference between an Arduino and a Pi is a critical point for many new electronics hobbyist. The boards seem so similar, but they are so different. AddOhms #7: Comparing the Arduino and Raspberry Pi