After much iteration on the firmware for the keyboard, I decided on finally assembling the device, in spite of not being completely finished. It will continue to be a work-in-progress, but I need to move on to other projects for now. Once I finish some other projects, I’ll come back to this one.
Emboldened by my past success with the Roomba revision D boards, I decided to incorporate this new knowledge of reflow into the next revision for the keyboard toy. A few things needed to change with this design. First, I never did find a good way to incorporate the port expander into the final design; so out it went. Second, the wire harness proved much too cumbersome–I would use a simple female header instead for the TFT. Third, to save space, I would use the TQFP-32 package for the ATMega328p. Continue reading Reflow soldering: further experiments and observations
While trying to iron out the last details of the keyboard project, I decided to try my hand at a surface mounted design, and ordered some tiny ATTiny45 chips (TSSOP) while ordering some other things. What caused me to take the plunge was that I realized I actually had all the tools I needed already. Reading up on the topic lead me to the conclusion that the most economical way to do the soldering would be to use a skillet or hot plate; and rather than buy another tool, I wanted to attempt to use a cast iron skillet that I already had. My thought was that cast iron heats very slowly and evenly and would have many of the same benefits, in that respect, or some other options I had read about. Continue reading Adventures in SMD
I noticed yesterday that I had a mention on the OSH Park blog. Besides that, I have found through my testing this month that the device can run for about 30 hours on a CR2035 battery. In normal use, this amounts to almost a full month of usage, which isn’t bad, but I’m going to experiment to see if I can get it better. I’ll start by tweaking the firmware to see if I can get it to be a bit sleepier and still work. Stay tuned.
I finally wrapped up layout on the first hardware revision for the AVR keyboard toy project and ordered a small batch of them from OSH Park.
Along the way, I decided to quickly finish up my Raspberry Pi ISP tool so that I can use that to program the microcontrollers on these boards when they are ready, because currently, it is not so convenient to do that. The curious can also find this board shared on OSH Park.
Besides the ISP header that allows you to use a standard 6-pin IDC cable to program your boards, it has a few other goodies too, since I thought they might come in handy: UART, I2C and the full SPI bus are all also there.
The firmware is not quite finished for the keyboard toy, but at least I can start building the device now once the boards arrive.
I’ve now built two boards with my OSH Park PCBs, and have been running them successfully for four days now. At the moment, it’s an experiment to see how long the batteries will last in production. If it’s acceptable, I’ll think about making a new, smaller board with only the necessary parts. I’m also already thinking about ways I could possibly improve the device. But I may just leave it as-is, since it is a simple, and effective solution.
Here are the current instructions (also available on GitHub):
Prerequisites for “happy path”:
- Raspberry Pi configured with BCM SPI enabled
- AVR-GCC installed
- Easiest way to get this is ‘sudo apt-get install arduino’
- Jumpers to wire SPI bus of Raspberry Pi to the ISP pins on the finished board
- Order a board based on the files in https://github.com/Petezah/roomba_wall_v2/tree/master/hardware/roomba_wall_v2
- Alternately, order one directly from OSH Park here: https://oshpark.com/shared_projects/zFWYzgg5
- Purchase parts from Mouser electronics using the current BOM
- Use the ones with “mouser” in their filenames
- NB: The DC jack in the current BOM is incorrect
- Assemble the board–parts are all marked on the silkscreen
- Hook up the ISP pins on the assembled board to your Raspberry PI as follows:
- ISP Pin 1 –> Raspberry Pi Pin 21 (MISO)
- ISP Pin 2 –> Raspberry Pi Pin 17 (3.3V)
- ISP Pin 3 –> Raspberry Pi Pin 23 (SCK)
- ISP Pin 4 –> Raspberry Pi Pin 19 (MOSI)
- ISP Pin 5 –> Raspberry Pi Pin 15 (GPIO22)
- ISP Pin 6 –> Raspberry Pi Pin 25 (GND)
- Execute the following on the Raspberry Pi command line
- cd firmware
- make fuse
- make install
This is a picture of the intended use. The current PCB has a drill-hole in the top-center which fits a tiny finishing nail or wire brad perfectly. Pre-nail the wire brad, and slide it through the hole in the board and into the wall (or whatever surface you are using). Slide the switch to the “on” position when you use your Roomba, and back to “off” when finished, to preserve battery life.
Based on the breadboard prototype, I designed a PCB for a real prototype and sent it off to OSH Park to be fabricated. I’m not quite sure what kind of power supply I’ll want for this yet; therefore, I designed three options into the first revision—a CR2032 coin cell clip, a 2mm barrel jack, and a 2 connector surface mount JST connector. I’ll start with the coin cell and see how far that gets me, and will proceed from there. Surely one of those will yield, at the very least, useful data.
Current board designs are on the GitHub project page. I’m also sharing them on OSH Park, and interested makers can order the board with the handy button below.
Continuing the experiment from last time, next up I needed to build a more real prototype using the actual ATTiny85 chip. I wanted the firmware to be buildable outside of the Arduino environment, ideally inside of Atmel Studio as well as using a Makefile on the command line. This involved stripping the code down to bare AVR register manipulation. I initially wanted to just use the built-in 8 Mhz oscillator on the chip, but based on a clue from the TV-Be-Gone Kit project, discovered a bit later, I found the reason my new prototype was not working was because the internal oscillator is not quite stable enough. So I used an 8 Mhz ceramic resonator. The TV-Be-Gone project’s help also allowed me to strip the complicated timing code from my project. The result is now on GitHub.
There are a couple other additions here versus the original breadboard prototype. One is the addition of a slide switch from the positive bus to the VCC pin on the ATTiny85, and the other is an actual dedicated power supply attached to the power bus. Astute observers will note that this is not the same as the photo above; that is merely because the LiPoly battery is just what I happen to have on hand currently. I put the AA battery holder into the drawing because those are cheaper and more readily available.
This prototype was also successful. When tested on the Roomba, the vacuum turns around at the proper time, as expected. Now I intend to build a new prototype on an actual PCB.
Shortly after we bought our Roomba, it became clear that the virtual wall idea is truly useful. However, there are a few flaws with the one that comes with the vacuum: the device is rather large, it doesn’t sit in a very stable way on carpet, and it is generally too easy to move—mainly because of the prior two issues. Therefore I immediately began thinking about building an alternate version of the device. It would have two main features:
- It must be as small as possible
- It must be easy to wall-mount
These made me think of the ATTiny85. It is both small and cheap, and comes in a DIP package that would be easy to solder. These days, I like to test my initial ideas out on the Adafruit Trinket, and I build my first prototype with that. The code is on GitHub, and the assembly pictures are below.
This has no dedicated power supply because it relies on the +5V coming from the Trinket. Also notice that there is an IR receiver and a few more jumpers on the actual breadboard in the photo. That is from an additional test sketch that I was running on a separate MCU board to test the actual transmissions that were coming off of the IR LED. Testing this circuit on the Roomba proved successful. Initially, I had too large of a resistor on my IR LED, and the signal was too weak. But with the 51 ohm resistor, it has a range of a little over two feet, which is more than enough.
Next up was building a more real prototype using the actual ATTiny85 chip. I’ll talk about that in my next entry.