Building SIO2Arduino to enable an Atari 800XL to use SD Cards

Last winter, I built an SIO2Arduino circuit – it is an adapter, that enables the Atari to use disk images loaded on to a regular SD card.

My build of the SIO2Arduino SD Card Adapter
My build of the SIO2Arduino SD Card Adapter

To the Atari, the SD card works just like a floppy drive.  It’s was built following the instructions found here:

With a program called SDRIVE, I can select a disk image on the SD card, and then load it:

Selecting an Atari image on the SD card using the SDRIVE program
Selecting an Atari image on the SD card using the SDRIVE program

I never did get the adapter working perfectly – I can load certain disk images, such as ballblazer, but not others, like Karateka.  I think it would take a lot more investigation, and perhaps digging into code, to figure out how to fix this issue.

ballblazer running on Atari from SD Card
ballblazer running on Atari from SD Card

Until I get a suitable TV, this is likely as far as I’m taking this particular project.

Playing around with an Atari 800XL

My “RetroPie” days of emulating old games on the Raspberry Pi are over – from now on, I can play the real thing.

I was given a friend’s old family computer, an Atari 800XL in 2011.  They still had all the parts, except the custom molded cable that connects the floppy drive to the unit.

Receiving an Atari 800XL in 2011Receiving an Atari 800XL in 2011

5 years to the month, I finally got around to ordering a cable from a company in California that still has pretty much everything Atari ever made in stock:

I picked up a Donkey Kong cartridge (pictured) along with my cable order (the available, never released Bruce Lee prototype cartridges exceeded my budget).

As I don’t have a TV, I connected it to a PC with a Hauppage TV card.  As I don’t have the correct cables, I only get a black and white picture (I don’t have a composite cable, and the brightness and colour signals are split).  Also, Donkey Kong is unplayable with this setup, as the TV card adds a significant lag (eg: Mario jumps half a second after you jump).

Donkey Kong on an Atari 800XL
Donkey Kong on an Atari 800XL
In another post, I’ll write up how I hacked up one of the floppy cables and built an Atari floppy emulator with an Arduino, so that I can download Atari software from the Internet and load it off an SD card:

2016 Balcony Crop

Our 2016 balcony crop has come in. A bit of a disappointment this year, as we were away for most of August, and were not able to care for the garden as much as we would have liked.

Corn from our 2016 Crop
Corn from our 2016 Crop
  • The corn was harvested too late – by the time we returned home, it was overripe and tasted pretty gross.  It looked OK.
  • Our sunflowers and some of our other flowers died
  • Some of our carrots fared well and tasted great, but another planter of carrots died
  • One of our tomato plants died, the other is still doing well and bearing a couple ripe tomatoes every day

I need a balcony friendly watering system!


Open Apartment and Condo Doors Over the Web with your Smart Phone

Like many buildings, the building we live in has a panel at the main entrance which allows guests to call their hosts.  The guest initiates the call by looking up and dialing a apartment specific buzzer code, and the host can remotely unlock the front door by dialing 9 on their phone.

Occasionally, we’ve had the need for an extra set of keys when guests are visiting.  Given the ubiquity of smart phones, I’ve thought: Wouldn’t it be great to build a web interface which would essentially pick up the phone and dial 9, permitting entrance to the building without a set of keys?

The easiest way to do this was to write an application that uses an analog modem, which can detect a ring, pick up the phone, and generate tones.  Finding a suitable modem was the hardest part, given that there are so few applications for analog modems since the widespread use of broadband Internet in the late 1990s.  Further complicating things was I was looking to use a Raspberry Pi – this meant I needed a modem with a USB interface that works with Linux.  From my research, the  TRENDnet TFM-561U modem seemed to be the best fit for this purpose – testing has since confirmed it works great.

Lock and Key - Admin Screen
Lock and Key – Admin Screen

I wrote the application itself in NodeJS.  Using the administrative page (behind a firewall) the Host sets up a password, has the option of adding a note, and must set dates for when the password starts and stops working.  Note that there’s no login – it’s hard enough to remember a password, let alone the corresponding login.  The passwords are stored hashed (using bcrypt) – it’s assumed that there are very few logins setup, so when the guest logs in, the password they enter is compared against the hash of every password in the system.

Lock and Key - Public Screen
Lock and Key – Public Screen

The Internet facing, or guest page, is simply a passphrase box.  When a guest enters a correct password, the system will wait for a “ring”  (for up to 5 minutes by default).  The guest can then dial the buzzer code.  When the modem detects the ring from the main entrance, the application will instruct it to answer the phone, dial 9, and hang up.  The building’s entry system will then unlock the door, permitting the guest to enter.


  • I’ve only tested with my primary PC (Ubuntu Linux / Intel x86)
  • Node runtime
  • I’ve only tested with a TRENDnet TFM-561U modem
  • I’ve only tested in my building

