Going Pro

Exploring Espotek

The Tiny Test Bench

Chris Esposito

Issue 14, August 2018

In issue #13 we looked at Labrador, the tiny (yet powerful) software-driven test bench and were seriously impressed!

We wanted to learn more about Chris Esposito, the brains behind Labrador, and his journey to launching his first electronics device on the world! So, we caught up with him for a quick chat.

Our entire team was seriously impressed with Labrador and its capabilities. It’s a powerful little unit, especially for just $29USD! How did you come up with the idea for Labrador?

I was having trouble debugging a circuit and didn’t have access to the university’s oscilloscopes as it was summer break. I looked online to buy one, but scopes are expensive and I’m cheap. I figured that there were others in the same boat, so decided to put some serious effort into making an oscilloscope that was affordable. Shortly after starting the project, I realised that the final product could be expanded to include an entire lab bench without dramatically increasing the number of components on-board. So, I did. That’s why Labrador has as many features as it does now.

There’s many successful people who suggest that a customer of just one, is enough to deserve the effort. So, you definitely had that! Can you explain a little about how Labrador works?

I could write a 200 page thesis about how Labrador works. That’s probably a bit too much for a Q&A, though, so I’ll go over the main principle of the design - that the device itself should be dumb; all computation “heavy lifting” is handled by the host computer.

If you look at the microcontroller code (and you can - it’s at github.com/espotek/labrador), the main body does nothing more than set up all of the on-chip peripherals, then wait forever. A USB interrupt is received every now and again that is used to send/receive data, but apart from that everything is handled by precisely timed DMA (Direct Memory Access) transfers and the microcontroller’s in-built events system.

early perfboard prototype
Early perfboard prototype.

Calibration, waveform generation, converting the ADC samples to the correct voltage values, attenuation control and even triggering is all handled host-side. Most USB scope devices don’t do this and I always thought it was strange. Why run your main code on a 32MHz 8-bit microcontroller with 4kB of RAM when you have access to a 3GHz, dual-core 64-bit CPU with 4GB of memory that’s doing nothing more than plotting samples to a screen?

It’s a little like rowing the boat instead of firing up the engine! It might work, but you could be doing things a lot faster! How much prototyping was required to get the fundamentals of Labrador going?

To get the fundamentals going, not too much. I moved on from the breadboarding stage to perfboard within the space of a couple of months, and over the space of the next 6 months expanded that same initial perfboard prototype to a fully working demo on a PCB, complete with a MATLAB-based GUI. This was while studying engineering full-time. Considering how much Labrador can do, 9 months of spare time to get a working prototype is not a huge amount.

To get it polished was a different story, though. There were a good 7 different PCB revisions between working prototype and sellable product, plus a whole lot of scrapped software and hardware designs. Labrador was yet another classic case of the last 10% of the work accounting for 90% of the time.

It’s always the final features that take up the time, but they’re often the difference between crude and elegant too. What unexpected challenges did you have getting from concept to production?

I massively underestimated the time it would take to achieve anything. At the start, I honestly believed that I would be finished within a year. After the first year, I thought I would be finished within another 6 months. The actual time to completion was 2.5 years.

I made the rookie mistake of assuming that my experience of solving problems in a classroom environment was a good indicator of what it’s like to tackle challenges unsupervised. It turns out that everything takes a whole lot longer when you’re not solving controlled problems in controlled environments guided by experienced tutors.

That’s not to say that education isn’t important, mind you. Without the simplified classroom problems, I would have never developed the skills to develop a real-world product from scratch. It’s just that real, unsupervised R&D gets very hairy, very fast.

Theory and practice are like cousins that don’t speak - they’re related, but they have different opinions about how things should be done! You have written software for many platforms to drive Labrador, did you have any unexpected challenges getting the software across different platforms?

Some bits were unexpectedly easy, others were unexpectedly challenging. I used Qt to write all of the main code, and was pleasantly surprised to find out that porting between Windows/Mac/Linux was as simple as downloading Qt on the target computer and running compile. USB was a different story.

