Get your rig hardware¶
You have several options for hardware:
1.
The most recommended rig has been an Edison + Explorer Board. Unfortunately Intel stopped making the Edison boards as of 2018. If you can find an Intel Edison (eBay, local stores, etc - this is still very possible), this is still a highly recommmended rig. It is the smallest rig (and easily portable), with better battery life because it is power efficient. See below for the list of hardware for Edison setups.
2.
Another recommended option is a Raspberry Pi-based setup, with the new Explorer HAT. This rig setup makes it easier to see information when offline because it has an onboard screen for displaying readouts. See below for the list of hardware required for Pi/HAT setups.
3.
Yet another option is a Raspberry Pi-based setup, with an Adafruit RFM69HCW Bonnet. This rig setup makes it easier to see information when offline because it has a small onboard screen for displaying readouts, but it does not come with charging hardware for a battery like the Explorer HAT or Explorer Board. You will need to build your own charging circuit or use a USB power block if you want to make this rig portable. However, this makes an excellent stationary or backup rig! See below for the list of hardware required for Pi/Bonnet setups.
4.
(Not recommended, but supported) There is an experimental alternative to prefabricated hardware on the Raspberry Pi (Explorer HAT or Adafruit Bonnet), which can serve as the radio on a Pi-based rig, but will not have the screen and requires you to solder. See below for the list of hardware required for more details on a setup with RFM69HCW breakout board.
5.
(Not recommended, but supported) If you already have a USB TI stick (from an older rig build), you can continue using it in 0.7.0 if you reflash it with new firmware and wire it to the SPI header on the Raspberry Pi. See below for the instructions on how to re-flash and re-wire your TI stick.
Hardware information for Pi-based setups with the Explorer HAT¶
Summary of what you need for a Pi/HAT rig:
HAT:¶
As of April 2018, there is be a Pi+HAT rig as an option for closing the loop with OpenAPS. The HAT can be ordered from the same place that makes the Explorer Board (click here to pre-order). We call it the “Explorer HAT”, to differentiate from the Explorer “Board” that goes with the Edison (see below).
PI¶
You also need a Raspberry Pi. Many users are opting for the “Raspberry Pi Zero WH” - with headers - so you don’t have to solder, and can simply add the HAT onto the Pi. See this PiZeroWH from Adafruit, or from other sellers around the world
As an alternative, you can also use the HAT with a Raspberry Pi 2/3/4.
Battery¶
Lipo batteries are typically used to power the rig on the go because they charge quickly and come in a variety of compact sizes. When choosing a battery, you have a trade-off between a larger battery with longer duration or a smaller battery with shorter duration that is easier to carry around. A 2000 mah battery is roughly the size of the Raspberry Pi0, and can last around 4 hours. You’ll want a “1S” type, which uses a single cell and outputs at 3.7 VDC. It needs a JST connector to plug into the Raspberry Pi. See this battery from HobbyKing.
If you will need to run longer than that while unplugged from wall power, consider a portable charger. These are in widespread use for cell phones and commonly available in a large number of sizes. Here is an example portable charger from Amazon. Using a USB to micro-USB adapter you can power the rig from the portable charger by plugging the charger into the Power port, which is the micro-USB port nearest the corner of the Pi0.
Note: You will probably want to underclock your Raspberry Pi to get a longer battery life. See this for details.
SD card¶
An 8 GB SD card should provide plenty of space for the linux operating system, OpenAPS code and storage for log files. The ability to use larger and removable storage is one of the advantages of the Raspberry Pi. You can get a MicroSD card and adapter from Adafruit when you order your Pi and Hat. Or you can get an equivalent 8 GB SD card from Amazon or other sellers.
Note about Pi+HAT cases¶
Because we are still optimizing the software to be as power-efficient as possible, we have not narrowed down on the best recommended battery. You may want to use a soft case for ease of access to the components, flexible arrangement and the ability to use a variety of battery sizes. If you are using the 2000 mAh battery above, you can use this 3d printed hard case to protect the rig and battery in a relatively compact package. The design is built in OnShape, which has a free access level subscription for public domain documents. You can make a copy and tweak the design to your liking.
Alternatives 3d printed cases for Pi0+HAT include this hard case with room for 2x2000 mAh Li-Po batteries and this hard case with room for 2x18650 batteries (6800 mAh total, 86x77x25mm).
Hardware information for Pi-based setups with RFM69HCW (experimental)¶
This Pi + RFM69HCW is still experimental!
If you are a maker person or a bit into soldering electronics at least, you may also build your rig with a piece of hardware, that is a lot cheaper than the Explorer HAT, although it does not have the screen. You also won’t have LEDs indicating status, no battery charging and there will not be (m)any 3d printable case models. If it’s your only option because you’re on a budget and can’t afford to spend 150 bucks on a rig, please think about this step twice. This one will cost you only 30, but a lot of extra time.
Click here to expand and see pictures of a rig with a Pi0WH and RFM69HCW::
Here’s a rough-and-ready budget version of a rig put together: contents of a 2000mAh powerbank, a plastic housing, a micro USB cable and some more soldering and hot glue. BE AWARE that this case will most likely overheat the Pi after a while. You need to at least drill some venting holes into the lid.
Summary of what you need:¶
- Raspberry Pi Zero
- RFM69HCW
- microSD Card
- Bread board
- Jumper wires
- Soldering iron
- Power source via Micro USB
The Raspberry Pi Zero¶
For this setup, you want a Raspberry Pi Zero WH. (The “H” means it has Header pins). (Also, a regular Raspberry Pi 3 model B works fine.)
RFM69HCW¶
You can buy this board e.g. here, but you can really buy it wherever you want. These boards are, like the RPi Zero, very common. Just make sure you get the right frequency. 868/915 MHz is correct. All others are wrong.
Breadboard¶
Any breadboard will do, no special requirements.
Soldering¶
You need to solder the pin stripe into the RFM69HCW. Insert the pin stripe from the bottom of the board, with the short endings reaching through the holes. Fixate a bit, so you can rest the soldering iron tip on the pins and the board.
Solder the included pin stripe diligently into the 9 holes named VIN GND EN G0 SCK MISO MOSI CS RST
Cut an antenna at your preferred length corresponding to your frequency. This can be a simple piece of isolated, unshielded wire. (I simply took one of the jumper wires for my first try.) Calculate your length here: https://m0ukd.com/calculators/quarter-wave-ground-plane-antenna-calculator/ and just use the value from A (first green box). This should be the length of your antenna, from the soldering point on the board to the tip.
Solder it to the board. It’s the hole near the “o” from Radio. Make sure to not connect the soldering to the ground plates left and right from the hole. This antenna is really only connected to the one hole.
This is your connection scheme for the RPi to RFM69HCW. Stick the RFM69HCW on a bread board, and connect:
Board | Connect | Connect | Connect | Connect | Connect | Connect | Connect | Connect |
---|---|---|---|---|---|---|---|---|
RPi | 3.3V | GND | MOSI | MISO | SCLK | CE1_N | ||
RPi PIN | 17 | 25 | 19 | 21 | 23 | 15 | 26 | 22 |
RFM69HCW | VIN or 3.3V | GND | MOSI | MISO | SCK or CLK | G0 or DIO0 | CS or NSS | RST or RESET |
After that, you’re ready to install OpenAPS.
Hardware information for Pi-based setups with the Adafruit RHM69HCW Bonnet¶
Summary of what you need for a Pi/Bonnet rig:
Bonnet:¶
There is be a Pi+Bonnet rig as an option for closing the loop with OpenAPS. This hardware is available from Adafruit, and is called the Adafruit RFM69HCW Transceiver Radio Bonnet - 868 or 915 MHz - RadioFruit. As of October 2019, this hardware is supported via automated setup via oref0-setup.sh
.
PI¶
You also need a Raspberry Pi. Many users are opting for the “Raspberry Pi Zero WH” - with headers - so you don’t have to solder, and can simply add the HAT onto the Pi. See this PiZeroWH from Adafruit, or from other sellers around the world
As an alternative, you can also use the bonnet with a Raspberry Pi 2/3/4.
Antenna¶
The bonnet does not come with an antenna, so you will need to purchase (or make) one. The end connector needs to be of the u.fl type, and the antenna length that you need will be determined by the frequency on which that your pump operates. The following antennas work well for either 868MHz (WW) or 915MHz (NA):
SD card¶
An 8 GB SD card should provide plenty of space for the linux operating system, OpenAPS code and storage for log files. The ability to use larger and removable storage is one of the advantages of the Raspberry Pi. You can get a MicroSD card and adapter from Adafruit when you order your Pi and Hat. Or you can get an equivalent 8 GB SD card from Amazon or other sellers.
Optional - case for the bonnet¶
There is one 3D printable case available on thingiverse, where Raspberry Pi Zero fits with the bonnet.
Hardware information for Pi-based setups with rewired TI-stick¶
This hardware setup is not recommended unless you already have a USB TI stick and want to continue using it with 0.7.0. This part of the documentation is a work-in-progress and as of 11/9/2019 not fully tested – if you can help with this, we would appreciate it very much!
You will need a CC-Debugger to re-flash your TI stick with an SPI-compatible firmware, located here. Any of the v0.8 spi1_alt2
versions should work.
You will also need jumpers to wire your TI stick to the Raspberry Pi’s GPIO header in the following configuration:
SPI0 CS0 (Pi pin 24) -> debug pin 5
SPI0 CLK (Pi pin 23) -> debug pin 6
SPI0 MISO (Pi pin 21) -> debug pin 10
SPI0 MOSI (Pi pin 19) -> debug pin 8
any Pi 3.3V pin -> debug pin 2
any Pi ground pin -> debug pin 1
GPIO 4 (Pi pin 7) -> debug pin 7
When prompted in oref0-setup.sh, you will need to select the “TI Stick (SPI-connected)” option.
Hardware information for Intel Edison-based setups¶
The high level parts list (see below for more details, and links):
- Explorer Board Block
- Edison
- Nuts and Bolts to attach the Edison to the Explorer Board Block
- At least one Lithium battery
- 2 USB cables
Explorer Board Block¶
The recommended board to use is the Explorer Board Block, which was co-designed by this community. It also has the benefits of a built-in radio. It’s only available from Hamshield/Enhanced Radio Devices.
Edison¶
There are 4 types of Edison’s. All of them work, but Versions 3 and 4 require an extra antenna, so 1 and 2 are preferred (1-EDI2.LPON, 2-EDI2.SPON, 3-EDI2.LPOF, and 4-EDI2.SPOF). If the seller does not specify the Edison model/version, you can see from the picture whether or not it has a white ceramic antenna in the corner. If it does not, then it will require an external antenna, but that version is fairly rare.
- Option 1 - Buy it from places like Ebay, Craiglist, or your nearest store - and follow the instructions to flash it.
- You may need to hunt for an Edison as supplies of them are dwindling - if you get it as part of a “kit” (i.e. breakoutboard + Edison), keep in mind you’ll still need to get the Explorer Board Block from Hamshield.
- Note: If you are doing Option 1 (an Edison from wherever you can find it) - you are getting an UNFLASHED Edison. Not a big deal - flashing it with jubilinux is just a few more steps (~15 minutes) - but remember you’ll need to start with the flashing instructions. Follow the steps for flashing on (a) all-computers page (with the most comprehensive troubleshooting section); b) the Mac-specific flashing page; or c) the Windows-specific flashing page), but stop before installing wifi and other steps and instead jump over to the “Install OpenAPS” page from there.
- Option 2 - (previously buy an Edison that is already flashed with jublinux when supplies were available. If you get a pre-flashed Edison, you can start installing and setup OpenAPS. (You would not need to “flash” the Edison).
Lithium-ion polymer (LiPo) battery or other battery supply¶
The Explorer Boards have battery charger circuitry on board, making it easy to use a LiPo battery.
- The example setup uses a 2000mah LiPo battery; also Lithium Ion Battery - 3.7v 2000mAh or Adafruit Battery Packs Lithium Ion Battery 3.7v 2000mAh are similar options, although many people prefer a higher capacity battery to get a full day from the rig (such as Adafruit Lithium Ion Polymer Battery - 3.7v 2500mAh (PRODUCT ID: 328) and the Adafruit Lithium Ion Cylindrical Battery - 3.7v 2200mAh (PRODUCT ID: 1781)). This battery uses a 2mm 2 pin JST connector to match the Explorer boards’ power plugs.
- For people in the UK, you may find you have to shop around to find the correct battery, as shipping restrictions appears to have reduced the supply somewhat. Pimoroni appear to stock the same Adafruit 2000mAh battery as mentioned above. Another source looks to be Cool Components, but you may find shipping costs expensive. CAUTION: RS Online sell a similar battery, but unfortunately it comes with the wrong JST connector (it comes with a 2.5mm JST XHP-2, and you need a 2mm JST PH). It is possible, however, to buy the right connectors and fit them yourself (numerous ‘how to’ videos on YouTube).
- For people in Australia you can find 2000mAh, 2200mAh and 2500mAh batteries from Little bird electronics, prices are very competitive and shipping is quick. These are the same Adafruit batteries that can be obtained from the US above.
Note: It’s best to buy from a reputable supplier, because if the internal two cells are mismatched the Explorer board cannot charge them separately and they are prone to catching fire. Make sure that it includes a protection circuit to protect over-discharge. NEVER connect the battery to an Explorer board the wrong way round. There is no manufacturing standard so never assume correct polarity. The connector JP1 on the Explorer Block has two terminals. The left side is positive, the right side is negative. The side with the JP1 label is the positive side. Typically a battery’s red wire is the positive wire. Ideally you want a battery that has a 10k ohm thermistor for temperature protection by the Edison too.
You can also use any charger with a USB plug, including a wall power charger. The Explorer boards have pass through charging, so this is also how you will charge the LiPo battery.
Battery safety¶
You should monitor the rig periodically - especially the LiPo battery, checking for swelling or damage. Immediately discontinue use of any battery that shows sign of swelling or damage.
Radio stick (only if not using Explorer board)¶
We recommend an Explorer Board with a built-in radio (see above), because if you get an Explorer Board, you don’t need an additional radio stick or CC-Debugger.
The following options are not yet documented for oref0 versions < 0.7.0, and may not work anymore: If you don’t use an Explorer board, you can use a number of radio sticks: a TI-USB-Sticks, running subg_rfspy; Wireless Things ERF; Wireless Things Slice of Radio a Slice of Radio; or a Rileylink. For details about setup with these other stick and board options, the best instructions will be found in the mmeowlink wiki for setting up your board and stick. Note you may also need a CC debugger for these, and also note that it will be more work as the documentation is designed for the Edison/Explorer Board setup as the easiest path forward.
USB Cables¶
You will need two micro USB cables - with a micro connector on one end and a standard (Type A) connector on the other. Most cables will work fine, but some prefer to select lengths. You may already have one for charging a Dexcom receiver, or an Android phone, lying around at home. If you don’t, here’s an example of one that will work: Monoprice Premium USB to Micro USB Charge, Sync Cable - 3ft.
Warning: bad cables cause a lot of headaches during the Edison flashing process, so it may be worth verifying before you start if you have good cables that can transfer data.
Optional: Micro USB to Micro USB OTG Cable for offline looping¶
You may want to connect your Dexcom receiver (G4 or non-touchscreen G5) to your Explorer Block for offline looping. For this you will need to use a micro USB to micro USB OTG cable (or an OTG adapter). Here is an example of a cable that will work: BestGameSetups Micro USB to Micro USB OTG (On-The-Go) 12” (30cm) Data Cable.
Nuts and Bolts¶
You will likely want to screw your Edison onto the Explorer Block to stabilize the rig. There are two methods to do this. The simplest is to order a kit like the Sparkfun Intel Edison Hardware Pack, which provides standoffs, screws, and nuts specifically designed for the Edison. Alternatively, you can use (2) M2 screws and (2) M2 nuts and (4) M3 nuts (M3 or a bit larger to used as spacers). In this configuration, the screws should be just long enough to fit through the spacer nuts and screw into the M2 nuts on the other side. (Note: Sparkfun is no longer selling these screw kits. There are some available on Amazon lock nuts and cap screws.
Cases¶
You can use a variety of cases, either soft or hard. Make sure to check the case design to make sure it will support your preferred rig setup and battery size/type. Also, be careful with inserting your rig into some 3D-printed cases so you do not harm the board and/or the battery.
Soft Cases¶
- TallyGear soft case - these are the soft cases Dana uses (see this example). The OpenAPS-sized case can be made any any pattern/fabric she uses elsewhere on the site.
- JD Burrows SD card case - this is a hard / soft case which fits the rig with a 2500mAh battery perfectly, can also fit a spare AAA pump battery (Australia)
Hard cases¶
Warning: be careful if you select a hard case. Some may be designed for a certain size/shape battery; and attempting to jam a rig in may harm the board and/or the battery.
Also: a hard case may make you less likely to look at your rig directly. You should monitor the rig periodically - especially the battery, checking for swelling or damage. Immediately discontinue use of any battery that shows sign of swelling or damage.
Generic hard cases:
- RadioShack Project Enclosure (3x2x1 inch)
- Small clear plastic case perfect for larger Sparkfun 2000 mAh battery: #8483
- Small Plastic Clear Case for 2500 mAh battery - Since a Tic-Tac box is too small for the 2500 mAh battery.
Cases for Edison plus battery:
- Ken Stack’s 3D design for a case with the battery next to the board
- Rob Kresha’s design with the battery compartment stacked on-top of the board compartment
- Gustavo’s 3D design
- Sulka Haro’s 3D design
- tazitoo’s 3D design: CAD (or STL for 3D printing)
- danimaniac’s Protective Cases & Accessories
- Luis’s ventilated acrylic simple design
- Robert Silvers and Eric Burt’s case for Explorer and 2500 mAh battery
- Robert Silvers’ case for Explorer and 2000 or 2500 mAh battery
- tynbendad’s case for 18650 battery
Cases for Edison plus G4 receiver: