The Final Product:
CuPID v2 Features:
- DS2483 1Wire bus master
- 8P8C (RJ45-like) breakouts:
- 8 Pi GPIO
- 8 Analog Inputs from Moteino (328P), shared on pins with GPIO
- Pi SPI, I2C1
- 1Wire bus
- I2C and SPI breakout headers (SPI compatible with CuPID indicator board)
- Footprint for R4 or R5 Moteino RF Arduino clone
- Serial interface connection for Pi/Moteino communication
- 8 shared IO: Pi GPIO <–> Moteino (328P) Digital/Analog IO (state communication, mutual IO)
- 4 Moteino DIO breakouts, two with pull-ups for I2c if desired
- HAT EEPROM board and vendor information
What’s a CuPID? See here for a little background, or poke around the site here
The venerable Raspberry Pi, fueling frugal hackers’ dreams since its introduction, has been updated twice in the last year, with major improvements:
Rasperry Pi B+:
The B+ brought improved power management and increased power capacity, along with access to more of the broadcom 2835’s GPIO pins. Two USB ports were also added, along with a facility for on-board EEPROM to identify add-on boards via two dedicated i2c pins. Physically, the 2×13 26-pin header was swapped out for a 2×20, two mounting holes were added, the existing were relocated for a square mounting grid.
Along with standard physical size standards, identification and configuration via EEPROM data, was built into a standard, called the HAT. Today, we are going to build one.
Raspberry Pi 2
The RPi 2 swapped out the BCM2835 chip for a BCM2836, increasing the speed to 900Mhz with quad-core (from 700Mhz single-core), for a cited 6x improvement. This is obviously dependent on what you are doing … the memory was bumped up 2x to 1Gb from 512MB, which offer an inarguable performance improvement.
The most amazing part of this is that all of the above was added in a pin-compatible and (for the most part) completely backwards-compatible fashion. Awesome stuff.
The CuPID, v2
So how will we adapt? Technically, the v1 CuPID does fit onto the B+ and the RPi 2 without modification, but the location of the pins doesn’t exactly match compared with the main Pi board, so we don’t end up with a board that matches up perfectly vertically with the Pi. Besides, we want to break out all that yummy IO and set up EEPROM, so of course we had to make a new board. Hence, the CuPID v2.
Don’t get us wrong: we love the breakout on the base Pi for all the important functions of a Pi: GPIO, I2C, SPI, 1Wire, but we are super-invested in the idea of wireless sensing, everywhere. We have been documenting our affair with the Moteino line of arduino clone, RF-enabled devices in our series of remote monitors and controllers. An necessary piece to tie all of these together is the gateway: a Raspberry Pi with an RF receiver that talks to all of our nodes. For this reason, in the CuPID rev 2 board, we include a footprint for a Moteino. It does the following:
- Powers the Moteino
- Connects the Pi and Moteino serial interfaces
- Attaches Moteino analog inputs to the COM2 and COM3 ports’ GPIO interfaces. This makes analog inputs available on the ports!
- Breaks out four DIO 3-6 for external devices, such as I2C and SPI displays. These are all available DIO on Moteino. Two pull-ups are provided in case I2C is desired (on D3 and D4)
1Wire is universally compatible
We previously set our 1Wire in a way that made sense for our IO layout, but have modified it slightly in the newest revision. The new pinout is compatible with existing RJ45 pinouts, for example in use on the DS9490R USB, as well as iButtonlink adapters and devices. The new pinout makes our IO 100% compatible with all existing devices made by Dallas/Maxim and iButtonlink, using owfs.
A new feature of the new Pi standard is an EEPROM chip that tell the Pi what hardware is in place and what default configurations should be to ensure compatibility with the hardware. The new CuPID HAT has an EEPROM that identifies the hardware. No defaults are modified.
What it looks like
Here’s a good picture of our board and everything needed to build it.
Compared to the original CuPID, v2 has fewer components, and most important is much, much easier to assemble. Gone is the micro USB surface mount connector, and all can be hand-soldered. The only surface mount components are the EEPROM and DS2483, which require careful installation, but the rest are through-hole and very manageable.
When we have it together, it looks like this, with and without the RF unit. You can see the standoffs we use to attach it to the Pi and also affix it to the bottom of the enclosure:
Finally, we mount the board into the enclosure. Nothing fancy here, except a handful of standoffs and some countersunk screws that we mount to the back of the enclosure. We mount the HAT to the Pi, and insert it into the enclosure. Another huge improvement, both with the B+/RPi 2 and the HAT, is how solid the mounts to the enclosure are. It’s really quite robust.
Now, it’s business as usual! Time to fire her up.
Until next time,
The above makes use of the open source libraries available on github, including sketches, python and all web libraries:
Explanation and installation here: