Category Archives: Roomba

Adventures in SMD

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

Roomba board, revision “B”

Revision “B” of my Roomba virtual wall device

It’s been a while since I’ve written an update to this project, and there have been a number of developments; so it’s about time.  I now have a couple revision “B” boards deployed, also with new, more efficient firmware.  I haven’t been running the new boards or the new firmware long enough to really tell how much better they are performing, but it ought to be significant.  The big power draws are the LEDs, and they are now enabled far less frequently.  For the interested, all the new info is up on my GitHub project page.  Although, I was pretty sure I updated the ReadMe, but I’m not seeing the changes at the moment.  I’ll have to check and make sure I committed them.  But really, the important changes are:

My AVR ISP tool that I use to program my AVR boards using my Raspberry Pi
  1. I have, since rev “A”, build a new AVR ISP tool that I use to program my boards. (GitHub or OSH Park)  This makes programming the rev B board much easier, since you don’t actually solder the ISP header onto the rev B board; you just “wedge” the pins into the vias during programming.
  2.  … I guess that was it.  I thought there was more than one, but I can’t remember it now.  Perhaps it was unimportant.

Next up, I have a revision “D” board coming which uses the SSOP8 package of the ATTiny45 and is smaller, even, than this board.  For those keeping score, yes, there is a “C” board–it uses a SOIC8 ATTiny, and I realized, before ordering the board, that it was the wrong footprint for the part I had ordered.  But I liked the design, so I kept it and made revision “D” instead.

Updates on the Roomba project

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.

Finished Revision “A” Virtual Wall

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):

Building

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
Steps
Hardware
Firmware
  • 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.

First Revision PCB for the Roomba Virtual Wall

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.Order from OSH Park

AVR Roomba Virtual Wall Prototype (part 2)

Breadboard ATTiny virtual wallContinuing 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.

Diagram of the breadboard layoutThere 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.

AVR Roomba Virtual Wall Prototype

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:

  1. It must be as small as possible
  2. 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.