Setup and Run:

  1. Get the code! You can download from GitHub, or clone the repository
  2. Install Node and the required modules.  In an Ubuntu Linux environment, this can be done as follows:
    sudo apt-get install nodejs
    sudo npm install express sqlite3 bcrypt-nodejs node-validator fs body-parser serialport
  3. You may also want to look at the PM2 process manager for Node – it makes it really easy to automatically start Node applications on boot up, and a dynamic DNS service such as the one provided by to access your
  4. Review the lockandkeyconfig.json configuration file.
    1. port: The port used by the public web interface (configure your router to expose this port to the Internet)
    2. adminport: The port used by the administrative interface.  This is used to configure accounts
    3. unlocktimeout: Length of time, following a successful login, for which the system will pick up the phone and dial 9.
    4. modemmanufacturerstring: The string used to identify the modem which should be used by the application.  Use the Linux dmesg command after plugging in a USB modem to see the manufacture string associated with your device. Use Conexant for the TRENDnet TFM-561U.
  5. You can start the program by running
    node lockandkey.js
  6. With the default values, to setup accounts, you can access the administrative interface at:
    and the door opening interface at:

Complete source code and build details:

Future Improvements:

I can see this particular project being useful to others – let me know if you have any suggestions.  For example, let me know if there is interest in a Raspberry Pi SD card image, a simple phone Android/iPhone app to avoid book marking the website, improvements to security, mandatory HTTPS, or eliminating the need for a dynamic DNS service in a home environment.

Update – March 27, 2017

One of my friends needed a solution to provide his clients with access to a condo unit he is renting over Airbnb.  He’s now using this solution, which is running on a Raspberry Pi.

Happy Valentine’s Day

I had fun making light-up Valentine’s Day cards this year.

Valentine's Day Cards
Valentine’s Day Cards

They’re built from a patterns I found on Sparkfun’s website.

My design is much simpler, and requires fewer parts.

Paper Switch for LED
Paper Switch for LED

Once the card is opened, the person receiving the card simply pulls out the paper, turning on the light.  The LED and battery assembly is glued to the card with a hot glue gun.

My Weather Station

About 15 years ago, a friend of mine informed me that Sensirion would send a sample of one of their temperature sensors to anyone who filled a form on their web page (I’m not sure if this is still the case). After the Sensirion sensor arrived in the mail, I wired it to my PC’s parallel printer port, wrote a little code, and built a simple web page that could display the room temperature.

Ever since then, building my own weather station has been on my hobby-project back log. I realize one can purchase all sorts of thermometers and weather stations off the shelf, but I thought it would be fun to build my own.

I decided I wanted a wireless station with a web front end, which would measure and log temperature, humidity, barometric pressure, and the soil moisture of my plants.

Weather Station - System Overview
Weather Station – System Overview

I decided this would be a good project to learn about development with the NodeJS runtime.  I was pleased – not only was it easy to learn, but it was easy to do what I wanted.

The weather station itself is built around the Arduino platform, which collects data from various sensors, and sends an update every 15 minutes using a wireless module, to my PC, equipped with a matching wireless module, connected by USB (it is not using Wi-Fi).

Weather Station
Weather Station

Parts List
A) Soil Moisture Sensor
B) Battery Pack (I use 3xAA batteries)
C) DHT22 Temperature and Humidity Sensor
D) BMP180 Barometric Pressure Sensor
E) APC220 Wireless Module
F) Bare Bones Arduino (Atmel 328P Microcontroller)

On my home PC, I have a client application that listens for the broadcasts from the weather station.  When a reading is received, it makes a web service call to upload the weather readings to a server I have hosted on Amazon EC2.

The biggest challenge I encountered was power consumption. My first revision consumed 60 mA, and drained 8 AA Alkaline batteries in a little over a day.  I have since been able to reduce the average power consumption to about 1 mA, and have been running on 3 AA batteries for quite some time.

To achieve this, first, I incorporated the Narcoleptic sleep library for the Arduino, and sampled the temperature once every 15 minute, which saved about 12 mA.  Turning off the the wireless module when not in use saved about 8 mA.  The voltage regulator I was using to reduce my 12 V battery pack to 5V consumed 14 mA – simply moving to 3 AA batteries allowed me to eliminate it.  The final savings came from moving the circuit from an Arduino Nano clone to a bare-bones Arduino, which eliminated the draw from the Nano’s LEDs, voltage regulator, and USB-to-serial converter.

From my website, I can then view the readings and compare my readings with those from Yahoo Weather.

Weather Station Site
Weather Station Site

Check it out at  It is currently reporting the weather readings from my North York balcony.

Complete source code and build details:

Update – November 6, 2016: Moved parts from breadboard to prototype board

2015 Balcony Crop

Which cob is suitable for my 100 meter diet?
Which cob is suitable for my 10 meter diet? Which one is from the store?

Our 2015 balcony crop is coming in.

  • Our strawberry plants have yielded a couple of mediocre berries every day
  • The verdict is out on our first broccoli plants. They do not resemble what we get from the grocery store
  • Cherry tomato yields are good (production is exceeding consumption)
  • Carrots are tasty, but small
  • All flowers are beautiful
  • Pole beans are excellent
  • Chives are excellent
  • We added a third pot of sweet corn. In spite of our late start, it looks like yields have increased and quality is good.