Now in 2018, it’s fairly simple; libusb, the go-to cross-platform USB library supports all USB modes on all platforms. At the time, though, it did not support isochronous endpoints on Windows. In order to ensure that the board would have enough bandwidth to not drop any samples, I had to use a different library for Windows called libusbK.

Despite the similar name, libusbK was structured very differently to libusb and sharing calls between the two libraries was not a trivial matter. In addition to this, due to Android’s permissions system and lack of native isochronous support, I had to use two separate USB drivers: the official Google USB library (written in Java) for opening the USB device, and a custom fork of libusb with undocumented Android-only functions (written in C) for actually streaming the data from the device.

In the end, this meant tripling up on all USB driver code. To make matters worse, libusbK can synchronise endpoint timings whereas libusb can’t. This meant that two different versions of the board firmware needed to be made; one for when the device was connected to a Windows host and one for the other platforms. Add in the library for flashing these different firmwares on-the-fly, and that brings the total number of objects that do nothing but manage the USB connection to 9.

Two Channel Software Interface
Two Channel Software Interface.

USB certainly revolutionised peripheral connections. However, for something so simple at a consumer level, it’s no surprise it can be a real challenge at a hardware level. Is it just you, or is there a team behind Labrador?

A few of the Linux users have submitted their own patches to get the software working on their particular builds in their preferred format, but all of the main code and hardware design was done by myself. That being said, I wouldn’t recommend working alone on a full-time basis to others. The isolation is just not good for your mental health. Same applies for any students looking to go into a PhD program. The statistics are not pretty.

That’s the perks of open source software, and we applaud you keeping things open source too! You successfully raised almost $24,000 via a crowdfunding campaign on Crowd Supply. What did you learn from the crowdfunding campaign?

One thing that I was surprised by was the overwhelmingly supportive, understanding and encouraging communication I had with the backers. Every time I posted an update, positive or negative, there would be emails telling me either how cool the new feature/fix was, or not to worry about the bad news. I was forced to delay the project 3 times, for several months each time (another thing I learned about crowdfunding; only about 10% of projects ship on time), and after each announcement would come messages of support. The backers seemed to be more interested in seeing the project come to life than they were about getting their package in the mail. It’s very, very different to other forms of eCommerce.

The staff at Crowd Supply were incredibly helpful too, and I couldn’t recommend them more. They made sure the product was feasible to manufacture and sell, that the prototype worked, and that the price was fair. They helped create the campaign material and featured the project on their site and newsletters alongside some bigger projects so that it wouldn’t get lost in the noise. That’s a whole lot more than Kickstarter and Indiegogo, who gave a canned response to my emails and redirected me to a help page.

Fantastic. We’ve come across a few projects launched via Crowd Supply. The community is as important as the net result - it’s no easy task, so it’s great they were supportive throughout the process too. Do you have something new in the works?

In terms of new products, I’ve got a couple of ideas but none that I’m actively working on right at the moment. I work full-time now as a software engineer and still maintain Labrador after hours. That being said, I’m always adding new features to Labrador and there are some more updates coming soon. Once everything settles down a bit and I run out of things to do with the existing product, I’ll be sure to contact you with the details of my project.

Well there’s nothing wrong with a side hustle, and we look forward to hearing about something new in the future! Is there anything else about Labrador we should know?

I think everyone who tinkers with electronics should understand the importance of having an oscilloscope on their bench. Just about every single electronics engineer on the planet uses one daily and with good reason: it is the single most important tool that engineers can use, not just because it can be used to debug almost any complex circuit, but because it allows anyone to visualise actual, physical, working circuits and gain a practical understanding of how they all work together to produce the end result.

Awesome, thanks for taking us through your journey. We wish you all the best for the future too!

From humble beginnings to a fully-functional, low-cost test bench for makers and tinkerers!

Labrador Board
Labrador Board.

From the simple idea of a low-cost oscilloscope, Chris has developed a 2-channel oscilloscope, 2-channel signal generator, a variable output voltage power supply, 2 channel logic analyser, with 4-logic level pins, all in a tiny package.

Buy the Labrador Board

For those who missed the Crowd Supply campaign but would still like to purchase their own Labrador board can do so via the EspoTek website:

Chris Esposito

Chris Esposito

Software Engineer, Hardware Guy

http://espotek.com/