Category Archives: Projects
Two months or so ago, the kids and I bought a few bits and pieces at www.adafruit.com to build small LED badges. They had been staying in their box since then, but I eventually got to it with my youngest this Sunday afternoon.
The idea was to create simple animated badges using the cute 8×8 “mini” LED matrix displays that Adafruit sells, and using some of their small ATTiny45 boards to run the ARV Arduino sketch they described at http://learn.adafruit.com/trinket-slash-gemma-space-invader-pendant/overview .
If you have been following my articles on the train controller, you are probably are thinking that it looked a bit silly to use a Beaglebone and an Arduino side to side in order to control a model train.
At least, that’s what I thought, so I decided to correct this, by designing a Beaglebone train controller cape.
I am a big fan of the USB tester designed by William at http://friedcircuits.us/, and I contributed a bit of code a few months ago, to implement scrolling of the USB voltage graph display.
Since the OLED screen on this device is fairly small, I thought it would be nice to implement autoscaling, so that the display always makes the best use of available space. I implemented this yesterday, and it seems to be working pretty well.
Using this updated firmware, the OLED backpack will now change its display scale dynamically from 200mA to 5A. One nice thing if you are a developer, is that you can simply define the scales in one single array at the beginning of the firmware code and you won’t need to touch any other part.
This new feature is already rolled into the official firmware that is available at https://github.com/FriedCircuits/FC-USB-Tester-OLED-Backpack so go try it, test and report!
One area where I would be interested to get feedback: do you think it is worth displaying the scale on the display? Since we only have 24 vertical pixels, the graph is more of a trend indicator than anything else, so I decided against it. The display flashes a “*” briefly when changing scale, and current reading is always displayed at the bottom anyway…
The very last step of this story, is how to put together a Linux microSD image for the Beaglebone, that works right out of the box and will turn your train controller into something you can just plug in and work with, as it should be.
Note: this article is still in progress, and will get updated shortly!
See this big “B” on the left? B is for Bootstrap, a “Sleek, intuitive, and powerful front-end framework for faster and easier web development”. Or at least that’s what the project page says.
This article will focus on two parts of our application that provide some of the support functions that are needed across most application screens: the link manager, and the settings.
The Link manager
Following up on my previous article on the Arduino Shield prototype, I have started to connect it to more accessories at the same time, and I have run into a small issue…
We laid the foundation for our app in the previous article. The next step is now to create a data model to make it run smoothly.
High level logic of the application
The application lets the use create “locomotives”, where we track a few informations such as picture and description, as well as a runtime and maintenance log. We also manage “layouts”: a layout contains a layout diagram, and a list of controllers and accessories.
In a standard session, the user will select a locomotive and a layout, connect to the controller, and then drive the train & accessories. With that high level view in mind, we can define what screens are required to support this:
We are now moving on to the last part of this series: the part of the application that is running in the browser. As I explained in the previous article, I took the decision to have as much as the overall application run in the browser. There are several reasons for this:
- Keep the code simple by avoid too much back and forth between browser and web app
- Keep server tasks as lightweight as possible in order to run it with good performance on very low end hardware
But before going further, here are a few screenshots of the final result!
I realised that I had completely forgotten to talk about the PCB I designed for the first prototype!
Before integrating the controller into a Beaglebone, I decided to test the concept using an Arduino. Most of the chips being SMD, it was just cheaper and more convenient to design a shield, rather than use multiple breakout boards on breadboards. The downside of not going all the way to a Beaglebone cape is that the arduino needs to be connected to a computer to do its job, or to a Beaglebone through a USB connector which is pretty ugly, but at least it provides a good proof of concept.