James Bond enters Public Domain in Canada – for now

I stumbled on an interesting article, Copyright quirk leaves James Bond up for grabs in Canada, in the Globe and Mail the other day.  In Canada, copyright expires 50 years after an author’s death.  Ian Fleming died in 1964, which means his James Bond series of novels have become a part of the public domain in Canada.

However, this might be short lived. Michael Geist, a Canadian academic specializing in intellectual property and technology law issues, writes that Canada will likely accept extending copyright to life plus 70 years in the Trans-Pacific Partnership (TPP) Free Trade negotiations.  It has been life plus 70 years in the United States since 1998.

Copyright is granted to allow content creators to receive compensation for their work, providing an incentive to create original work.  Many (myself included) would argue that 50 years of protection is ample – if I died tomorrow, my children, and their children, would directly benefit from any royalties collected from my work though my estate.

At some point, society receives a greater benefit from having the work enter the public domain, where anyone can read and re-print the text, and re-use the characters and story lines.  I, for one, have enjoyed the BBC’s contemporary take on Sherlock Holmes, made possible by the characters in the public domain.

In Canada, one can now create their own modern take on the James Bond character and novels, without getting permission or paying royalties to the rights holders (note that this does not include the movies).

The Bond books themselves can now be redistributed freely in Canada. Project Gutenberg is an organization that digitizes and distributes public domain texts – the works of Mark Twain, Jane Austen, and Sir Arther Conan Doyle are all available.  The Canadian branch of the site,, has already taken advantage of our life+50 copyright and posted a copy of Ian Fleming’s Goldfinger.

A part of me wants to buy Fleming’s books, scan them, and post them on a Canadian web site while I still can – unfortunately, this site is hosted in the US, so you won’t see them here.

Response to Toy Subway Car

My toy subway car has generated some local interest!

Check out:

Designing a toy subway car

After learning OpenSCAD basics in a previous project,  I set out to build a toy Toronto TTC subway car for Brio-compatible wooden train tracks.

I stumbled on a simple drawing of the TTC H6, and started tracing the simple features in Inkscape, exporting the shapes to OpenSCAD, and adding depth to the design.  For more information about the TTC H6, visit the Canadian Public Transportation Board’s page.

I found a design for a Diesel engine on Thingiverse by Nick Randall – I decided that his trucks and wheels would make an excellent base for my train, as he had a tested design with the right dimensions.

TTC H6 Subway Car for Wood Tracks
My TTC H6 Subway Car for Wood Tracks

The Toronto Public Library has a 2 hour limit on 3D print jobs.  To work within this limitation, I printed the design at low resolution over three sessions.  The body was printed in two sessions, and glued together with Krazy Glue (cyanoacrylate).  In one of the sessions, a different filament was used.  The final toy was painted and assembled with screws.

I learned a few more things about 3D printing, design in general, and  sharing online.

  • Parts printed with PLA material can be glued together with Krazy Glue
  • In this instance, there is a visible gap.  The parts were printed with different filament, and as a result, the parts didn’t align exactly.  The output from one of the print jobs warped.  When laid flat, the middle was probably 2 to 3 mm above the surface
  • As would be expected, detail is lost when printing at low resolution
  • When designing a model for printing on 3D printers, the limitation of not being able to print in mid-air must be considered.  Although printing with supports is a solution, it leaves a less-than-perfect surface.  It would be interesting to learn how more experienced designers work around this issue.  It would also be interesting to try a 3D printer capable of using a dissolvable support filament.
  • A model printed with PLA can be painted with Testor’s Enamel

The library is a great place to learn about 3D printing, and print small parts.  It is less expensive than other places – a two hour print job costs about $6.  For my next project, however, I would probably look at other alternatives without these limitations.  I think the library has probably achieved a good compromise, making a technology available to anyone with interest to learn and a library card, but definitely not offering a service which would compete with commercial offerings.

When I thought about 3D printing, I though about the physical realization of an object.  In reality, there are many things that must be considered when designing anything physical, and 3D printing is not the solution to all of them.  This is evident even in the simplest of designs, such as this one, where metal screws are used to fasten parts and enable movement.

This model was designed to scale – this might be appropriate for a scale model, but the train looks very long relative to the other wooden trains on the track.  Many of the features, such as the lights, windows, and doors, are very small.  If I were to design another toy train, I would exaggerate features, and would not design to scale.  George’s Trains, a local model rail hobby store, apparently stocks a wooden subway train that follows these principles and appears to be a much better toy.

Finally, it has been fun posting and sharing my designs on Thingiverse.  Although I have accounts on other sites with social-network type features, this is the first time I’ve posted anything.  It is fun to have an forum to share my work, and it’s great feeling to see that people have looked at my design and clicked “like” – recognition for someone having fun with basic skills, practising a hobby.

This subway car can be downloaded from or Thingiverse.