Jekyll2023-12-31T02:04:01-05:00https://surrealitylabs.github.io/feed.xmlSurreality LabsWrite an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.Randy Glennhttps://mademistakes.comGetting back into the swing of things2023-12-31T01:55:00-05:002023-12-31T01:55:00-05:00https://surrealitylabs.github.io/2023/12/getting-back-hackaday-supercon<p>I’ve been meaning to get back into documenting projects for a long time - about nine years, going by the timestamps on this website. A lot has happened in the intervening years - a career change from web development to embedded systems, a big move, a couple of job changes, and a startup or two. In that time, I’ve gotten out of the habit of finishing a project and writing about it. Not that I did such a great job of that before - but I’ve fallen off that even further. It’s something I want to get back to.</p>
<p>One major thing that’s happened in that time, is that I attended the Hackaday Superconference. I’ve been to the 2019, 2022, and 2023 incarnations of the conference, and had a blast each time. It’s a terrific event - lots of interesting talks, plenty of people showing their neat projects, and tons of interesting people eager to talk about what they’re working on. Every time I’ve been, I come away with a renewed enthusiasm for my own projects.</p>
<p>The problem is that so far, I’ve let that slip away, every time. 2019 had a reasonable excuse in that 2020 was a trainwreck, but 2022 became 2023 without me focusing on any of my own projects. I’ve certainly worked on enough of them, but never enough to finish one and write it up.</p>
<p>I’m determined, though, to fix that - to start documenting the things I do, and to try and finish more of them. I’m reviving this site to try and share more of them, so that anyone else who’s interested in my projects can try them. I realize the success rate of these comeback blog posts is pretty low, but it’s worth trying! I’m going to start with a couple of SAO designs. These are circuit boards that attach to an electronic conference badge via a standardish connector. I want to have a bunch of them to give away at Supercon next year, so the time to start is now.</p>
<p>(Why this post? Partially to make sure I meet a personal goal of reactivating it in 2023, and partially to make sure I still know how to work Jekyll)</p>rglennI’ve been meaning to get back into documenting projects for a long time - about nine years, going by the timestamps on this website. A lot has happened in the intervening years - a career change from web development to embedded systems, a big move, a couple of job changes, and a startup or two. In that time, I’ve gotten out of the habit of finishing a project and writing about it. Not that I did such a great job of that before - but I’ve fallen off that even further. It’s something I want to get back to. One major thing that’s happened in that time, is that I attended the Hackaday Superconference. I’ve been to the 2019, 2022, and 2023 incarnations of the conference, and had a blast each time. It’s a terrific event - lots of interesting talks, plenty of people showing their neat projects, and tons of interesting people eager to talk about what they’re working on. Every time I’ve been, I come away with a renewed enthusiasm for my own projects. The problem is that so far, I’ve let that slip away, every time. 2019 had a reasonable excuse in that 2020 was a trainwreck, but 2022 became 2023 without me focusing on any of my own projects. I’ve certainly worked on enough of them, but never enough to finish one and write it up. I’m determined, though, to fix that - to start documenting the things I do, and to try and finish more of them. I’m reviving this site to try and share more of them, so that anyone else who’s interested in my projects can try them. I realize the success rate of these comeback blog posts is pretty low, but it’s worth trying! I’m going to start with a couple of SAO designs. These are circuit boards that attach to an electronic conference badge via a standardish connector. I want to have a bunch of them to give away at Supercon next year, so the time to start is now. (Why this post? Partially to make sure I meet a personal goal of reactivating it in 2023, and partially to make sure I still know how to work Jekyll)Photobooth Button: Open Hardware Advent Calendar Day 182014-12-20T17:42:45-05:002014-12-20T17:42:45-05:00https://surrealitylabs.github.io/2014/12/photobooth-button-open-hardware-advent-calendar-day-18<p>Still playing catch up, our next project is for those building a photobooth: a button to trigger it.</p>
<h2>Overview</h2>
<p>Photobooths are incredibly popular for weddings and other events these days, but are also incredibly expensive. Building one yourself is definitely an option, especially if you already have a decent camera and a computer you can dedicate to it. But wiring up a nice button takes some effort.</p>
<figure class="third ">
<a href="/assets/images/projects/photobooth-button/photos/dome-bottom.jpg" title="Bottom of the button and dome">
<img src="/assets/images/projects/photobooth-button/thumbnails/dome-bottom.jpg" alt="Bottom of the button and dome" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/grab-button.jpg" title="Grab button assembly on the bottom">
<img src="/assets/images/projects/photobooth-button/thumbnails/grab-button.jpg" alt="Grab button assembly on the bottom" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/button-twist.jpg" title="Twist button assembly and pull to remove">
<img src="/assets/images/projects/photobooth-button/thumbnails/button-twist.jpg" alt="Twist button assembly and pull to remove" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/button-assembly.jpg" title="Button assembly removed from dome">
<img src="/assets/images/projects/photobooth-button/thumbnails/button-assembly.jpg" alt="Button assembly removed from dome" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/led-mount-removed.jpg" title="LED mount removed from the button assembly">
<img src="/assets/images/projects/photobooth-button/thumbnails/led-mount-removed.jpg" alt="LED mount removed from the button assembly" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/led-on-mount.jpg" title="With the LED mount removed, we see the two leads, wrapped around the bottom">
<img src="/assets/images/projects/photobooth-button/thumbnails/led-on-mount.jpg" alt="With the LED mount removed, we see the two leads, wrapped around the bottom" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/led-leads-unwrapped.jpg" title="Unwrapped the LED leads from the mount, to change the resistor">
<img src="/assets/images/projects/photobooth-button/thumbnails/led-leads-unwrapped.jpg" alt="Unwrapped the LED leads from the mount, to change the resistor" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/led-resistor-changed.jpg" title="Changed the resistor on the LED to allow 5V operation">
<img src="/assets/images/projects/photobooth-button/thumbnails/led-resistor-changed.jpg" alt="Changed the resistor on the LED to allow 5V operation" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/wires-soldered.jpg" title="Wires soldered to the button and LED">
<img src="/assets/images/projects/photobooth-button/thumbnails/wires-soldered.jpg" alt="Wires soldered to the button and LED" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/button-reassembled.jpg" title="Button reassembled after wiring">
<img src="/assets/images/projects/photobooth-button/thumbnails/button-reassembled.jpg" alt="Button reassembled after wiring" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/usb-wildcard-back.jpg" title="USB Wildcard board wired for photobooth (back side)">
<img src="/assets/images/projects/photobooth-button/thumbnails/usb-wildcard-back.jpg" alt="USB Wildcard board wired for photobooth (back side)" />
</a>
<a href="/assets/images/projects/photobooth-button/photos/usb-wildcard-front.jpg" title="USB Wildcard board wired for photobooth (front side)">
<img src="/assets/images/projects/photobooth-button/thumbnails/usb-wildcard-front.jpg" alt="USB Wildcard board wired for photobooth (front side)" />
</a>
<figcaption>Photos of the photobooth button.
</figcaption>
</figure>
<p>What we’ve come up with here is just such a button, using the USB Wildcard board. It fades the LED in button on and off to attract attention, and when pressed, simulates hitting the spacebar to trigger photo taking.</p>
<h2>Hardware</h2>
<p>This is another one based on the <a href="/2014/12/usb-wildcard-open-hardware-advent-calendar-day-5/">USB Wildcard</a>. It uses that along with a few other components to drive the LED and read the button.</p>
<p>I used a <a href="https://www.sparkfun.com/products/11274" target="_blank">SparkFun Big Dome Button</a>, which needs a modification to work properly. If you try to run the LED in the button on 5V, it will be dim - it’s set up to use 12V, so the resistor is much too large for 5V operation. Refer to the photos above for how to disassemble it, but you basically remove the switch assembly by twisting it, and then pull out the LED assembly from the top of that. Unwind the leads from the plastic frame, and you can pull the LED and resistor out of the assembly. Replace the resistor with a 100 ohm unit, and reassemble.</p>
<p>The following is a very rough schematic of the button:</p>
<p><img src="https://surrealitylabs.github.io/assets/images/projects/photobooth-button/rough-schematic.png" alt="Schematic of photobooth button" /></p>
<p>So you’ve got PD0 of the USB Wildcard to a 1K resistor, and that to the base of a 2N3904 transistor. Emitter of that transistor to Ground, and Collector of it to the cathode side of the LED in the button. Anode of the LED to +5V, and then one side of the button to Ground. The other side of the button goes to PD3, and a 10K pull up resistor from PD3 to +5V.</p>
<h2>Software</h2>
<p>This requires the same Arduino setup as yesterday’s project, <a href="/2014/12/mousemover-open-hardware-advent-calendar-day-17/">so follow the instructions there</a>. Then, you can download the software from the <a href="https://github.com/SurrealityLabs/PhotoboothButton" target="_blank">GitHub project for this project</a>. Load the software and you should be good to go.</p>
<p>Here’s a video of it in action:</p>
<!-- Courtesy of embedresponsively.com -->
<div class="responsive-video-container">
<iframe src="https://www.youtube-nocookie.com/embed/A2p0BifjF50" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen=""></iframe>
</div>
<p>For this video, I used <a href="http://sparkbooth.com/" target="_blank">Sparkbooth</a> but you can substitute whatever you like.</p>
<h2>Future plans</h2>
<p>About the only thing I’d like to add to the current version of this project is some debouncing for the button, but given the delays used to lock out the button after pressing it once, it’s probably not a big issue. I’d also like to look at an even cheaper version using one of Microchip’s new USB PICs - that one would require a cheap microcontroller and a couple resistors and capacitors.</p>
<h2>Conclusion</h2>
<p>This is an easy-to-build photo booth button that’s still easy to customize, thanks to the use of the Arduino software to implement it. I hope someone finds it useful.</p>rglennStill playing catch up, our next project is for those building a photobooth: a button to trigger it. Overview Photobooths are incredibly popular for weddings and other events these days, but are also incredibly expensive. Building one yourself is definitely an option, especially if you already have a decent camera and a computer you can dedicate to it. But wiring up a nice button takes some effort. Photos of the photobooth button. What we’ve come up with here is just such a button, using the USB Wildcard board. It fades the LED in button on and off to attract attention, and when pressed, simulates hitting the spacebar to trigger photo taking. Hardware This is another one based on the USB Wildcard. It uses that along with a few other components to drive the LED and read the button. I used a SparkFun Big Dome Button, which needs a modification to work properly. If you try to run the LED in the button on 5V, it will be dim - it’s set up to use 12V, so the resistor is much too large for 5V operation. Refer to the photos above for how to disassemble it, but you basically remove the switch assembly by twisting it, and then pull out the LED assembly from the top of that. Unwind the leads from the plastic frame, and you can pull the LED and resistor out of the assembly. Replace the resistor with a 100 ohm unit, and reassemble. The following is a very rough schematic of the button: So you’ve got PD0 of the USB Wildcard to a 1K resistor, and that to the base of a 2N3904 transistor. Emitter of that transistor to Ground, and Collector of it to the cathode side of the LED in the button. Anode of the LED to +5V, and then one side of the button to Ground. The other side of the button goes to PD3, and a 10K pull up resistor from PD3 to +5V. Software This requires the same Arduino setup as yesterday’s project, so follow the instructions there. Then, you can download the software from the GitHub project for this project. Load the software and you should be good to go. Here’s a video of it in action: For this video, I used Sparkbooth but you can substitute whatever you like. Future plans About the only thing I’d like to add to the current version of this project is some debouncing for the button, but given the delays used to lock out the button after pressing it once, it’s probably not a big issue. I’d also like to look at an even cheaper version using one of Microchip’s new USB PICs - that one would require a cheap microcontroller and a couple resistors and capacitors. Conclusion This is an easy-to-build photo booth button that’s still easy to customize, thanks to the use of the Arduino software to implement it. I hope someone finds it useful.MouseMover: Open Hardware Advent Calendar Day 172014-12-20T17:07:26-05:002014-12-20T17:07:26-05:00https://surrealitylabs.github.io/2014/12/mousemover-open-hardware-advent-calendar-day-17<p>Due to illness I missed a few days. Now to play catch up…</p>
<p>Today’s project is actually some software for a previous project - the Mouse Mover.</p>
<h2>Overview</h2>
<p>The Mouse Mover uses <a href="/2014/12/usb-wildcard-open-hardware-advent-calendar-day-5/">the USB Wildcard</a> as its hardware. Its basic function is to move the mouse by one pixel once per minute, to keep the screensaver from running.</p>
<p>It’s true that screensavers and display sleep can be disabled by other methods that don’t require extra hardware, but if you need to disable them and either don’t have access to those settings, or don’t want to spend time tracking down the settings, this would be useful.</p>
<h2>Hardware</h2>
<p>The Mouse Mover uses the USB Wildcard hardware, as mentioned before. It doesn’t need any additional hardware beyond that. Check out <a href="https://github.com/SurrealityLabs/USBWildcard" target="_blank">that project’s GitHub for the schematic and PCB.</a></p>
<h2>Software</h2>
<p>The software is written in the Arduino environment. The ATmega16U2 used in the USB Wildcard isn’t supported natively by Arduino, so we need to make some changes. First off, you need to be using Arduino 1.6.0, which is in pre-release right now. You need to download the 3rd party support library that we worked on <a href="https://github.com/SurrealityLabs/minimus-arduino" target="_blank">from GitHub.</a> Download it, and do the following:</p>
<ol>
<li>Find your Sketchbook directory. On a Mac and Linux, it’ll be the Arduino directory in your home directory. On Windows, it’ll be the Arduino directory in your Documents folder.</li>
<li>Create a directory named “hardware” in the sketchbook directory.</li>
<li>Extract the ZIP file from GitHub into a directory called “minimus” in that hardware directory.</li>
</ol>
<p>The Arduino code is based on <a href="https://github.com/pbrook/minimus-arduino" target="_blank">another GitHub project</a> made to bring Arduino support to the Minimus32 board. We modified it to work with the latest Arduino release and to add support for the ATmega16U2.</p>
<p>You’ll need to program the AVR in the USB Wildcard with the proper bootloader. This can be done with the Burn Bootloader command in the Arduino software once it’s set up with the Minimus download. Make sure to set your board type to Minimus 16 (for the ATmega16U2) or Minimus 32 (for the ATmega32U2) first.</p>
<p>Once you have that set up, you can download <a href="https://github.com/SurrealityLabs/MouseMover" target="_blank">the code from our GitHub</a>, and download it to the USB Wildcard board. From then on, the mouse will rock back and forth by one pixel in both X and Y once per minute.</p>
<h2>Future plans</h2>
<p>This one’s pretty much done - it does what it needs to do. I’d like to get some USB type A to Micro USB type B adapters so that it can be connected without a long cable, but that’s about it.</p>
<h2>Conclusion</h2>
<p>While only a slightly useful project, this is a good example of how having a flexible, inexpensive platform like the USB Wildcard on hand can make a simple project a quick one. Also, I got Arduino support for the USB Wildcard out of it, which is going to come in handy.</p>rglennDue to illness I missed a few days. Now to play catch up… Today’s project is actually some software for a previous project - the Mouse Mover. Overview The Mouse Mover uses the USB Wildcard as its hardware. Its basic function is to move the mouse by one pixel once per minute, to keep the screensaver from running. It’s true that screensavers and display sleep can be disabled by other methods that don’t require extra hardware, but if you need to disable them and either don’t have access to those settings, or don’t want to spend time tracking down the settings, this would be useful. Hardware The Mouse Mover uses the USB Wildcard hardware, as mentioned before. It doesn’t need any additional hardware beyond that. Check out that project’s GitHub for the schematic and PCB. Software The software is written in the Arduino environment. The ATmega16U2 used in the USB Wildcard isn’t supported natively by Arduino, so we need to make some changes. First off, you need to be using Arduino 1.6.0, which is in pre-release right now. You need to download the 3rd party support library that we worked on from GitHub. Download it, and do the following: Find your Sketchbook directory. On a Mac and Linux, it’ll be the Arduino directory in your home directory. On Windows, it’ll be the Arduino directory in your Documents folder. Create a directory named “hardware” in the sketchbook directory. Extract the ZIP file from GitHub into a directory called “minimus” in that hardware directory. The Arduino code is based on another GitHub project made to bring Arduino support to the Minimus32 board. We modified it to work with the latest Arduino release and to add support for the ATmega16U2. You’ll need to program the AVR in the USB Wildcard with the proper bootloader. This can be done with the Burn Bootloader command in the Arduino software once it’s set up with the Minimus download. Make sure to set your board type to Minimus 16 (for the ATmega16U2) or Minimus 32 (for the ATmega32U2) first. Once you have that set up, you can download the code from our GitHub, and download it to the USB Wildcard board. From then on, the mouse will rock back and forth by one pixel in both X and Y once per minute. Future plans This one’s pretty much done - it does what it needs to do. I’d like to get some USB type A to Micro USB type B adapters so that it can be connected without a long cable, but that’s about it. Conclusion While only a slightly useful project, this is a good example of how having a flexible, inexpensive platform like the USB Wildcard on hand can make a simple project a quick one. Also, I got Arduino support for the USB Wildcard out of it, which is going to come in handy.Pinbox: Open Hardware Advent Calendar Day 162014-12-16T18:41:10-05:002014-12-16T18:41:10-05:00https://surrealitylabs.github.io/2014/12/pinbox-open-hardware-advent-calendar-day-16<p>This one’s another project in progress - a controller for playing PC-based pinball.</p>
<h2>Overview</h2>
<p>Recently, we started playing Pinball Arcade - a really nice pinball simulator. As some of the people behind DIYPinball, naturally we find virtual pinball games to be lacking, but you can’t always take a pinball machine with you.</p>
<figure class="half ">
<a href="/assets/images/projects/pinbox/photos/pinbox-pcb.jpg" title="Pinbox PCB">
<img src="/assets/images/projects/pinbox/thumbnails/pinbox-pcb.jpg" alt="Pinbox PCB" />
</a>
<a href="/assets/images/projects/pinbox/photos/pinbox-buttons.jpg" title="Pinbox PCB with buttons">
<img src="/assets/images/projects/pinbox/thumbnails/pinbox-buttons.jpg" alt="Pinbox PCB with buttons" />
</a>
</figure>
<p>Enter the Pinbox: a custom controller for playing pinball on a computer. Rather than using your shift keys and spacebar, you get actual arcade buttons on the sides of a box, and a plunger. Or at least you will when we finish it.</p>
<h2>Hardware</h2>
<p>The circuit is basically an Arduino Leonardo on a 5cm x 5cm circuit board. An ATMega32U4 is the brain, and it has five inputs for buttons - two flippers both left and right, and a start button - and an input for a <a href="https://www.sparkfun.com/products/9322" target="_blank">SparkFun photointerrupter board</a>. It also has a header for installing an eventual accelerometer module for tilt detection.</p>
<figure class=" ">
<a href="/assets/images/projects/pinbox/schematic.png" title="Schematic">
<img src="/assets/images/projects/pinbox/schematic-thumb.png" alt="Schematic" />
</a>
</figure>
<p>Schematic and PCB files can be <a href="https://github.com/SurrealityLabs/Pinbox" target="_blank">downloaded from our GitHub</a>.</p>
<h2>Software</h2>
<p>The software is still in progress. The basic function is to act as a USB keyboard, activating the shift keys for the flipper buttons, the Return key for the start button, and the spacebar for the plunger. It uses some debouncing using the Bounce library to take care of the button inputs. Eventually the software will be expanded to interface with the accelerometer to allow you to bump and tilt the table. We use the Leonardo’s built-in Keyboard library to handle sending keypresses to the computer.</p>
<p>Before loading the code, the AVR on the Pinbox board needs to be loaded with the Caterina bootloader. This is done by connecting an AVR programmer to JP1 - I use a USBTinyISP - and using Tools -> Burn Bootloader. From then on, the board can be programmed over USB, just like an Arduino Leonardo.</p>
<p>Source code can be <a href="https://github.com/SurrealityLabs/Pinbox" target="_blank">downloaded from our GitHub</a>.</p>
<h2>Future plans</h2>
<p>This one’s still a work in progress. We still need to figure out the plunger mechanism, using the optical sensor and a knob of some sort. After that, we need to mount it in a box - and then, we need to hook up the accelerometer. So there’s plenty to do, but a clear path to the finish.</p>Randy Glennhttps://mademistakes.comThis one’s another project in progress - a controller for playing PC-based pinball. Overview Recently, we started playing Pinball Arcade - a really nice pinball simulator. As some of the people behind DIYPinball, naturally we find virtual pinball games to be lacking, but you can’t always take a pinball machine with you. Enter the Pinbox: a custom controller for playing pinball on a computer. Rather than using your shift keys and spacebar, you get actual arcade buttons on the sides of a box, and a plunger. Or at least you will when we finish it. Hardware The circuit is basically an Arduino Leonardo on a 5cm x 5cm circuit board. An ATMega32U4 is the brain, and it has five inputs for buttons - two flippers both left and right, and a start button - and an input for a SparkFun photointerrupter board. It also has a header for installing an eventual accelerometer module for tilt detection. Schematic and PCB files can be downloaded from our GitHub. Software The software is still in progress. The basic function is to act as a USB keyboard, activating the shift keys for the flipper buttons, the Return key for the start button, and the spacebar for the plunger. It uses some debouncing using the Bounce library to take care of the button inputs. Eventually the software will be expanded to interface with the accelerometer to allow you to bump and tilt the table. We use the Leonardo’s built-in Keyboard library to handle sending keypresses to the computer. Before loading the code, the AVR on the Pinbox board needs to be loaded with the Caterina bootloader. This is done by connecting an AVR programmer to JP1 - I use a USBTinyISP - and using Tools -> Burn Bootloader. From then on, the board can be programmed over USB, just like an Arduino Leonardo. Source code can be downloaded from our GitHub. Future plans This one’s still a work in progress. We still need to figure out the plunger mechanism, using the optical sensor and a knob of some sort. After that, we need to mount it in a box - and then, we need to hook up the accelerometer. So there’s plenty to do, but a clear path to the finish.Spherebot Controller: Open Hardware Advent Calendar Day 152014-12-15T18:55:47-05:002014-12-15T18:55:47-05:00https://surrealitylabs.github.io/2014/12/spherebot-controller-open-hardware-advent-calendar-day-15<p>Today’s entry isn’t quite done yet, but that’s only because I completely blanked on getting the rest of the parts when I was at the store on Saturday. Oops.</p>
<p>It’s a controller board for the Spherebot.</p>
<h2>Overview</h2>
<p>The <a href="http://pleasantsoftware.com/developer/3d/spherebot/" target="_blank">Spherebot</a> is an alternative design to <a href="http://egg-bot.com/" target="_blank">EMSL’s EggBot</a>. It’s meant to be cheaper, maybe a bit more hackable, and perhaps <a href="http://www.thingiverse.com/thing:7656" target="_blank">made out of 3D printed parts</a>.</p>
<p>I want to take this opportunity right off the top: if you’ve got the resources, I highly suggest buying one of EMSL’s offerings. They’re open-source, and very well designed and made. EMSL do VERY good work.</p>
<p>We, however, didn’t want to spend a ton for screwing around with drawing on ping pong balls, and wanted something more hackable, so a Spherebot it is. One problem, though, was the lack of a controller board - the “official” site just uses a breadboard. That doesn’t cut it with us, so we came up with our own design.</p>
<figure class="third ">
<a href="/assets/images/projects/spherebot-controller/photos/spherebot-1.jpg" title="Spherebot PCB with motor drivers">
<img src="/assets/images/projects/spherebot-controller/thumbnails/spherebot-1.jpg" alt="Spherebot PCB with motor drivers" />
</a>
<a href="/assets/images/projects/spherebot-controller/photos/spherebot-2.jpg" title="Spherebot PCB with motor drivers">
<img src="/assets/images/projects/spherebot-controller/thumbnails/spherebot-2.jpg" alt="Spherebot PCB with motor drivers" />
</a>
<a href="/assets/images/projects/spherebot-controller/photos/spherebot-back.jpg" title="Back of Spherebot PCB">
<img src="/assets/images/projects/spherebot-controller/thumbnails/spherebot-back.jpg" alt="Back of Spherebot PCB" />
</a>
<a href="/assets/images/projects/spherebot-controller/photos/spherebot.jpg" title="Spherebot">
<img src="/assets/images/projects/spherebot-controller/thumbnails/spherebot.jpg" alt="Spherebot" />
</a>
</figure>
<h2>Hardware</h2>
<p>The design is very basic - an ATMega328P with a couple of Pololu stepper driver modules, a servo output, a crystal, and some connectors. Two stepper connectors, one for +12V and +5V in, and one FTDI-type serial connector.</p>
<figure class=" ">
<a href="/assets/images/projects/spherebot-controller/schematic.png" title="Schematic">
<img src="/assets/images/projects/spherebot-controller/schematic-thumb.png" alt="Schematic" />
</a>
</figure>
<p>Power is provided by an ATX power supply, and the serial to USB interface will be done with our <a href="/2014/12/usb-wildcard-open-hardware-advent-calendar-day-5/">USB Wildcard board from earlier</a>. All of this is to keep this board as basic as possible.</p>
<p>Schematic and PCB design files can be <a href="https://github.com/SurrealityLabs/SpherebotController" target="_blank">found on our GitHub</a>.</p>
<h2>Future plans</h2>
<p>I’m currently working on building a Spherebot that will use this board.</p>
<p>I hope to finish that up over my Christmas break from work. I’ll be posting more details on how we built it, along with a parts list and how to get the thing going, because that information seems to be a bit hard to find. This board might also feature prominently in a planned project for the DIYPinball project - a simple board for controlling two stepper motors is a useful thing to have lying around.</p>
<h2>Conclusion</h2>
<p>Not an exciting one today, but hopefully something that other people interested in making Spherebots will find useful.</p>rglennToday’s entry isn’t quite done yet, but that’s only because I completely blanked on getting the rest of the parts when I was at the store on Saturday. Oops. It’s a controller board for the Spherebot. Overview The Spherebot is an alternative design to EMSL’s EggBot. It’s meant to be cheaper, maybe a bit more hackable, and perhaps made out of 3D printed parts. I want to take this opportunity right off the top: if you’ve got the resources, I highly suggest buying one of EMSL’s offerings. They’re open-source, and very well designed and made. EMSL do VERY good work. We, however, didn’t want to spend a ton for screwing around with drawing on ping pong balls, and wanted something more hackable, so a Spherebot it is. One problem, though, was the lack of a controller board - the “official” site just uses a breadboard. That doesn’t cut it with us, so we came up with our own design. Hardware The design is very basic - an ATMega328P with a couple of Pololu stepper driver modules, a servo output, a crystal, and some connectors. Two stepper connectors, one for +12V and +5V in, and one FTDI-type serial connector. Power is provided by an ATX power supply, and the serial to USB interface will be done with our USB Wildcard board from earlier. All of this is to keep this board as basic as possible. Schematic and PCB design files can be found on our GitHub. Future plans I’m currently working on building a Spherebot that will use this board. I hope to finish that up over my Christmas break from work. I’ll be posting more details on how we built it, along with a parts list and how to get the thing going, because that information seems to be a bit hard to find. This board might also feature prominently in a planned project for the DIYPinball project - a simple board for controlling two stepper motors is a useful thing to have lying around. Conclusion Not an exciting one today, but hopefully something that other people interested in making Spherebots will find useful.WS2812B Breakout Board: Open Hardware Advent Calendar Day 142014-12-15T18:42:29-05:002014-12-15T18:42:29-05:00https://surrealitylabs.github.io/2014/12/ws2812b-breakout-board-open-hardware-advent-calendar-day-14<p>Apologies for the delay on this one. I knew that if I missed the schedule one day, it’d just cascade…</p>
<p>This one is another building block for future projects: a breakout board for the WS2812B LED, also known as the NeoPixel.</p>
<h2>Overview</h2>
<p>The WS2812B LED is more commonly known as the NeoPixel, a name popularized by Adafruit. It’s an RGB LED with all the circuitry needed to control its brightness built right into the LED’s package. All you have to do is provide power, connect the data in, and connect the next LED in the chain to the data out. Pretty simple, conceptually.</p>
<figure class="third ">
<a href="/assets/images/projects/ws2812-breakout/photos/fresh-boards.jpg" title="Fresh WS2812 breakout PCBs">
<img src="/assets/images/projects/ws2812-breakout/thumbnails/fresh-boards.jpg" alt="Fresh WS2812 breakout PCBs" />
</a>
<a href="/assets/images/projects/ws2812-breakout/photos/assembled-front.jpg" title="WS2812 breakouts, assembled (front side)">
<img src="/assets/images/projects/ws2812-breakout/thumbnails/assembled-front.jpg" alt="WS2812 breakouts, assembled (front side)" />
</a>
<a href="/assets/images/projects/ws2812-breakout/photos/assembled-back.jpg" title="WS2812 breakouts, assembled (back side)">
<img src="/assets/images/projects/ws2812-breakout/thumbnails/assembled-back.jpg" alt="WS2812 breakouts, assembled (back side)" />
</a>
<a href="/assets/images/projects/ws2812-breakout/photos/ws2812b-breadboard.jpg" title="WS2812 breakouts, on a breadboard">
<img src="/assets/images/projects/ws2812-breakout/thumbnails/ws2812b-breadboard.jpg" alt="WS2812 breakouts, on a breadboard" />
</a>
</figure>
<p>There are a ton of other breakout boards for this LED available out there - Adafruit, Sparkfun, and a bunch of others all sell them. Ours is different because it copies the form factor of an old Sparkfun breakout for a different, similar module - their <a href="https://www.sparkfun.com/products/retired/10504" target="_blank">WS2801 breakout, to be precise.</a> This one was used on the Project Vending Machine 2.0, and has a lot of nice things going for it. It’s fairly small while not being easy to lose, and has four mounting holes. Mounting holes are incredibly important when attaching stuff to other stuff.</p>
<h2>Hardware</h2>
<p>As indicated above, we blatantly ripped off SparkFun’s design for the overall board. We changed the connectors, LED and control chip from 4-pin and an IC+LED combo to 3-pin and a WS2812B. The screw holes and text labels are all in the same place still.</p>
<figure class=" ">
<a href="/assets/images/projects/ws2812-breakout/schematic.png" title="Schematic">
<img src="/assets/images/projects/ws2812-breakout/schematic-thumb.png" alt="Schematic" />
</a>
</figure>
<p>The schematic itself is pretty simple - two connectors, a WS2812B, a bypass capacitor for the power supply, and two series resistors on the serial data lines. These are there primarily to absorb reflections on the serial line - basically, the long wires between modules can cause ringing that causes a large voltage to be present at either pin, which can damage or destroy the LED module. Having a resistor there absorbs that.</p>
<p>Schematic and PCB files are <a href="https://github.com/SurrealityLabs/WS2812Breakout" target="_blank">available at our GitHub</a>. Also included is our old WS2812 breakout - for the 6-pin version rather than the current 4-pin WS2812B - as well as the panelized versions. Those fit 4 boards into a space under 5x5cm, so you can get more boards for your buck.</p>
<p>If you want to order some of the boards from DirtyPCBs, <a href="http://dirtypcbs.com/view.php?share=2713&accesskey=6736006d60aca24d053561f56424ec3f" target="_blank">using this link gets us a kickback in the form of a discount</a>.</p>
<h2>Future plans</h2>
<p>This is going to factor into a bunch of future projects, because I love blinking LEDs. One of them is even part of the advent calendar (I hope).</p>
<h2>Conclusion</h2>
<p>A very useful building block for LED-related projects, even if it isn’t a particularly exciting one on its own. Also, tested and known to work, which is a bonus.</p>rglennApologies for the delay on this one. I knew that if I missed the schedule one day, it’d just cascade… This one is another building block for future projects: a breakout board for the WS2812B LED, also known as the NeoPixel. Overview The WS2812B LED is more commonly known as the NeoPixel, a name popularized by Adafruit. It’s an RGB LED with all the circuitry needed to control its brightness built right into the LED’s package. All you have to do is provide power, connect the data in, and connect the next LED in the chain to the data out. Pretty simple, conceptually. There are a ton of other breakout boards for this LED available out there - Adafruit, Sparkfun, and a bunch of others all sell them. Ours is different because it copies the form factor of an old Sparkfun breakout for a different, similar module - their WS2801 breakout, to be precise. This one was used on the Project Vending Machine 2.0, and has a lot of nice things going for it. It’s fairly small while not being easy to lose, and has four mounting holes. Mounting holes are incredibly important when attaching stuff to other stuff. Hardware As indicated above, we blatantly ripped off SparkFun’s design for the overall board. We changed the connectors, LED and control chip from 4-pin and an IC+LED combo to 3-pin and a WS2812B. The screw holes and text labels are all in the same place still. The schematic itself is pretty simple - two connectors, a WS2812B, a bypass capacitor for the power supply, and two series resistors on the serial data lines. These are there primarily to absorb reflections on the serial line - basically, the long wires between modules can cause ringing that causes a large voltage to be present at either pin, which can damage or destroy the LED module. Having a resistor there absorbs that. Schematic and PCB files are available at our GitHub. Also included is our old WS2812 breakout - for the 6-pin version rather than the current 4-pin WS2812B - as well as the panelized versions. Those fit 4 boards into a space under 5x5cm, so you can get more boards for your buck. If you want to order some of the boards from DirtyPCBs, using this link gets us a kickback in the form of a discount. Future plans This is going to factor into a bunch of future projects, because I love blinking LEDs. One of them is even part of the advent calendar (I hope). Conclusion A very useful building block for LED-related projects, even if it isn’t a particularly exciting one on its own. Also, tested and known to work, which is a bonus.Word Clock 1.0: Open Hardware Advent Calendar Day 132014-12-13T22:12:27-05:002014-12-13T22:12:27-05:00https://surrealitylabs.github.io/2014/12/word-clock-1-0-open-hardware-advent-calendar-day-13<p>Today’s late posting is brought to you by “unintentional napping”. It’s a project I finished a few years ago: a Word Clock.</p>
<h2>Overview</h2>
<p>A word clock is a clock that is made of a bunch of letters. These letters for the words that spell out the time - “IT IS SIX OCLOCK”, “IT IS A QUARTER TO SEVEN”, etc. The letters each have a light behind them, so that the letters and words that are lit up spell out the time.</p>
<figure class="half ">
<a href="/assets/images/projects/wordclock1/photos/word-clock-on-bench.jpg" title="Word Clock on the bench">
<img src="/assets/images/projects/wordclock1/thumbnails/word-clock-on-bench.jpg" alt="Word Clock on the bench" />
</a>
<a href="/assets/images/projects/wordclock1/photos/word-clock-at-work.jpg" title="Word Clock at work">
<img src="/assets/images/projects/wordclock1/thumbnails/word-clock-at-work.jpg" alt="Word Clock at work" />
</a>
</figure>
<p>Mine, as with many, was inspired by the <a href="http://www.qlocktwo.com/?lang=en" title="QLOCKTWO" target="_blank">QLOCKTWO</a>, in addition to others, like <a href="https://web.archive.org/web/20161002060043/http://jamesbastow.com:80/wiki/Antelope" target="_blank">my friend James’ Antelope clock</a>.</p>
<h2>Hardware</h2>
<p>This version is Arduino-based (using an ATMEGA328 running at 8 MHz), using a Microchip MCP79410 real-time clock chip for timekeeping. The Arduino is connected to four buttons for setting the time and changing the display to show the number of seconds. It also reads from a TEPT4400 ambient light sensor to control the overall brightness of the clock.</p>
<figure class="half ">
<a href="/assets/images/projects/wordclock1/schematic-sheet1.png" title="Schematic sheet 1, showing microcontroller, power, and real-time clock">
<img src="/assets/images/projects/wordclock1/schematic-sheet1-thumb.png" alt="Schematic sheet 1, showing microcontroller, power, and real-time clock" />
</a>
<a href="/assets/images/projects/wordclock1/schematic-sheet2.png" title="Schematic sheet 2, showing the LED matrix">
<img src="/assets/images/projects/wordclock1/schematic-sheet2-thumb.png" alt="Schematic sheet 2, showing the LED matrix" />
</a>
</figure>
<p>The Arduino drives the display control circuit, as well. This is formed of two TPIC6B595 power shift registers (shift registers with MOSFETs on their outputs to act as low-side drives) and a 74HC595 shift register to drive the high side of the LEDs. The schematic and board provide for two 74HC595s, but only one is used in the assembled clock. The display is scanned one column at a time, for each of the 16 columns of 8 LEDs each. The LED array is made with both through-hole and surface mount (3528 package) footprints to allow either kind of LED to be used.</p>
<p>A very basic 7805 circuit provides a stable 5V supply.</p>
<p>The board used was not designed for any particular enclosure. This means that it doesn’t fit any known enclosure all that well. As you can imagine, this became an issue during final assembly.</p>
<p>Schematic and PCB files can be <a href="https://github.com/SurrealityLabs/WordClock1" target="_blank">found on our GitHub</a>.</p>
<h2>Software</h2>
<p>The software is a fairly self-contained Arduino project - RTC code is included, so the only real external dependency is the Wire library included with the Arduino software. A bootloader needs to be flashed onto the ATMega328 to load the firmware - a script to do so and the bootloader HEX file are also provided.</p>
<p>Source code can be <a href="https://github.com/SurrealityLabs/WordClock1" target="_blank">found on our GitHub</a>.</p>
<p>The software handles a setup mode for setting the time, displaying the time as words, and displaying the number of seconds on the display (using the letters as pixels to form numbers) when the Seconds button is pressed (S4 on the schematic).</p>
<p>To set the time, S1 is pushed, to put the clock in set mode. The top two letters on the left indicate that you’re adjusting hours, and the Up (S3) and Down (S2) buttons are used to adjust the hours up and down. Pressing S1 again moves to setting Minutes, and then Seconds. Pressing S1 one more time saves the time and returns to display mode. Pressing S4 at any time while setting will cancel set mode. Waiting more than 45 seconds will cancel as well.</p>
<p>RenderTimeMatrixV1BetaGrid.cpp sets up the mapping of words to the LEDs - it contains a number of conditions to determine which words to light up. For moving to different languages, this should be the only file that needs to be edited. The English artwork for the letter grid is included in the source code.</p>
<h2>Physical construction</h2>
<p>Rather than laser etching and other methods for creating the letter grid overlay (which require tools that we don’t have), we used old-fashioned overhead transparencies. Two were stacked on each clock - one laser-printed (which blocks light better), and one inkjet (which doesn’t block light as well, but looks black rather than gray).</p>
<p>The transparencies are mounted in a photo frame that fits the board - we got one from Dollarama - directly behind the glass. Behind the transparencies is a sheet of kitchen parchment paper, to act as a diffuser. This sandwich is held against the glass with a thick paper frame, and the plastic spacer that came with the frame.</p>
<p>(photos of this stackup will be posted at a later date)</p>
<p>Artwork in English is posted to GitHub.</p>
<h2>Future plans</h2>
<p>I’ve pretty much given up on this design. A major shortcoming is that it drives only 8 LEDs at a time, in 16 rows. This means that each LED is only on 1/16 of the time - so you need to drive a LOT of current to get acceptable brightness. Switching it around - so that 16 LEDs are driven at a time, 1/8th of the time - would mean we could get an acceptable display brightness without stressing the LEDs as much. I also want to make one that can be mounted in a particular enclosure nicely, rather than hacking apart a dollar store photo frame as I had to do.</p>
<p>Version 2 is already being planned, and will hopefully be done in early 2015.</p>
<h2>Conclusion</h2>
<p>This design works, but maybe not as well as we’d like. We don’t suggest anyone build it, as we’ve got something better coming - something that had evolved a lot based on the lessons from this project. Some of the parts we played with - the Microchip RTCs, for example - worked really well, and we’ll be using them again. The RTCs especially are far cheaper than the Maxim equivalent. The power shift registers, while nice, aren’t really worth the extra cost.</p>
<p>Stay tuned for Word Clock 2.0.</p>rglennToday’s late posting is brought to you by “unintentional napping”. It’s a project I finished a few years ago: a Word Clock. Overview A word clock is a clock that is made of a bunch of letters. These letters for the words that spell out the time - “IT IS SIX OCLOCK”, “IT IS A QUARTER TO SEVEN”, etc. The letters each have a light behind them, so that the letters and words that are lit up spell out the time. Mine, as with many, was inspired by the QLOCKTWO, in addition to others, like my friend James’ Antelope clock. Hardware This version is Arduino-based (using an ATMEGA328 running at 8 MHz), using a Microchip MCP79410 real-time clock chip for timekeeping. The Arduino is connected to four buttons for setting the time and changing the display to show the number of seconds. It also reads from a TEPT4400 ambient light sensor to control the overall brightness of the clock. The Arduino drives the display control circuit, as well. This is formed of two TPIC6B595 power shift registers (shift registers with MOSFETs on their outputs to act as low-side drives) and a 74HC595 shift register to drive the high side of the LEDs. The schematic and board provide for two 74HC595s, but only one is used in the assembled clock. The display is scanned one column at a time, for each of the 16 columns of 8 LEDs each. The LED array is made with both through-hole and surface mount (3528 package) footprints to allow either kind of LED to be used. A very basic 7805 circuit provides a stable 5V supply. The board used was not designed for any particular enclosure. This means that it doesn’t fit any known enclosure all that well. As you can imagine, this became an issue during final assembly. Schematic and PCB files can be found on our GitHub. Software The software is a fairly self-contained Arduino project - RTC code is included, so the only real external dependency is the Wire library included with the Arduino software. A bootloader needs to be flashed onto the ATMega328 to load the firmware - a script to do so and the bootloader HEX file are also provided. Source code can be found on our GitHub. The software handles a setup mode for setting the time, displaying the time as words, and displaying the number of seconds on the display (using the letters as pixels to form numbers) when the Seconds button is pressed (S4 on the schematic). To set the time, S1 is pushed, to put the clock in set mode. The top two letters on the left indicate that you’re adjusting hours, and the Up (S3) and Down (S2) buttons are used to adjust the hours up and down. Pressing S1 again moves to setting Minutes, and then Seconds. Pressing S1 one more time saves the time and returns to display mode. Pressing S4 at any time while setting will cancel set mode. Waiting more than 45 seconds will cancel as well. RenderTimeMatrixV1BetaGrid.cpp sets up the mapping of words to the LEDs - it contains a number of conditions to determine which words to light up. For moving to different languages, this should be the only file that needs to be edited. The English artwork for the letter grid is included in the source code. Physical construction Rather than laser etching and other methods for creating the letter grid overlay (which require tools that we don’t have), we used old-fashioned overhead transparencies. Two were stacked on each clock - one laser-printed (which blocks light better), and one inkjet (which doesn’t block light as well, but looks black rather than gray). The transparencies are mounted in a photo frame that fits the board - we got one from Dollarama - directly behind the glass. Behind the transparencies is a sheet of kitchen parchment paper, to act as a diffuser. This sandwich is held against the glass with a thick paper frame, and the plastic spacer that came with the frame. (photos of this stackup will be posted at a later date) Artwork in English is posted to GitHub. Future plans I’ve pretty much given up on this design. A major shortcoming is that it drives only 8 LEDs at a time, in 16 rows. This means that each LED is only on 1/16 of the time - so you need to drive a LOT of current to get acceptable brightness. Switching it around - so that 16 LEDs are driven at a time, 1/8th of the time - would mean we could get an acceptable display brightness without stressing the LEDs as much. I also want to make one that can be mounted in a particular enclosure nicely, rather than hacking apart a dollar store photo frame as I had to do. Version 2 is already being planned, and will hopefully be done in early 2015. Conclusion This design works, but maybe not as well as we’d like. We don’t suggest anyone build it, as we’ve got something better coming - something that had evolved a lot based on the lessons from this project. Some of the parts we played with - the Microchip RTCs, for example - worked really well, and we’ll be using them again. The RTCs especially are far cheaper than the Maxim equivalent. The power shift registers, while nice, aren’t really worth the extra cost. Stay tuned for Word Clock 2.0.Electric Imp Breakout: Open Hardware Advent Calendar Day 122014-12-12T18:42:57-05:002014-12-12T18:42:57-05:00https://surrealitylabs.github.io/2014/12/electric-imp-breakout-open-hardware-advent-calendar-day-12<p>Today’s entry is a fairly simple one, but it’s a building block for a future project: a breakout board for the Electric Imp.</p>
<h2>Overview</h2>
<p><a href="http://electricimp.com/" target="_blank">The Electric Imp</a> is a development platform for making devices that connect to the Internet. It’s a module containing a fairly fast microcontroller and a WiFi chip, with software that handles the WiFi connection, and connects to Electric Imp’s servers. From there, it determines which software it’s supposed to run, downloads the latest version, and runs it. The really powerful part here is that you - the developer - write that software, and put it on Electric Imp’s servers. This way, you make sure that every device that you ship always has the latest software.</p>
<p>All of the Imp modules that are available are pretty tiny, but the most common one for hobby applications and prototyping is the SD card size. It’s the same physical size as the memory card we all know and love, but instead of flash memory, it’s a microcontroller and WiFi interface.</p>
<figure class="third ">
<a href="/assets/images/projects/electric-imp-breakout/photos/imp-breakout-front-1.jpg" title="Electric Imp breakout, from the front">
<img src="/assets/images/projects/electric-imp-breakout/thumbnails/imp-breakout-front-1.jpg" alt="Electric Imp breakout, from the front" />
</a>
<a href="/assets/images/projects/electric-imp-breakout/photos/imp-breakout-front-2.jpg" title="Electric Imp breakout, from the front, at a different angle">
<img src="/assets/images/projects/electric-imp-breakout/thumbnails/imp-breakout-front-2.jpg" alt="Electric Imp breakout, from the front, at a different angle" />
</a>
<a href="/assets/images/projects/electric-imp-breakout/photos/imp-breakout-back.jpg" title="Electric Imp breakout, from the back">
<img src="/assets/images/projects/electric-imp-breakout/thumbnails/imp-breakout-back.jpg" alt="Electric Imp breakout, from the back" />
</a>
</figure>
<p>The Electric Imp people make and sell a breakout board to let you more easily use the card - SD cards need at least a socket to be useful, after all. The <a href="https://electricimp.com/docs/hardware/resources/reference-designs/april/" target="_blank">April development board</a> contains a power supply, SD card socket, and the serial number chip that the Imp needs to work. It’s a good deal at $12.50 US, but has some limitations:</p>
<ul>
<li>It uses a Mini USB jack for power. Micro USB is preferred these days</li>
<li>It has no mounting holes, so it’s hard to permanently mount it in a project</li>
<li>It’s cheap for one, but expensive if you need more than that. Which is a problem, because when working with Imp projects, the code that you develop on their server is tied to the serial number on the breakout board / in whatever system you’re developing. Which means you can switch the Imp module between boards and you’ll always have the right code - but it also means messing with things on the server if you only have one development board.</li>
</ul>
<p>Because of those limitations, and because I have a stack of (now-discontinued) SD card sockets from a previous project, I decided to make my own breakout boad.</p>
<h2>Hardware</h2>
<p>The setup is really simple: a 5V to 3.3V power supply using a Microchip LDO, the Atmel serial number chip, some bypass capacitors, and connectors. All this in a board under 5x5cm, with 4 mounting holes for easy attachment.</p>
<figure class=" ">
<a href="/assets/images/projects/electric-imp-breakout/schematic.png" title="Schematic">
<img src="/assets/images/projects/electric-imp-breakout/schematic-thumb.png" alt="Schematic" />
</a>
</figure>
<p>As always, schematic and PCB layout files can be <a href="https://github.com/SurrealityLabs/ElectricImpBreakout" target="_blank">found on our GitHub</a>.</p>
<h2>Future enhancements</h2>
<p>There’s not much to be enhanced on this board - it’s pretty complete for what it needs to be, which is to provide the bare minimum needed to getting an Electric Imp running. About the only change I can see making is to replace the discontinued SD card socket with one that’s still made.</p>
<p>It will, however, be used in future projects.</p>
<h2>Conclusion</h2>
<p>This is a really basic, simple project - not even any software! - that I hope will help someone in the future not have to design their own if they need it. Building these this way let me put together 10 breakouts for about $50 - saving me more than half the cost of buying April boards and getting me a preferable USB connector and mounting holes, at the cost of a couple hours of work.</p>
<p>Since I was also watching TV while I was doing that work, I’m happy with that tradeoff.</p>rglennToday’s entry is a fairly simple one, but it’s a building block for a future project: a breakout board for the Electric Imp. Overview The Electric Imp is a development platform for making devices that connect to the Internet. It’s a module containing a fairly fast microcontroller and a WiFi chip, with software that handles the WiFi connection, and connects to Electric Imp’s servers. From there, it determines which software it’s supposed to run, downloads the latest version, and runs it. The really powerful part here is that you - the developer - write that software, and put it on Electric Imp’s servers. This way, you make sure that every device that you ship always has the latest software. All of the Imp modules that are available are pretty tiny, but the most common one for hobby applications and prototyping is the SD card size. It’s the same physical size as the memory card we all know and love, but instead of flash memory, it’s a microcontroller and WiFi interface. The Electric Imp people make and sell a breakout board to let you more easily use the card - SD cards need at least a socket to be useful, after all. The April development board contains a power supply, SD card socket, and the serial number chip that the Imp needs to work. It’s a good deal at $12.50 US, but has some limitations: It uses a Mini USB jack for power. Micro USB is preferred these days It has no mounting holes, so it’s hard to permanently mount it in a project It’s cheap for one, but expensive if you need more than that. Which is a problem, because when working with Imp projects, the code that you develop on their server is tied to the serial number on the breakout board / in whatever system you’re developing. Which means you can switch the Imp module between boards and you’ll always have the right code - but it also means messing with things on the server if you only have one development board. Because of those limitations, and because I have a stack of (now-discontinued) SD card sockets from a previous project, I decided to make my own breakout boad. Hardware The setup is really simple: a 5V to 3.3V power supply using a Microchip LDO, the Atmel serial number chip, some bypass capacitors, and connectors. All this in a board under 5x5cm, with 4 mounting holes for easy attachment. As always, schematic and PCB layout files can be found on our GitHub. Future enhancements There’s not much to be enhanced on this board - it’s pretty complete for what it needs to be, which is to provide the bare minimum needed to getting an Electric Imp running. About the only change I can see making is to replace the discontinued SD card socket with one that’s still made. It will, however, be used in future projects. Conclusion This is a really basic, simple project - not even any software! - that I hope will help someone in the future not have to design their own if they need it. Building these this way let me put together 10 breakouts for about $50 - saving me more than half the cost of buying April boards and getting me a preferable USB connector and mounting holes, at the cost of a couple hours of work. Since I was also watching TV while I was doing that work, I’m happy with that tradeoff.AVR Pigrammer: Open Hardware Advent Calendar Day 112014-12-11T18:59:18-05:002014-12-11T18:59:18-05:00https://surrealitylabs.github.io/2014/12/avr-pigrammer-open-hardware-advent-calendar-day-11<p>Today’s project is a little thing I threw together to put together kits for the Christmas ornaments last year: the AVR Pigrammer, a device for programming lots of AVR microcontrollers quickly.</p>
<h2>Overview</h2>
<p>The AVR Pigrammer is a very basic AVR programmer based around the Raspberry Pi. I put it together because I needed to program 100 AVR microcontrollers, 25 each of 4 different programs. Doing this via the normal command line would have been really annoying. I figured the easiest way to do this was to have an easy-to-use ZIF socket for loading the microcontroller, a button to push to start programming, and some LEDs to show the status. That way, I could absent-mindedly program the chips while watching TV.</p>
<figure class="half ">
<a href="/assets/images/projects/pigrammer/photos/pigrammer.jpg" title="AVR Pigrammer, alone">
<img src="/assets/images/projects/pigrammer/thumbnails/pigrammer.jpg" alt="AVR Pigrammer, alone" />
</a>
<a href="/assets/images/projects/pigrammer/photos/pigrammer-with-pi.jpg" title="AVR Pigrammer, with a Raspberry Pi">
<img src="/assets/images/projects/pigrammer/thumbnails/pigrammer-with-pi.jpg" alt="AVR Pigrammer, with a Raspberry Pi" />
</a>
</figure>
<p>Since AVRDUDE on Linux can program chips over the system’s SPI port, that meant a Raspberry Pi could act as an AVR programmer without much extra hardware. Add some LEDs and a button, and you’ve got everything you need.</p>
<h2>Hardware</h2>
<p>The schematic is very simple: we wire up the AVR to the SPI port of the Raspberry Pi, a button to GPIO23, and LEDs hooked up to transistors that are driven by some other GPIO lines. These LEDs show if the last write to a chip was good (green), if it’s writing to a chip now (yellow), if the last chip was bad (red), or if you’ve programmed all the chips you need to (blue).</p>
<figure class=" ">
<a href="/assets/images/projects/pigrammer/schematic.png" title="Schematic">
<img src="/assets/images/projects/pigrammer/schematic-thumb.png" alt="Schematic" />
</a>
</figure>
<p>There’s really not much to it - I didn’t even bother with a custom PCB for the first version, just a prototyping board. Schematic and code can be <a href="https://github.com/SurrealityLabs/AVR-Pigrammer">found on our GitHub page</a>.</p>
<h2>Software setup</h2>
<p>There are a couple of prerequisites for this project. One is that AVRDUDE is compiled with SPI support built in, and configured to use Reset on GPIO25. You also need to add the SPI module to your Raspberry Pi - or at least remove it from the blacklist. <a href="http://kevincuzner.com/2013/05/27/raspberry-pi-as-an-avr-programmer/" target="_blank">Kevin Cuzner’s site goes into detail on all of this</a>.</p>
<p>The software I wrote is a Python script that in turn calls your project’s Makefile, which in turn calls AVRDUDE. The Python script checks the return value of AVRDUDE to see if the chip programmed successfully or not, and keeps track of how many good chips you’ve programmed. The Python script is called as:</p>
<p>sudo python pigrammer.py <Makefile rule="" to="" flash="" the="" chip=""> <number of="" chips=""></number></Makefile></p>
<p>The Python script passes an environment variable BATCH_MODE and sets it equal to pigrammer. A rule in the Makefile should check if that environment variable is set, and set the AVRDUDE configuration to use the SPI programmer if it is. <a href="https://github.com/SurrealityLabs/xmas2013/blob/master/code/Makefile" target="_blank">You can find an example in the setup for the Christmas Ornaments Makefile</a>.</p>
<h2>Future plans</h2>
<p>I have a lot I’d like to do with this project. I’d like to improve the hardware to work with different AVRs - right now it only works with 8-pin ATTinyx5s. I’d also like to improve the software to not rely on the Makefile, and instead take a HEX file and the fuse settings as parameters. The reason it uses the Makefile now is to allow the Makefile to set fuses in the proper order for programming, and to rebuild the HEX file if it’s out of date.</p>
<p>Eventually, the goal is to make this unit standalone so that it doesn’t need a keyboard or monitor to run, as it does now. On-the-fly updating to the latest code would also be an awesome feature.</p>
<h2>Conclusion</h2>
<p>This is just the start of this project, but it’s already proven essential - I was able to program 100 AVRs in a little over an hour while watching TV. I definitely want to evolve it to make it even more useful.</p>rglennToday’s project is a little thing I threw together to put together kits for the Christmas ornaments last year: the AVR Pigrammer, a device for programming lots of AVR microcontrollers quickly. Overview The AVR Pigrammer is a very basic AVR programmer based around the Raspberry Pi. I put it together because I needed to program 100 AVR microcontrollers, 25 each of 4 different programs. Doing this via the normal command line would have been really annoying. I figured the easiest way to do this was to have an easy-to-use ZIF socket for loading the microcontroller, a button to push to start programming, and some LEDs to show the status. That way, I could absent-mindedly program the chips while watching TV. Since AVRDUDE on Linux can program chips over the system’s SPI port, that meant a Raspberry Pi could act as an AVR programmer without much extra hardware. Add some LEDs and a button, and you’ve got everything you need. Hardware The schematic is very simple: we wire up the AVR to the SPI port of the Raspberry Pi, a button to GPIO23, and LEDs hooked up to transistors that are driven by some other GPIO lines. These LEDs show if the last write to a chip was good (green), if it’s writing to a chip now (yellow), if the last chip was bad (red), or if you’ve programmed all the chips you need to (blue). There’s really not much to it - I didn’t even bother with a custom PCB for the first version, just a prototyping board. Schematic and code can be found on our GitHub page. Software setup There are a couple of prerequisites for this project. One is that AVRDUDE is compiled with SPI support built in, and configured to use Reset on GPIO25. You also need to add the SPI module to your Raspberry Pi - or at least remove it from the blacklist. Kevin Cuzner’s site goes into detail on all of this. The software I wrote is a Python script that in turn calls your project’s Makefile, which in turn calls AVRDUDE. The Python script checks the return value of AVRDUDE to see if the chip programmed successfully or not, and keeps track of how many good chips you’ve programmed. The Python script is called as: sudo python pigrammer.py The Python script passes an environment variable BATCH_MODE and sets it equal to pigrammer. A rule in the Makefile should check if that environment variable is set, and set the AVRDUDE configuration to use the SPI programmer if it is. You can find an example in the setup for the Christmas Ornaments Makefile. Future plans I have a lot I’d like to do with this project. I’d like to improve the hardware to work with different AVRs - right now it only works with 8-pin ATTinyx5s. I’d also like to improve the software to not rely on the Makefile, and instead take a HEX file and the fuse settings as parameters. The reason it uses the Makefile now is to allow the Makefile to set fuses in the proper order for programming, and to rebuild the HEX file if it’s out of date. Eventually, the goal is to make this unit standalone so that it doesn’t need a keyboard or monitor to run, as it does now. On-the-fly updating to the latest code would also be an awesome feature. Conclusion This is just the start of this project, but it’s already proven essential - I was able to program 100 AVRs in a little over an hour while watching TV. I definitely want to evolve it to make it even more useful.DigitNet 2: Open Hardware Advent Calendar Day 102014-12-10T18:37:13-05:002014-12-10T18:37:13-05:00https://surrealitylabs.github.io/2014/12/digitnet-2-open-hardware-advent-calendar-day-10<p>Today’s project is another one that’s been waiting to be released for quite some time: a networkable 7 segment display that I call DigitNet 2.</p>
<h2>Overview</h2>
<p>Way back in 2007, as a final year “prank”, my graduating class made a clock to count down to the Iron Ring ceremony at McMaster University every year. We went with a bunch of discrete LED-based digit boards, each with a microcontroller, and networked together over RS485 with a control board. The final result worked, but I felt the design could be improved. Calling that one DigitNet 1, this project - DigitNet 2 - is an attempt to improve on that design.</p>
<figure class="third ">
<a href="/assets/images/projects/digitnet2/photos/digitnet2-front.jpg" title="DigitNet2 board, front">
<img src="/assets/images/projects/digitnet2/thumbnails/digitnet2-front.jpg" alt="DigitNet2 board, front" />
</a>
<a href="/assets/images/projects/digitnet2/photos/digitnet2-back.jpg" title="DigitNet2 board, back">
<img src="/assets/images/projects/digitnet2/thumbnails/digitnet2-back.jpg" alt="DigitNet2 board, back" />
</a>
<a href="/assets/images/projects/digitnet2/photos/countdown-clock.jpg" title="Countdown clock, made with DigitNet2 boards">
<img src="/assets/images/projects/digitnet2/thumbnails/countdown-clock.jpg" alt="Countdown clock, made with DigitNet2 boards" />
</a>
</figure>
<p>There are a bunch of changes, but the major ones are moving to a proper LED driver chip (the STP08DP05 in this case), using 12V rather than 5V to drive the display, better wiring, and adding a configurable address to each board.</p>
<p>The end result of these improvements is a board that has a 4” 7-segment display unit (sourced from eBay), a proper constant-current LED driver chip, an ATTiny2313 microcontroller, a surface mount DIP switch to set the address for each board, some debug LEDs, and in and out connectors to wire the boards together easily. Having multiple boards makes it easy to do a big countdown clock (as you can see above, pictured on the incredibly messy desk / workbench)</p>
<h2>Hardware</h2>
<p>The hardware is fairly basic: an ATTiny2313 is connected to an SN75176 RS485 transceiver. Its address is configured by a surface-mount DIP switch. There’s a basic power supply to give 5V for the digital parts, and 12V powers the LED display. This display has multiple diodes in series in each segment, so a larger voltage than normal is required to drive it.</p>
<figure class=" ">
<a href="/assets/images/projects/digitnet2/schematic.png" title="Schematic">
<img src="/assets/images/projects/digitnet2/schematic-thumb.png" alt="Schematic" />
</a>
</figure>
<p>The board is designed to use as many surface mount parts as practical, and to mount to the back of the 4 inch 7 segment display module. It was also designed to fit in a 5cm x 10cm Seeedstudio prototype board order, and provide mounting holes to secure the module to whatever frame it needs to attach to.</p>
<p>To wire together a bunch of boards, the power and network connections are daisy-chained between boards, with a controller of some sort at one end.</p>
<p>Schematic, PCB and Gerber files can be <a href="https://github.com/SurrealityLabs/DigitNet2" target="_blank">downloaded from our GitHub</a>.</p>
<h2>Software</h2>
<p>The software was written in C for the AVR using the standard AVR-GCC toolchain. An ISP connector is provided on the board to load the firmware onto the chip. The software basically sits waiting to hear one of three commands, and then listens for an address (for some commands) and then a byte of data. That data is either the segments to turn on (7 segments plus one decimal point = 8 bits), or the brightness. Brightness is controlled using the PWM output of the microcontroller.</p>
<p>Software can be <a href="https://github.com/SurrealityLabs/DigitNet2" target="_blank">downloaded from our GitHub</a>.</p>
<h2>Protocol</h2>
<p>There are three commands:</p>
<ul>
<li>0x99 is Global Brightness Change. Every node on the network acts on this message regardless of address, and sets the PWM duty cycle to the next byte received.</li>
<li>0xAA is a Data command. The next byte specifies which board the message is meant for. The protocol supports up to 256 units, but only 4 bits are implemented in this version - the DIP switch drives the lower 4 bits, and the upper 4 are set to 0. The last byte specifies which segments to turn on. I don’t have which bits map to which segments available at this time.</li>
<li>0xBB is a Brightness command. The next byte specifies which board the message is meant for. The last byte specifies the brightness for that digit.</li>
</ul>
<p>Data is transmitted over RS485 at 9600bps, 8 data bits, 1 stop bit, no parity.</p>
<h2>Future enhancements</h2>
<p>These work fairly well for making a big-digit display - I easily made a countdown clock with them - but the protocol could do with a checksum of some sort for integrity. I also need to document said countdown clock.</p>
<h2>Conclusion</h2>
<p>This was a successful project, as far as making an enhanced version of the original at McMaster - it was far easier to configure, assemble and maintain than the original.</p>rglennToday’s project is another one that’s been waiting to be released for quite some time: a networkable 7 segment display that I call DigitNet 2. Overview Way back in 2007, as a final year “prank”, my graduating class made a clock to count down to the Iron Ring ceremony at McMaster University every year. We went with a bunch of discrete LED-based digit boards, each with a microcontroller, and networked together over RS485 with a control board. The final result worked, but I felt the design could be improved. Calling that one DigitNet 1, this project - DigitNet 2 - is an attempt to improve on that design. There are a bunch of changes, but the major ones are moving to a proper LED driver chip (the STP08DP05 in this case), using 12V rather than 5V to drive the display, better wiring, and adding a configurable address to each board. The end result of these improvements is a board that has a 4” 7-segment display unit (sourced from eBay), a proper constant-current LED driver chip, an ATTiny2313 microcontroller, a surface mount DIP switch to set the address for each board, some debug LEDs, and in and out connectors to wire the boards together easily. Having multiple boards makes it easy to do a big countdown clock (as you can see above, pictured on the incredibly messy desk / workbench) Hardware The hardware is fairly basic: an ATTiny2313 is connected to an SN75176 RS485 transceiver. Its address is configured by a surface-mount DIP switch. There’s a basic power supply to give 5V for the digital parts, and 12V powers the LED display. This display has multiple diodes in series in each segment, so a larger voltage than normal is required to drive it. The board is designed to use as many surface mount parts as practical, and to mount to the back of the 4 inch 7 segment display module. It was also designed to fit in a 5cm x 10cm Seeedstudio prototype board order, and provide mounting holes to secure the module to whatever frame it needs to attach to. To wire together a bunch of boards, the power and network connections are daisy-chained between boards, with a controller of some sort at one end. Schematic, PCB and Gerber files can be downloaded from our GitHub. Software The software was written in C for the AVR using the standard AVR-GCC toolchain. An ISP connector is provided on the board to load the firmware onto the chip. The software basically sits waiting to hear one of three commands, and then listens for an address (for some commands) and then a byte of data. That data is either the segments to turn on (7 segments plus one decimal point = 8 bits), or the brightness. Brightness is controlled using the PWM output of the microcontroller. Software can be downloaded from our GitHub. Protocol There are three commands: 0x99 is Global Brightness Change. Every node on the network acts on this message regardless of address, and sets the PWM duty cycle to the next byte received. 0xAA is a Data command. The next byte specifies which board the message is meant for. The protocol supports up to 256 units, but only 4 bits are implemented in this version - the DIP switch drives the lower 4 bits, and the upper 4 are set to 0. The last byte specifies which segments to turn on. I don’t have which bits map to which segments available at this time. 0xBB is a Brightness command. The next byte specifies which board the message is meant for. The last byte specifies the brightness for that digit. Data is transmitted over RS485 at 9600bps, 8 data bits, 1 stop bit, no parity. Future enhancements These work fairly well for making a big-digit display - I easily made a countdown clock with them - but the protocol could do with a checksum of some sort for integrity. I also need to document said countdown clock. Conclusion This was a successful project, as far as making an enhanced version of the original at McMaster - it was far easier to configure, assemble and maintain than the original.