diff options
Diffstat (limited to 'docs')
20 files changed, 363 insertions, 0 deletions
diff --git a/docs/projects/byseekel.md b/docs/projects/byseekel.md new file mode 100644 index 0000000..580013a --- /dev/null +++ b/docs/projects/byseekel.md @@ -0,0 +1,356 @@ +# Byseekel + +2023-07-04 + +## Foreword + +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. + +![A pair of PCB-form blinkers in a plastic bottle, mounted at the rear of +a bike. One of them is blinking.](img/byseekel/bikeblinkers.jpg) + +▲ 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. + +![Two perfboards with messy wiring](img/byseekel/rev0_back.jpg) + +▲ I don't know why I needed three voltage boosters. + +🎖️ Achievement made: spaghetti wires + +![Same two perfboards, front side up](img/byseekel/rev0.jpg) + +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. + +![PCB with a freshly soldered chip](img/byseekel/rev1.jpg) + +▲ 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. + +![Soldered and wired PCB](img/byseekel/rev2.jpg) + +Also, in Rev 1 I forgot I needed a receptacle for the Ethernet cable. So +I put that in Rev 2. + +![Rendering of a PCB with a breakout board](img/byseekel/rev2_jdb.png) + +▲ 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.__ + +## Rev 3 + +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. +Solution: I2C. + +Let's begin by introducing designs I didn't throw away. + +### Controller board + +I intentionally made it credit-card sized. This was in March 2022. + +![Front and back of PCB](img/byseekel/rev3.jpg) + +### Stalks + +![A pair of stalks. One has exposed leads](img/byseekel/stalks.jpg) + +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. + +### LED strips + +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. + +![The end of an unsoldered LED strip](img/byseekel/led_strip.jpg) + +▲ Then I sealed it in transparent heat shrink tube for waterproof. + +### Radio module + +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) + +### Buzzer + +It's just a piezo with two LEDs. It beeps when you give it 12V. + +![Anatomical view of buzzer](img/byseekel/buzzer.jpg) + +### Ethernet cable + +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. + +## Failed designs + +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. + +![Line sketch of two boards. Stemming from controller board: power bank, +blinkers, braking lights, buzzer, reed. In between: ethernet cable. +Control panel board: ctrl, stalk, LCD, brake](img/byseekel/feature_creep.png) + +In the end, they grew so complicated I had to throw them away. + +![braking lights, reed, ctrl, LCD, brake and the control panel are crossed +out](img/byseekel/feature_creep_removal.png) + +### 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. + +### LCD + +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](https://github.com/Sovichea/avr-i2c-library)). + +🎖️ 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. + +### Control panel + +One of the ideas that seem good on paper. + +![CAD rendering. A stack of boards with parts sandwiched +in.](img/byseekel/panel_freecad.png) + +▲ 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. + +![Laser cut contours](img/byseekel/panel_laser.png) + +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. + +![Acrylic with severely burnt edges](img/byseekel/panel_burnt.jpg) + +### Ctrl button + +The ctrl button was supposed to switch the HUD when pressed and enter +sleep mode when held. + +### Brake + +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. + +![](img/byseekel/brakes_idea.png) + +## 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. + +![Left: a badly drilled hole on the box. Right: buzzer inserted to said +hole.](img/byseekel/buzzer_drill.jpg) + +▲ I didn't have a suitable grinder, so I just drilled around until the +small holes formed a big hole. + +![Left: the box put vertically in the basket; blinkers taped to basket +rim. Right: Stalk taped to handlebar.](img/byseekel/basket_mount.jpg) + +▲ This made the bicycle difficult to steer, so later I moved the box to +the back. + +## Byseekel, now + +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. + +Except: + +- better stalk +- better wiring +- powered by MCU +- marquee +- FindMyBike™ +- 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. + +## Conclusion + +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](https://codeberg.org/fkfd/byseekel). diff --git a/docs/projects/img/byseekel/basket_mount.jpg b/docs/projects/img/byseekel/basket_mount.jpg Binary files differnew file mode 100644 index 0000000..8e53473 --- /dev/null +++ b/docs/projects/img/byseekel/basket_mount.jpg diff --git a/docs/projects/img/byseekel/bikeblinkers.jpg b/docs/projects/img/byseekel/bikeblinkers.jpg Binary files differnew file mode 100644 index 0000000..c33cec8 --- /dev/null +++ b/docs/projects/img/byseekel/bikeblinkers.jpg diff --git a/docs/projects/img/byseekel/brakes_idea.png b/docs/projects/img/byseekel/brakes_idea.png Binary files differnew file mode 100644 index 0000000..3601f9b --- /dev/null +++ b/docs/projects/img/byseekel/brakes_idea.png diff --git a/docs/projects/img/byseekel/buzzer.jpg b/docs/projects/img/byseekel/buzzer.jpg Binary files differnew file mode 100644 index 0000000..9324228 --- /dev/null +++ b/docs/projects/img/byseekel/buzzer.jpg diff --git a/docs/projects/img/byseekel/buzzer_drill.jpg b/docs/projects/img/byseekel/buzzer_drill.jpg Binary files differnew file mode 100644 index 0000000..1e6e33c --- /dev/null +++ b/docs/projects/img/byseekel/buzzer_drill.jpg diff --git a/docs/projects/img/byseekel/feature_creep.png b/docs/projects/img/byseekel/feature_creep.png Binary files differnew file mode 100644 index 0000000..45c0597 --- /dev/null +++ b/docs/projects/img/byseekel/feature_creep.png diff --git a/docs/projects/img/byseekel/feature_creep_removal.png b/docs/projects/img/byseekel/feature_creep_removal.png Binary files differnew file mode 100644 index 0000000..d82cc59 --- /dev/null +++ b/docs/projects/img/byseekel/feature_creep_removal.png diff --git a/docs/projects/img/byseekel/led_strip.jpg b/docs/projects/img/byseekel/led_strip.jpg Binary files differnew file mode 100644 index 0000000..1614649 --- /dev/null +++ b/docs/projects/img/byseekel/led_strip.jpg diff --git a/docs/projects/img/byseekel/panel_burnt.jpg b/docs/projects/img/byseekel/panel_burnt.jpg Binary files differnew file mode 100644 index 0000000..bb6d6fc --- /dev/null +++ b/docs/projects/img/byseekel/panel_burnt.jpg diff --git a/docs/projects/img/byseekel/panel_freecad.png b/docs/projects/img/byseekel/panel_freecad.png Binary files differnew file mode 100644 index 0000000..f7c824b --- /dev/null +++ b/docs/projects/img/byseekel/panel_freecad.png diff --git a/docs/projects/img/byseekel/panel_laser.png b/docs/projects/img/byseekel/panel_laser.png Binary files differnew file mode 100644 index 0000000..cb8211e --- /dev/null +++ b/docs/projects/img/byseekel/panel_laser.png diff --git a/docs/projects/img/byseekel/rev0.jpg b/docs/projects/img/byseekel/rev0.jpg Binary files differnew file mode 100644 index 0000000..5027962 --- /dev/null +++ b/docs/projects/img/byseekel/rev0.jpg diff --git a/docs/projects/img/byseekel/rev0_back.jpg b/docs/projects/img/byseekel/rev0_back.jpg Binary files differnew file mode 100644 index 0000000..a3458a8 --- /dev/null +++ b/docs/projects/img/byseekel/rev0_back.jpg diff --git a/docs/projects/img/byseekel/rev1.jpg b/docs/projects/img/byseekel/rev1.jpg Binary files differnew file mode 100644 index 0000000..1b3731b --- /dev/null +++ b/docs/projects/img/byseekel/rev1.jpg diff --git a/docs/projects/img/byseekel/rev2.jpg b/docs/projects/img/byseekel/rev2.jpg Binary files differnew file mode 100644 index 0000000..7850ec4 --- /dev/null +++ b/docs/projects/img/byseekel/rev2.jpg diff --git a/docs/projects/img/byseekel/rev2_jdb.png b/docs/projects/img/byseekel/rev2_jdb.png Binary files differnew file mode 100644 index 0000000..0f51367 --- /dev/null +++ b/docs/projects/img/byseekel/rev2_jdb.png diff --git a/docs/projects/img/byseekel/rev3.jpg b/docs/projects/img/byseekel/rev3.jpg Binary files differnew file mode 100644 index 0000000..0ff6e72 --- /dev/null +++ b/docs/projects/img/byseekel/rev3.jpg diff --git a/docs/projects/img/byseekel/stalks.jpg b/docs/projects/img/byseekel/stalks.jpg Binary files differnew file mode 100644 index 0000000..658a253 --- /dev/null +++ b/docs/projects/img/byseekel/stalks.jpg diff --git a/docs/projects/index.md b/docs/projects/index.md index a252b90..1b34bda 100644 --- a/docs/projects/index.md +++ b/docs/projects/index.md @@ -8,6 +8,13 @@ MkDocs). But the few that do, are here. Projects below are sorted reverse chronologically (most recent first). +## [Byseekel](byseekel) + +![Both sides of a soldered PCB](img/byseekel/rev3.jpg) + +Sequel to [Bikeblinkers](#bikeblinkers), and a cautionary tale of why you +shouldn't overcomplicate your project. + ## [Reflow Workshop: A Journal](reflow-workshop) ![Two PCBs with a cat printed on the silkscreen](img/reflow-workshop/kliments_vs_mine.jpg) |