This blogpost will be a disappointment. A recollection of wasted efforts, a mausoleum of failed designs, a journal of regrettable choices, and a maker's acceptance of defeat.
Oh, and it won't be proofread.
Last year, I began building a draft of this blogpost, but never finished nor published. It was timestamped 2022-05-03. I wish I could write this one in the same cheerful tone, but I can't.
The project started in December 2021. It was finished in July 2023. A rational question to ask is:
What the fuck happened??
Bikeblinkers: a recap¶
In September 2021 I broke my wrist in a cycling accident. It gave me an irrational obsession for cycling safety. So I designed this.
▲ This is the only photo I have.
It's basically just a 555 timer in astable mode. Two design errors were made:
- The switch is on the path to the LEDs, not the 555, so the chip is always consuming power
- The transistors are in common-collector mode, so they aren't bright enough
I was not satisfied.
Byseekel rev 0, 1, and 2¶
December 2021, I went back home with all the Bikeblinker stuff. Finally I had time to make something better.
I wanted a whole bunch more features, including
- speedometer and odometer, using reed switch and wheel-mounted magnet
- hazard light
- braking indicator
- remote-activated buzzer
- an LCD display
At that point, every one of these seemed possible. I smugly named the project "Byseekel" because that's how I hear Freddie sing "Bicycle race".
Rev 0 is on perfboard. I don't even remember how painful it was to solder. Nevertheless, it worked. Photo on 2022-01-01.
▲ I don't know why I needed three voltage boosters.
🎖️ Achievement made: spaghetti wires
I used two microcontrollers (MCUs), because I didn't know how to reliably switch in and out of sleep mode. The smaller one is an ATmega ATtiny13A
The LCD was intended to go on the handlebar. It was driven with a 4-bit parallel interface. I wrote the driver myself with the datasheet, so I was very proud. (It was very glitchy, though)
🎖️ Achievement made: First LCD driver
Starting from Rev 1, I gave in and just made PCBs. This one's taken 2023-01-12.
▲ I was proud of being able to solder SMT, but it wasn't a good idea.
🎖️ Achievement made: First functioning SMT chip
This board is basically just a single chip and many connectors and jumpers. These include
- J1: barrel jack, but instead of 9 or 12, it's 5 volts
- J2: SPI, to flash firmware into the chip
- J3: an Ethernet port because I need exactly 8 wires (genius moment)
- J4: screw connectors
- J5: controls array of 4 relays to turn blinkers on and off
- JP1: a jumper to disable the relays before programming, because they share wires, and if I don't pull it out the relay goes "click clack" nonstop
- J6: I thought it'd be cool if I had a few "hackable" pins for future use
- U2: radio receiver unit
But I fucked up. It's impossible to install U2 and J3 at the same time, because U2 is wider than printed on the PCB. I had completely forgotten.
Fixed in Rev 2. The only photo, 2023-01-18.
Also, in Rev 1 I forgot I needed a receptacle for the Ethernet cable. So I put that in Rev 2.
▲ I didn't use mousebites so JDB did not charge me extra. I used a handsaw to break them apart. Would not do again.
The main problem with Rev 0 to 2 is the relay. Though they make a satisfying noise, they are way too power hungry for a battery powered device.
I was not satisfied.
There are too many flaws with Rev 2. I decided to revamp the design completely.
Problem: The relay is too power hungry.
Solution: Use transistors.
Problem: I can no longer afford more SMT MCUs.
Solution: Use DIP.
Problem: I want a marquee-style blinker.
Solution: 5 outputs instead of 2.
Problem: 4-bit parallel interface is unstable and wastes wires.
Let's begin by introducing designs I didn't throw away.
I intentionally made it credit-card sized. This was in March 2022.
Blinker stalks for electric motorbikes. They're very cheap. You just pull the lever to the left or right, or both to get hazard lights. Press down to reset.
Planned red for brakes also, but now only yellow for blinkers. Scraped off some epoxy and soldered wires to the common anode and five cathodes. The voltage booster converts 5V to 12V.
▲ Then I sealed it in transparent heat shrink tube for waterproof.
433MHz OOK radio receiver, controlled with a garage door remote. Can store and respond to four keys. Currently assigned three to:
- Lock (beep-beep, goes to sleep mode)
- FindMyBike™ (long beep)
- FindMyBike™ Silent Mode (flash blinkers)
It's just a piezo with two LEDs. It beeps when you give it 12V.
In my original design I needed a bundle of eight wires that runs the entire length of my bike. An ethernet cable is a bundle of eight wires. Genius idea.
Now that I only need three, it's still a genius idea because it's cheap and so much easier to organize than three speaker wires.
Now, we'll move on to designs that failed.
Don't ask a Shanghainese what happened in 2022.
Anyway, I stayed at home from March to June, without access to my bicycle or stuff like oscilloscopes. So many ideas worked on my workbench, but couldn't be tested.
In the end, they grew so complicated I had to throw them away.
Speedometer & odometer¶
My uni has a required 80km of jogging per semester, tracked by GPS to ensure you're neither too fast or too slow. We cheat it by cycling. Based on my knowledge, I can stick a magnet to the spoke of the wheel, and mount a reed switch somewhere so each time the magnet passes, we know the wheel made one turn.
Problem is, it was winter break, and my bike wasn't home. So to test the mechanism, I just held the magnet in my hand and went "whoosh whoosh whoosh".
Did it work? On paper, yes. In practice? Probably not.
Then why did I attempt anyway? Perhaps it's because I hate jogging so much. My superinflated maker ego was like, "Company xxx made this so I must also be able to." Wrong. There are limits as to what one person can do at home, even if it "sounds possible".
Right now, 80km is no longer a requirement for me, so I just dropped the idea, along with the LCD and control panel.
It's a pity I cut it out. It almost worked.
The LCD would serve as a HUD for:
- speed in km/h and min/km
- trip and total mileage (stored in EEPROM)
- status of blinkers, brake, and hazard light
I bought an I2C-to-4-bit adaptor board, and rewrote my driver (based on Sovichea Tep's TWI driver).
🎖️ Achievement made: First I2C LCD driver
The LCD was less glitchy than in parallel mode. In parallel, when the GPIO switched, the voltage overshot before it damped down. Thanks to Kliment, I learned this was called ringing. But the dedicated circuitry for I2C damps harder, so there's less of this problem.
Less, not none though.
One of the ideas that seem good on paper.
▲ Made with FreeCAD.
Sometimes, you just feel too confident. You think you're a god. You think you can do anything, including mechanical engineering.
The intention is to laser cut eight pieces of acrylic, and bolt them together. All seemed perfect.
In November 2022 I tried to cut them. But the laser cutter didn't like the dxf exported from FreeCAD via Inkscape. Each edge was not one line but two, so the laser head went over each edge twice. RIP acrylic.
The ctrl button was supposed to switch the HUD when pressed and enter sleep mode when held.
The brake detection is the single least realistic design I've ever come up with. I can't believe how I let it pass. I won't waste time trying to explain it again. Here's a figure I drew last year. Go figure.
Dormant state and revival¶
I did practically nothing for the project between October 2022 to March 2023, because DON'T ASK A SHANGHAINESE WHAT HAPPENED IN 2022. Anyway, in April 2023 I found myself motivated once again, partly because there's a new hackerspace.
I got this box in 2022. Now I'm finally doing things to it. Horrible, horrible things.
▲ I didn't have a suitable grinder, so I just drilled around until the small holes formed a big hole.
▲ This made the bicycle difficult to steer, so later I moved the box to the back.
What does Byseekel look like, now that I killed every feature I wasn't ready for?
We've gone full circle.
Bikeblinkers was blinkers you controlled with a stalk. Right now, Byseekel is essentially the same thing.
- better stalk
- better wiring
- powered by MCU
- IP-somewhat waterproof
Note that, although there's an ATmega328P, after all the features I killed it's essentially the same as your typical Arduino code.
When I have photos and videos, I will post them here.
▲ It's mounted with tape, and when it rained, I just cover the box with a plastic bag. Am I an engineer now?
So far I've easily rode it around for more than 50 km. The tape seems to be holding it together pretty well, even on bumpy roads. The box has been exposed to hours of direct sunlight in 38C weather and rain that made the campus quite literally a water park and the lithium battery hasn't exploded or caught fire. This is all I ever wanted.
MPEG-4 Video (4.6 MiB)
Whose fault is it that Byseekel wasn't finished until now?
- It is my fault that I overcomplicated the project
- It is not my fault that I was locked home for half a year
I am now speaking to future self.
Do you want to add a "useful feature" to a project? You gotta get the project working without it first. A new batch of PCBs cost 30 RMB. That's cheaper than hours of time you'd waste otherwise. Don't sit on your computer, working your ass to make your CAD model "perfect". You can't know what's perfect if you never test it.
If I had another chance, I'd kill the brake and reed ideas. The LCD taught me to write I2C drivers, and to write AVR C with interrupts; I'd give it a pass.
Always remember, do one thing and do it well.
The KiCad and AVR C files for Byseekel and Bikeblinkers are on Codeberg.