A New Spin on Old Wheels

My mountain bike has been sitting in the garage for more than two years. It hasn’t been ridden and it was in dire need of maintenance and repair. Its a big heavy bike that is exhausting to pedal around a hilly city. It was just taking up space.

With my recent change of jobs I significantly extended the distance of my commute. The routing for the buses are not convenient and its a little too far and hilly to bike normally. To get across lake Washington and make it tolerable the mountain bike was going to need a little help.

So I decided to add an electric motor.

Electric hub motor and battery system

I ordered a hub motor kit and battery from Ebay with the goal of converting the bike into an e-bike that will make it easier to go long distances and to chew up all the hills in the way. But ordering a lot of electronics parts from china means they don’t come with very clear instructions.

The old regular bike
Tools for the job

The bike is still mostly in working condition. There was just one small broken plastic ring in the handlebar headset that had been keeping it off the streets. Bike shop wasn’t sure it would be able to source the part and wanted to replace the entire headset.

A small piece of plastic, why not just 3D print it?

The broken piece (left) and the 3D printed replacement (right)

I didn’t print this piece myself. I outsourced it to a friend who could print it in high performance PETG plastic so the ring would be flexible and durable. It took a couple of tries to get the fit exactly right.

The new spacer fitting in nicely.
Testing the electrics

Before mounting 20 lbs of electronics to the bike I needed to test to make sure everything was working. I temporarily mounted the new front wheel without tube or tire and hooked it up to the pile of cables on the ground.

Glad to say everything was working properly.

In attaching all the electrics to the bike I did encounter one expected problem. As a safety feature, the brake leavers needed to be replaced with leavers that have integrated electric switches which will serve as emergency power cut offs for the motor, so it can never accelerate while the brake is down. This Trek bike has integrated brake leaver and gear sifters on the handlebars, so I can’t replace the brakes without losing control of my gears. So instead of mounting the new brake leavers I went with magnetic switches attached to existing brake system.

Wired up and ready for a test ride

There was still a lot more that needed to be done, but with everything critical bake in place and the electrics working I had to have it out for a test ride.

Glamour shot

The test ride was a success though a little wobbly. I found that there were a lot of things to tighten down and that the front tire was not sitting completely evenly.

The electronic cut off brakes were working, but I wasn’t happy with the physical brakes. Unfortunately this bike cannot fit disk brakes, but I replaced the old brake pads with new larger ones and tuned up the whole system.

An old bike lock, keys long lost, which needed to be cut from the frame
Cables are a rats nest but it works

There are still a lot of improvements I would like to make, integrated front and rear lights, better cable management and housing for the speed controller, a speedometer and control display, and maybe even a more conformable seat. Its serviceable as it is and I have all winter keep making improvements.

Ready to explore

The Horror

Recently I’ve been playing Arkham Horror the card game. It’s a living card game adaptation of the Arkham Horror board games with many mechanical improvements. One thing its share with its progenitor is that there are a lot of cards and pieces and it can become a confusing mess quite quickly.

blog-2018-08-21 22.45.55

The table after playing Curse of the Rougarou with the unpainted markers

One thing I do like about the Arkham Horror board game is the modular interlocking board pieces that become the setting of the game. Since all the card games has is cards each location becomes a card and instead of interlocking cardboard connectors there is complicated system of symbols on each location card noting which other locations its accessible from.

blog-DSC02056

Painted and weathered token next to an unaltered one

I was not the only one who found this confusing. Users on Thingiverse had uploaded 3D models of arrow tokens which can be used instead to show the connections between the locations. Firing up the 3D printer I printed out a batch. The tokens were very nice, but the flat plastic color didn’t fit the 1920 noir theme of the rest of the game. With a little gold and black paint that was also remedied.

blog-DSC02054.jpg

The markers in use

blog-DSC02057

A fleet of tokens waiting to be used

Link to the Location Connectors STL

Link to the play mat

T Minus and Counting

Today I leave for vacation. This is the first time I’ve left the continent in more than 5 years. One of the best parts of planning a big trip is building anticipation leading up to the date. I took this anticipation and used it to try out the APIs for Alexa’s Flash Briefing, something I check every morning for my news podcasts.

Its very much a hack. The Alexa flash briefing it not so much an API as it is an RRS feed that you can push daily updates to. I didn’t want to set up a full RSS service just for the few weeks leading up to the trip so with some help from other blog posts I managed to use AWS Lambda behind an API gateway endpoint to mock out a bare bones RRS feed server. One that just decrements a number every day.

from __future__ import print_function
import json
import datetime

def respond(err, res=None):
 return {
 'statusCode': '400' if err else '200',
 'body': json.dumps({
 "uid": "1234",
 "updateDate": datetime.datetime.utcnow().isoformat() + 'Z',
 "titleText": str(days_to_trip()) + " days to vacation",
 "mainText": err.message if err else res['message'],
 "redirectionUrl": "https://yoururl.com"
 }),
 'headers': {
 'Content-Type': 'application/json',
 },
}

def days_to_trip():
 trip = datetime.datetime(2018,8,30,0,0,0,0,datetime.timezone.utc)
 today = datetime.datetime.now(datetime.timezone.utc)
 return (trip-today).days + 1

def lambda_handler(event, context):
 rawdata = "there are " + str(days_to_trip()) + " days until your trip to europe"
 reply = { "message": rawdata,
 }
 return respond(None, reply)

The date is hard coded the python is sloppy. But it did what I wanted, telling me every morning how many days I had left until my trip, and I was able to get it together in a couple of hours.

Soon they will start boarding for my flight and the adventure will start, the count down has reached zero.