Home automation for the masses, not the classes
We need to build computers for the masses, not the classes – Jack Tramiel, Commodore founder
- A: Commodore 64 computer running the “Commodore Home” application
- B: UniJoystiCle WiFi device connected to the joystick ports
- C: Alarm sensor using a WiFi device
- D: Smartphone running the UniJoystiCle Controller app with the Commodore Home plugin
- E: Commodore MPS 803 printer
- F: Pulleys + gears connected to the printer header + dimmer knot
Why pay hundreds of dollars to automate your home, when you can automate it for free with existing tools/computers that you might already have in your garage?
Automate your home using a smartphone, a Commodore 64 and a dot matrix printer!
- Music player
- Smart light system
- Alarm system
It comes preloaded with classics from the 80’s, like Billie Jean, The Final Countdown and Pop Goes the World. Listen to the unmatched chiptune sound. Control the music player from your smartphone!
Smart Light System
Don’t pay hundreds of dollars to have “smart” light bulbs. Instead, control them with your dot matrix printer! Attach a few pulleys and gears to your printer header, and control the lights and dimmers from your smartphone!
It is possible to control more than one light by daisy chaining the printers! How handy!
Know when an authorized person enters your home. A siren sound + a blinking “Intruder Alert” screen will be displayed on the C64.
Future versions will have modem support: When an intruder is detected, it will dial your favorite BBS and leave you a message there. How handy!
Building the Commodore Home
The UniJoystiCle WiFi device
Commodore Home uses the UniJoystiCle technology to communicate with the C64. It is a device that allows you to control the two joysticks from your smartphone.
The alarm system
It consists of a magnetic sensor + WiFi device. When the sensor is open, the WiFi device will send the “trigger alarm” command to the C64.
Bill of Materials:
- Wemos D1 Mini v2 ($4.00)
- Wemos Proto Shield for D1 Mini ($0.99)
- Wemos Battery Shield for D1 Mini ($2.50)
- Warning: it comes with an XH2.54 connector. You might need an adaptor
- Warning: check the polarity!
- Magnetic Sensor ($1.89)
- v3.7 LiPo Battery
Connect “A0” (analog input) to the NC (Normally Closed) magnetic pin. And connect “v3.3” to the Com magnetic pin.
And then upload the firmware to the device:
- Download Platform.io
- Install the CH340 USB-to-serial driver
- Clone the Commodore Home project:
- And build and upload:
$ cd alarm_firmware $ make upload
(pre-compiled firmware coming soon. done: see below).
The Alarm WiFi will boot in Access Point mode. Connect to its WiFi network (it is called “commodore home alarm”) and open this URL:
Then configure the network parameters:
- Put it in Station mode
- Put the correct SSID and password
- Put the UniJoystiCle IP address
…and done. The alarm system is ready to go!
The Commodore 64 application
The latest binary version can be downloaded from here:
The source code is here: https://github.com/ricardoquesada/c64-home
If you don’t have a UniJoystiCle WiFi device, it can be controlled with the keyboard. Just DO NOT use it with a joystick in port #2.
If there is an error with the printer (like printer not connected), it will change the border color.
The Smartphone application
The Android application can be download from Google Play:
The Source code is here: https://github.com/ricardoquesada/unijoysticle
The iOS and Desktop UniJoystiCle applications don’t have the “Commodore Home” plugin yet (coming soon. done: see below).
Connecting the printer
Just connect the printer as device “4” (not “5”). Insert a piece of paper (doesn’t work without one), and connect the gears to the printer header.
It was tested with the MPS 803 printer and it works Ok. But it doesn’t work with the Okimate 10 printer since it places the printer header back to the left after each command. So, use the MPS 803.
Things that I did for the Retrochallenge
- C64 application (Assembly). Mostly a copy & paste from projects that I worked on before:
- Reused the music player from chipdisk
- Reused menu system from The Uni Games
- Reused “UniJoystiCle Compatible” intro screen from The Uni Games
- I knew how to move the printer header using the BASIC “print#” command. But I had to do some research to move it using assembly.
- Used VChar64 to design the screens/fonts.
- I didn’t compose the songs. I grabbed them from HVSC.
- Android application (Java)
- Wrote the “Commodore Home” UniJoystiCle plugin. It replaced the old “Linear mode” plugin.
- Firmware for the Alarm system (C):
- It was mostly a copy & paste from the UniJoystiCle firmware that I did before.
- Alarm design:
- Quick and dirty design: using the A0 (analog pin) from the ESP8266.
- UniJoystiCle Desktop application (C++):
- I was able to have a working prototype using the “linear mode” but in the end I haven’t used it. I’ll continue working on it later. It will be useful for UniJoystiCle users.
- UniJoystiCle PCB v0.4.1 (Eagle):
- Designed v0.4.1 during the Retro Challenge, but I received the PCBs only two days before the deadline. So, for Commodore Home I used the previous version (v0.4.0).
- Pulley / Gear system:
- I was able to move the dimmer knot with pulleys+gears. Only by moving the gears manually.
- I didn’t have the time to attach the toothed bar to the printer header.
This was my first participation in the Retro Challenge competition. Overall, I’m happy with the outcome: I was able to finish most of the stuff that I wanted to do, but I’m exhausted. A few things to improve:
- Decide what to do from day 1. I started building the C64 I.D.IoT.R project, but ended doing the Commodore Home, a more challenging project. I built the “desktop client” for the C64 I.Di.IoT.R (took me like a week) and in the end I didn’t use it.
- Manage my time better. Don’t work until late. I wake up at 6:00 / 7:00am no matter what.
Things that I would like to do in the near future:
- UniJoystiCle iOS client: Add Commodore Home plugin (done: see below)
- UniJoystiCle Desktop client: finish it and add Commodore Home plugin (done: see below)
- iOS/Android/Desktop client: Add voice support for the smartphone. You should be able to control the C64 by saying “Hey Commodore, activate the alarm”.
- C64 app: Add sound support for NTSC/PAL-N. Right now it only sounds Ok on PAL-B.
- C64 app: Add modem support: when the alarm is triggered, it dials a BBS or something.
- Create a video mocking Google Home, Amazon Echo and other home automation products.
- Add support for unlocking/locking doors with the printer.
iOS, Mac and Win32 UniJoystiCle clients with Commodore Home support & the precompiled version of the Commodore Home firmware are available here: http://ricardoquesada.github.io/unijoysticle/