Debug your code with Dialectic Ball

02 June 2018

Dialectic Ball

Always fascinated by portable, low power devices and new ways to interact with them, I was very happy to discover these LCD displays that used to be on old Nokia phones and their consumption is in the micro-Amperes range. As it often happens, I had a solution and was looking for a problem. And that is how Dialectic Ball was conceived!

The Dialectic Ball is a physical, Magic 8-ball inspired, debugging tool for your daily code struggles! Once you are out of ideas, pick up the Dialectic Ball and explain the problem you are facing with all its details. Remember, the Dialectic Ball is a delicate and highly advanced piece of technology, thus the more information you provide it and the more you outline the problem with all its aspects, the better the chance it will be able to assist you.

Once you are done illustrating your coding issue to it, shake Dialectic Ball until the progress bar is filled and wait for the answer! If you do not get a satisfactory answer then try again. Clarify the problem better, think of any crucial details that you might have omitted during the previous run and shake again. Keep on it, until you get a witty response that helps you solve the problem!

image

The Dialectic Ball is more like a rubber duck than a Magic 8-ball, so do not ask it simple yes-no questions. That wouldn’t be so dialectic, would it? Of course, you can always easily modify the code and make it answer whatever you wish.

image

So why this? Well, despite our impressive rubber duck collection at the office, sometimes they fall short on feedback and interaction. In such occasions we often utilize a colleague, but this is admittedly not the most productive use of our colleagues. Dialectic Ball intends to fill this gap, i.e. a rubber duck that is able to provide feedback. As a bonus, shaking it is fun!

image

Dialectic Ball is comprised of an ATtiny84, connected to a GY-61 module (based on the ADXL335 accelerometer) and an LCD screen like the ones used on the old NOKIA phones! Two AAA batteries are powering the gadget up and a 3D printed case encompasses everything, giving it a hemispherical shape. The PCB that routes everything together was manufactured by JLCPCB, who will make your prototype PCB’s for just 2$ and were kind enough to sponsor the rev. 0 boards.

image

From a software perspective the microcontroller mainly remains in deep sleep mode, periodically waking up to turn the accelerometer on and read its measurements. If necessary, the screen will also be powered up and the appropriate messages will be displayed to the user. Specifically, the system wakes up when the ball is not facing downwards. The project’s state machine can be found below.

image

Furthermore, the particular LCD screen consumes minimal power, even when displaying graphics, which makes it ideal for low power applications. Overall, the average power consumption of the gadget is around 10 microamps, enabling it to remain operational for years on those two batteries. In order to achieve that however, the microcontroller has to be clocked down to 1 MHz which does have a visual effect when something is updated on the screen.  Last but not least, the display is controlled via the Nokia LCD library.

image

Overall, the takeaway from this project is that low power consumption does not rule out graphical interfaces and user interaction. This is a lesson learned I am looking forward to apply in the future! Finally, you will find all the necessary resources to reproduce Dialectic Ball on Github and definitely check out the demo video.