Tuesday, November 1, 2016

Raspberry Pi 3 cost-effective multi-unit build

Hardware: Raspberry Pi 3 Model B / SanDisk Ultra 8GB

At present, I am doing a workaround of a customer networking requirement and needed to spin up a good number of Raspberry Pi 3's to get around the issue (non-broadcast or hidden SSID).  Since I had to move quickly and wasn't able to order very large quantities, I needed some mid-range volume discounts to cover the increase in costs to cover the short-term technical issues.  I also needed to use a board that I knew would work.

Fortunately, Amazon and Alibaba have saved me once again.

I chose the RPi3 mainly due to it being mature and well documented.  We all know the issues this board has at this point, so in a crisis, it is a good fallback.


I ordered a few of these Enokay cases as a test with acceptable results:

The cases are quite basic, but the extras are helpful when putting together a build on the cheap.  The units come as three pieces of plastic (the end piece with the ventilation holes is removable), three heatsinks (I only used two), and a small screwdriver.  The heatsinks are a nice add and who couldn't use a spare small screwdriver to immediately lose in the pile of stuff on your desk?

For a simple and cheap design, it works.  I don't need the ports exposed (it is actually a security risk unless you turn them off) but for working around a near-term issue, it is ok.

I needed to run an extra 4-conductor cable into the GPIO, but a quick hit with my micro-drill press right along the edge of the piece and I had room to insert it through the removable side panel.

In the end though, I actually replaced the ones above with these:

Faster shipping, slightly better price at quantity and thanks to the first cases, I have plenty of spare small screwdrivers to step on accidentally.


This is still something I am working on for a permanent solution, but I have multiple samples from companies in China courtesy of Alibaba and units inbound on a larger order.  This is one of those things you don't want to go cheap on, but you also don't need to blow money on the markups for the units sold here in the US if you're ordering any larger quantity.  If you are doing 100+ (or even 50-60 as the prices are low enough to justify buying more than you need) then it just makes sense to order these directly.

The key thing here is to make sure you get enough power for your application.  The RPi3 is a thirsty board power-wise and if you're running any peripherals (as I am) then you need to plan for that too.  Therefore, I'd suggest a 5v 2.5A unit.  

My first prototypes were built using this unit off of Amazon:
At $7.99 (they were $6.99 when I last bought them), that's a huge price point when you're doing embedded and need to keep costs down.  Not the most expensive unit out there, but I felt I could recover some costs by repurposing the micro-usb/barrel/on/off adapters (I did).  These are only 2A but they will drive the unit as we have it configured (barely).

These units accidentally brought an important issue to the table for field-deployed embedded projects which is to buy a wall-wart with an LED on it.  Having this in place means you don't have to worry about exposing an LED to the outside world to verify the system is powered.  In some field-deployments, it is crucial to give technicians basic tools to verify functionality at every stage and this is a low-cost/hassle method to ensure local power.

In the end, I ordered two batches of 100 from two different Chinese manufacturers to try them out after getting samples that met my criteria.  Even though I do not need the capacity of a 2.5A supply in most projects, these are easily resold in a pinch.

NOTE: I generally prefer to run plugs inside cases vs. exposing them for a field unit.  This means that local staff don't get nosy and decide to unplug it so they can charge their cell phones.  I did not do this for this short-term workaround using the cases above.

SD Cards

This could be an entire blog of its own.  There are so many people who have tested SD cards in an array of scenarios.  It really comes down to if read speed is more important or write speed.  For another project, write speed was the killer issue we had to overcome.  Therefore, I had some spare SanDisk Extreme UHS-I/U3 (note the 3) 16Gig boards laying around:
These are very fast per read, but especially fast for write in the real world (and this is an actual concern for most SD card quoted capabilities).  While these worked and worked well, they are overkill for this project (in both size and speed).  So I went shopping and settled on SanDisk Ultra UHI-I/Class 10 cards 8Gig versions:
Cheap enough to help in a tight budget, but fast enough to make a difference at boot time.  As I am doing Ubuntu's Minimal build here, I still have plenty of room for custom packages, updates and logs.

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/root       7.2G  922M  6.0G  14% /
devtmpfs        459M     0  459M   0% /dev
tmpfs           463M     0  463M   0% /dev/shm
tmpfs           463M  6.2M  457M   2% /run
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           463M     0  463M   0% /sys/fs/cgroup
/dev/mmcblk0p1   63M   21M   43M  33% /boot


As I needed to do some GPIO connections I needed a way to easily connect some wiring into the box.  The problem you encounter is that the cases above are very tight.  There isn't actually room to even plug in normal jumper wires and put the case on.  So either you wind up cutting the plastic DuPont connectors off of the jumpers, soldering straight to the board (noooo...) or figuring out some low-profile method.

I ordered a couple of items to test with:
The very low profile header looks like this:

It slides down the GPIO pins and they actually stick way through this piece.  You could probably put two of them on one set of pins if you were doing something crazy.  Soldering to this piece vs. directly to the pins is a much better solution.

The right-angle header looks like this:

When plugged into the board, it is almost the exact height of the USB ports so there is little room here for messing around.  However, it is enough clearance to plug in jumper wires or a similar DuPont connectors and still have it fit in the case.

In the end, we went low-profile as it is simpler and more cost-effective to solder to these vs. buying and connecting 2 connectors (right-angle plus crimping DuPont connectors on the wiring).  We haven't decided if we're going to be super cheap and start cutting these into pieces (we only need 2x3 pins connected) but we still might.  

Do watch your fingers when you push these onto the pins.  Plus it is a complete PITA to try and remove them once you push them all the way down.  Plan accordingly.


I managed to put these together at a final price point (without labor) of $54.55/unit on the initial units including the higher-priced power supplies.  With the new ones the price should be just under $50/unit.

I wish I'd started the shopping for power adapters much sooner.  It is such an oversight item that is far too costly for what is provided, but that becomes a killer issue with low-cost embedded projects.  However, I also am happy that I over-engineered with my prior power supplies and went overpowered for our prior board.  That saved me from having to pull/replace those as well as the other boards.

I also wish I'd found a better case that would hide the ports.  The problem is that the RPi3's side-mounted power plug means you need a very wide case to fit the entire assembly inside to hide it.  This means disassembling a power adapter and directly wiring it to the board vs. into the plugs.  While doable, it is kind of a "point of no return" per hardware.  Since this is a short-term workaround, we're trying to avoid tearing things up that we would like to re-purpose later.

We're still looking at other boards to use to ditch the RPi3.  The board is capable enough, in good supply and very well documented, but it is complete overkill as far as power draw, processing speed and ultimately cost.  Who'd have thought we'd be complaining that Raspberry Pi's were too costly?  

No comments:

Post a Comment