A board by any other name is just as sweet
This is a list of physical hardware categorized by basics and optional.
|Spec||Arduino||RPi 2||RPi 3|
|CPU speed||900 MHz||16 MHz||16 MHz|
|RAM||32K||512 MB||1 GB|
Raspberry Pi 3 B+ $35
The Raspberry Pi 3 has a 1.2 GHz quad-core ARMv8 chip with 1 GB of RAM.
Risers on the board so its metal doesn’t touch the table. Or a static-resistent mat to put a naked board.
Heat sink and fan for disspating heat better when seated on top of the CPU chip
PROTIP: Running above 80 degrees F shortens life of the board. In data centers, for every 50 kW of power fed to an aisle of server, the same facilities typically apply 100-150 kW of cooling.
PROTIP: Measure board temperature over time. The little alumininum heat sink reduces heat by 2 degrees F. Get a large heatsink and fan from an old desktop computer. The larger the sink the better. 30 degrees cooler with a large copper sink on held in place by a clear plastic layer. The sink sits on top of a 3 mill copper plate on top of the chip. Attach using Artic MX-4 thermal compound.
45 degrees using a Molex connector used by the fan is powered by a box that may be hard to find now. It’s loud.
Pi 3’s thermal governor (see later) does not appear to be active, leading to an inherently unstable, overheating machine.
Micro SD card (8+ GB, up to 32 GB), class 10. Several of them, for backup and as a base to build others.
PROTIP: Windows 10 IoT does not support class 4 SD cards. An SD card’s “class” rating refers to its sustained write speed. A class 4 card writes at 4MB/s (4 megabytes per second). A class 10 card writes at 10M/s, achievedPhotographers prefer SD cards with a class 10 rating because to them Get a large heatsink from an old desktop computer. at the cost of read speed and increased seek times. fast write speed is more important.
https://www.youtube.com/watch?v=1AYGnw6MwFM PROTIP: This is the same one used on many smart phones and cameras. So this detailed analysis with benchmarks from a photographer is useful. The ones from Costco are a good buy: SanDisk Ultra MicroSDHC 32GB UHS-I Class 10 Memory Card With Adapter (Upto 80mbps Speed).
Devices reading the cards must be made to accept larger capacity chips. But can accept smaller capacities. SDHC (Secure Digital High Capacity of 4GB to 32GB).
SHXC (Secure Digital eXtended Capacity of 64GB to 2TB)
Cheap SD cards may not last long.
PROTIP: There is SD card containing pre-installed NOOBS (New Out Of Box Software) promoted as “the easiest to work with”.
But this tutorial focuses on industrial-grade components for maximum flexibility, power, and security.
32 GB of disk space on a Mac or Windows machine.
The size of hard disk drives have similar issues as SD drives.
Windows operating systems can format drives using NTFS rather than FAT32.
Natively Mac OSX does not know how to read NTFS drives.
DVD blank disk (R+ or R-) to hold image so as to not use up laptop hard disk space.
2.5A micro-USB 5V DC power - two-prong plug in the US market.
You can re-use those provided with Android smartphones.
NOTE: Consumption of electrical voltage is measured in Amprage, which draws down voltage.
Even though US electricity is rated at 120V AC (60 Hz), the rating for the plug says 110V - 240V (50 - 60 Hz) so a mechanical adapter can use used in other countries.
Alternately, the PiPo add-on board draws power from an Ethernet cable, so you don’t need to buy a micro-USB power supply.
QUESTION: Can it be combined with a fan?
HDMI cable connected to a monitor (input selected to the correct HDMI).
A special cable - $4.95 from Adafruit connects the 3.5 mm male plug to RCA composite plugs on older TVs.
A USB keyboard.
Off signal button
Abruptly unplugging the power source can damage the SD card.
Preferrable is a physical switch that temporarily connects two GPIO pins on the board, which a program recognizes and sends the proper shutdown command to the operating system software.
$5.95 gets you 15 switches to solder.
A power button (SW4), recovery button (SW2), and Uboot button (SW3) is provided by the (now-defunct) organgepi.org.
Compiled C option
Navigate to Adafruit’s C program code and compile the native program on the board.
cd Adafruit-GPIO-Halt make sudo make install
Copy the gpio-halt executable file to folder:
sudo cp gpio-halt /usr/local/bin/
That folder is also where ansible and easy_install are stored.
Use a text editor to open the device boot-up configuration file:
sudo nano /etc/rc.local
Cursor to just before final “exit 0” line, insert this line:
/usr/local/bin/gpio-halt 21 &
Change the 21 (port number) to whatever GPIO pin your shutdown button is connected to – see GPIO pins.
A Python program running in the background is started using this command:
To have it execute automatically upon restart, move the script to folder:
It has a dependency which requires installation to
sudo pip install -U RPi.GPIO
GPIO pins on headers
Physical pins are numbered in pairs, starting from 3.3V and 5V at 1 and 2. Pins marked in red provide (output) power via wires to devices. There are 5V pins in positions 2 and 4. Generally, older sensors and actuators tend to use 5V, whereas newer ones use 3.3V in positions 1 and 17.
DNC means “Do Not Connect”.
CAUTION: Connecting two 5V pins together (at the edge of the board) destroys the board.
On older Pi 2 A models have a shorter 26-pin header. Newer Pi 3 B+ models have 40 pins.
Broadcom, the maker of the chip, defined GPIO (General Purpose Input Output) pin numbers in its library for software code to listen for connections between a physical pin with a ground pin (marked GND in black). Ground pins are always 6, 9, 14, 20, 30, 39.
DotStar is used by Adafruit’s 5V LED light strips
The program listening for shutdown default to two pins next to each other: GPIO 21 (pin 40) with GND pin 39. Alternately, on older boards, the program would listen for GPIO 7 (pin 26) with GND pin 25 because that pin is next to the ground (GND) pin.
The connection can be made with anything conductive (such as a metal paperclip, sissors, or flat screwdriver). There are wires and switches made to connect.
But a physical button is more user-friendly and safer.
QUESTION: Put a 1K resistor to positive?
PROTIP: If you are using a wire to connect the switch, set the program to listen on GPIO 17 (pin 11) because that pin is soley a GPIO pin and does not double up as something else. This may be more reliable.
Case (enclosure) that accomodates heat dissipation contraptions.
A) You can make a free case by cutting and folding the Punnet pdf printed on paper or thin plastic.
This uses a 3D printer to create an enclosure that has a fan. His blueprints contains parametric variables for changing wall thickness, height, etc. and everything automatically adjusts accordingly.
B) The top of this clear case holds a resistive touch overlay to a $35 Adafruit PiTFT 2.8” display with 320x240 16-bit color pixels.
It also has 4 buttons the app can recognize, for use by a music playing app.
QUESTION: Is there enough air flow through the case to dissipate heat, yet keep dust from forming on the board?
C) Case with external fan
This article comparing the running temp of 12 cases identified the best cooling from $8.99 JBTek Transparent Acrylic Raspberry Pi B+ / Raspberry Pi 2 Case with External Fan. One user of this rig said he was able to overclock the CPU to 1.35Ghz running Raspbian Jessie processor temp. at 48.7 degrees Celcius (119.66 Fahrenheit).
PROTIP: Most fans carry 12v. Make sure your fan can run plugged into the 5V, albeit slower and quieter. This is actually be a good thing to run nearly silent.
D) The $25 Smarti Pi Touch is a Pi case that holds a 5” display.
<a target=_blank” href=”https://www.amazon.com/800x480-Resolution-iUniker-Raspberry-Display/dp/B01LX526QA/ref=wilsonslifenotes/”> $49.99 3.5 inch 800x480 TFT Display with case</a> for 60+ fps video at 900:1 contrast ratio vieweable at 160 degrees. Uses 3V. See this.
The CSI (Camera Serial Interface) Type-2 connector (next to the HDMI) received video one-way to the Broadcom BCM2835 processor on the Pi. via a ZIF 15 ribbon cable.
The CSI interface was developed by the MIPI Alliance and is common to almost all Android mobile phones. MIPI CSI-2 version 1.01 supports up to four data lanes, where each lane has a maximum of 1 Gbps bandwidth, to provide a total bandwidth of 4 Gbps.
A $25 NoIR Camera V2 is IR sensitive for low-light situations. Its 8MP Sony image sensor takes 3280 x 2464 pixel images and captures video at 1080p30, 720p60 and 640x480p90 resolutions.
Powered USB 2.0 hub.
USB provides power as well as provide a conduit for communicating data, but for USB devices drawing more than 100 mA, voltage drops.
USB 1.1 standards offers a theoretical maximum signaling rate of
12 MB/s over 4 wires using up to 500mA.
USB 2.0 standards offers a theoretical maximum signaling rate of
480 MB/s over 4 wires using up to 500mA.
USB 3.0 has two asychronous unidirectional data paths for max. rate of
5 GB/s over 9 wires using up to 900mA. It’s 10x faster due to its blue color. (OK I’m kidding)
USB 3.1 “SUPERSPEED” was released in 2014.
USB hard drive provides extra storage. convenient to easily add photos, videos, or other media the Pi displays.
The Passport drive has 250 GB.
Western Digital’s “WD PiDrive” is available in kit form that includes cables and an enclosure. The 314 Gbyte drive retails at $45.81. They also have a 1 Terabyte version. The WD PiDrive kit includes a 4-headed “hydra cable” for connecting the Raspberry Pi’s two USB ports (one for power and the other provides access to the drive).
It supports the http://www.berryterminal.com/doku.php/berryboot loader.
$24.99 USB 2.0 to SATA Converter Stackable Expansion Board from Ableconn (Taiwan) connects SATA drives to the Pi. The drive requires a 300 Watt ATX power supply for the drive from an old PC tower case:
USB to UART serial cable. It’s an alternative to using Ethernet and plugging a monitor and keyboard into the Pi. The USB plugs into laptop or computer. The other end plugs into the UART posts on the Pi: red = 5V, black = Ground, white = TX, green = RX.
This powers the board as well, so the Pi doesn’t need to be plugged into the wall?
$6 from https://shop.pimoroni.com/products/usb-to-uart-serial-console-cable and https://learn.pimoroni.com/tutorial/hacks/add-a-serial-breakout-to-your-pi
Get the drivers for each specific version of Mac or Windows.
Boards for ZigBee communication
You’ll need batteries even if want to use solar power.
A regulator is needed to not over-charge the batteries.
A solar panel needs to be large enough to generate what the unit needs and also cover lower power during overcast days.
Low-power mode on the device.
Control AC power
Control AC power plug $19.70 IoT Relay controls a power outlet which listens for signals from a Pi.
Resources on Python
Automate the Boring Stuff with Python book is provided free on-line.
http://inventwithpython.com/ provides on-line books about Python free.
http://legacy.python.org/dev/peps/pep-0008/ Style Guide for Python Code
More on IoT
This is one of a series on IoT:
- IoT Apprentice school curriculum
- IoT use cases
- IoT reminders prevent dead mobile battery
- IoT text to speech synthesis
- IoT AWS button
- Intel IoT
- IoT Raspberry hardware
- IoT Clouds
- Predix basics
- Predix installation
- Predix services
- Predix programming