Some of you might be saying "Stop talking about dog food! what does that have to do with electronics engineering?" I learned the expression from our CEO when he talks about how we design all of our own hardware with our own design tool. Basically, would you trust your dog's health to a dog food company whose employees won't even feed their product to their own dogs? If we won't use our own service, why should you.
Geppetto frequent flyers may already know that any of the development boards you find in the Gumstix storefront that have been released in the past 4 years can be cloned from the "Designed by Gumstix" tab in Geppetto. That's because we designed the Aerocore 2 for NVIDIA Jetson, the Chatterbox and the RoomSense boards, to name a few, in Geppetto the same way you would design your boards. You can clone the design and modify it to suit your project's particular needs.
So anyone who's been following me has seen me work with the hardware that's already in our store. 4 different Aerocores, GPS dongles, LoRaWAN gateways and nodes... I have yet to design and have manufactured my own custom board... Until now!
The Engineering ChallengeAs lead developer on the AutoBSP service, it's my job to make sure it effectively generates quality device trees and DT overlays for as many of our supported platforms as possible. So far, it's doing a great job. However, as the number of supported devices, peripherals and SoCs continues to expand, the challenge has switched from board-by-board development and testing to integration and QA testing.
When it comes to the stability of the service's software, this can be done using a traditional unit test method, which includes a batch test of all valid designs in Geppetto's database. No problem, right?
However, the only way to make certain that the BSP correctly supports a customer's design, is to actually test it on the board. This is already done on a per-board basis at the end of the production pipeline, but it's important that, whenever a user returns to download their BSP from Geppetto, that they get the same or better quality of device tree as they downloaded on day one.
So the task is to gather up all of the Geppetto boards that require DTBs and one-by-one program them and test them. We've tried doing swarm tests, where all of our engineers grab a stack of boards and distribute the work, but this eats up valuable time and resources. We wanted to automate the process as much as possible to free our hands for more urgent tasks, such as getting your custom board into your hands and adding more modules to our library.
In a NutshellHow do we automate such a tactile task? How do we, for each board, flash its SD card or MMC memory with the latest Linux disk image, upload a freshly generated device tree binary, power up the board, and monitor and control the device's debug terminal?
|Hmm, not terrible...|
Can you spot the problem?
That's right. The rat's nest of wires and cables, multiple bulky devices, the overkill of using 120V AC relays, and so-on makes for a real mess. It seemed a good opportunity to use our online design-to-order app to streamline the process.
Refinement by DesignThe largest design flaw culprit in the test rig I described above is the relay board. Having it connected to the local network is perfect. formulating the software to submit HTTP get requests was a snap. Being able to choose between 5V and 12V using a 3-output VPS was vital. But the hardware! what a clunky, cumbersome mess! That and a USB connection to the board's debug port are also the only two commonalities for all boards. Many don't have Ethernet, some don't have USB, not all have video output.
So I decided to refine my relay and couple it with a USB hub.
Designed in GeppettoObviously, this is not my first rodeo. I have been toying, tinkering, playing and working with Geppetto for a couple years now, and I jumped right into it. First came the microcontroller. As part of my requirements, WiFi access was required. The obvious choice then is the ATSAMW25, the same chip-down module used on the Arduino MKR1000 and the only MCU with built-in WiFi.
|Oooh, beveled corners!|
In addition to WiFi access, I wanted to be able to manually toggle the relays, so each relay got a right-angle tactile switch. And an indicator LED, of course. Next, I made all of the connections, adding voltage regulators as needed. The indicator LEDs are connected directly to their relays' 'Enable' signals so they are always on when the circuit is closed and always off when the circuit is open.
I also added a bonus programmable LED right next to the MCU that I'll use to indicate a connection to a WiFi access point, and a reset button. Finally, I added a debug port for the MCU. This will allow me to program it using Arduino as I prototype my design.
Next came the USB hub. This part was easy. A 7-port hub, a 3-port hub and a USB bridge quickly combined with a USB micro-B connector to create a 9-port USB hub.
A Bit of Custom WorkSo I have this design now. It only took about 1.5 hours to put together. And hey, it only took that long because I wanted to play around with rounded edges and custom silkscreen logos - two new and cool features. However, the board wasn't going to behave exactly as I wanted as-is.
However, I happen to know that our electrical engineers are quite skilled and are willing to go the extra mile for our Geppetto designs. When I saved my design, I added a note in the description. It went something like this:
"I would like to have the relays set up to provide either 5V or 12V from on-board power. Please add a jumper or DIP switch to select voltage."
Now that my design was saved, I clicked the 'Validate' button and checked out my new storefront page. This is where my experience briefly deviates from your own. This is the point where you pay the board cost and engineering fee to order your design. Since I'm developing this for a Gumstix application, it's a company expense.
After a brief chat with one of our engineers (he also happens to be my supervisor) to clarify exactly what I meant with my voltage comment, the schematic and layout that Geppetto's back-end generates are modified to include the jumpers as I'd requested, and the gerbers are off to the fabs.
"Relay Commander" Board In-HandAfter a quick few weeks, the board arrived at the office. I spent some obligatory time admiring my (and our engineers') handywork. The terminal blocks, the right-angle pushbuttons, and the USB hub all look great together. With the vanity attack out of the way, time to get down to business.
Arduino SketchThanks to Geppetto's AutoDoc service, I had all of the design data in hand to write an early draft of my relay control sketch. Additionally, thanks to AutoBSP, I was also able to test it out on a RoomSense, getting the initial WiFi and console interfaces tested. Since I didn't have any breadboard-able pushbuttons on hand, testing that interface was a bit too involved to test.
So when the board arrived, I flashed our slightly modified ATSAMW25 bootloader, included with the AutoBSP package, and started testing in earnest.
I'm kind of proud of the fact that Arduino BSPs from Geppetto are designed to be installed in the same was as other "Contributed" packages. When you download autobsp.zip from the Geppetto, it includes a file called contributor_url.txt. it contains a URL that you can copy into your Arduino IDE's settings and the board will show up in the boards manager as would any other BSP.
After a few hours of debugging, I had a stable implementation of the device's minimum operation, including debounced pushbuttons, HTTP request/response interface and command line interfacing over USB. A couple things are currently irking me still. Right now, when I power on the device, two of my relays cycle. Also, I need to be able to fetch the state of all relays over the WiFi interface.
If you've read this previous post, you know that I'm a little uncomfortable with Arduino in finished products. It may seem hypocritical for me to turn around a couple months later and write my relay's firmware in Arduino. I get it, and I'm slowly developing an embedded-C version of the firmware, but as I said in that article, Arduino IS great for prototyping quickly. Getting my relay board up and working as soon as possible is a priority. It is going to be an integral part of kernel, AutoBSP and firmware integration testing in the very near future and I don't have time to be messing around at the lower levels until the pressure's off.
Operating the BoardNow, with the firmware in the functional prototype stage, with WiFi, console and pushbuttons working, I can review the actual quality of the board. The placement of everything is very nice. The volatge selection jumpers are a little bit further back than I would have liked but they are still nicely aligned with respect to the relay IC.
The screw terminals feel well-secured to the PCB. The right-angle USB ports arranged in the center are a bit sticky but, thanks to the extra thru-holes I put in the middle of the board, the standoffs prevent the board from over-flexing. All in all I am very pleased with the construction and custom work that went into my relay board. And because I somewhat modeled the network API after that of the Ethernet relay controller, integrating it into my test suite proved easy enough. With the kinks worked out and my test boards wired up, this baby's ready to go.
My Own Dog FoodSo back to my original statement. Am I willing to eat my own dog food? Do I think Geppetto is worth the noise I make about it? Absolutely. As an embedded software engineer, I don't have the experience required to lay out a board, or source my BOM. I don't have the contacts required to get in touch with reliable PCB manufacturers and fabs. Having a service like Geppetto to take care of that major chunk of the development process means I don't have to go the ad hoc route.
Yes, I will gladly partake of my company's product. I encourage you to do the same. And if you are interested in your own Arduino-ready 10x relay controller with a built-in USB hub, get in touch with me on Twitter (@gsitxguru) or leave a comment below. If there's enough interest, I think we might be able to get the board in the store.