This repository contains the 3d-printable models for OpenBikeSensor enclosures.
Project Website | Model selection (German) | 3D printing instructions (German)
If you encounter any problems or have feature requests, please open an issue on GitHub. If you need assistance related to the contents of this repository, please ask in the project forums.
If you want to build your own case using openscad instead of using the readymade exports or if you want to start the customizer be aware that you need to clone including git submodules:
git clone --recursive https://github.com/openbikesensor/OpenBikeSensor3DPrintableCase
# ... or if you forgot the --recursive argument, you can run this in the
# repository's directory later:
git submodule update --init --recursive
We expect a recent version of OpenSCAD, for development we currently use OpenSCAD 2021.
This repository contains a lot of files for different options
- The
export/
folder contains the latest prebuilt.stl
files for 3D printing. You can use those unless you want to make customizations. If you contribute changes to the models, you can refresh the models you changed using themake export-all
command. If youropenscad
binary does not reside in/usr/bin/openscad
you can specify its location by overriding theOPENSCAD
variable like so (substitute your specific openscad path):make -j OPENSCAD=/Applications/OpenSCAD.app/Contents/MacOS/OpenSCAD
- The
legacy/
folder contains old versions of the case, including lots of variants that were created but unmaintained. These were built with proprietary software packages and often available in their native format(s) and therefore mostly uneditable for most of the community. A lot of these files are also available in STEP format, and of course exported as STL for printing. We keep these files around for reference and convenience. - The
lib/
folder contains common OpenSCAD files with library functions and modules, as well as exports of other objects that can be imported in the part files, e.g. to check dimensions. - The
src/
folder contains OpenSCAD scripts for all parts. Not all parts are needed for printing a working enclosure. Please check the documentation (links on top) to assemble your custom list of parts for the variant you want to build. - The
render/thumbnails/
folder contains rendered views of the parts. These images should be refreshed with changes to the parts using themake thumbnails
command if you plan to submit your changes. They are used in thisREADME.md
. - The
variables.scad
file contains all variables used in any of the parts. You can customize everything by editing this file, or passing new variable values on the OpenSCAD command line.
There is a notion in the OpenBikeSensor community to label one combination of parts and a certain version of the electronics the "Standard Model" (read about it here). This is meant to get you started, without having to check for compatibility and without cross referencing multiple parts of the documentation to build your own version of the device.
Warning We only keep the rail shapes constant between versions. When printing make sure that your
MainCase
andMainCaseLid
come from the same release. The same is true forDisplayCase
Top and Bottom. The Idea is that OpenBikeSensors can be mounted on a different bike with older version mounts, but the current version lid won't necessarily fit onto last years case.
To get a standard variant, print these parts:
MainCase/GpsAntennaLid
MainCase/MainCase
MainCase/UsbCover
MainCase/MainCaseLid
DisplayCase/DisplayCableStrainRelief (2x)
DisplayCase/DisplayCaseBottom
DisplayCase/DisplayCaseTop
Mounting/StandardMountAdapter
Mounting/SeatPostMount
Mounting/LockingPin
Mounting/HandlebarRail
The parts are compatible with the OpenBikeSensor PCB Version 00.03.12
. Other
versions, both older and newer, might work, but are untested.
This is a list of all available parts, and a description of what they are used for.
The main case of the device enclosure. This will contain most of the
electronics. The core part are a MainCase
and a MainCaseLid
, which is
installed with five M3x8 bolts in the lid, matching the five threaded heatset
inserts in the body.
The PCB is installed into the main body with 3 heat-set inserts and M3x8 bolts.
One additional heat-set insert is required for the GPSAntennaLid
(see below).
This totals 9 inserts to be placed after printing.
The GpsAntennaLid
covers the part of the main enclosure with the GPS antenna.
It is held in place by only one M3x8 bolt and can be removed to reveal the
antenna, behind which there is an access hole for the Micro-USB receptable of
the ESP32 dev board -- very useful for debugging or developing the firmware.
The UsbCover
is small plug for the USB-C port on the bottom of the device,
which is used for charging the battery. This plug is held in place by 2 pairs
of 3x3x3mm neodymium magnets.
The display case consists of two halfs, DisplayCaseTop
and
DisplayCaseBottom
. The display case contains the I2C display and a push
button and is attached to the main device with a cable that exits through a
hole in the bottom part.
The bottom part contains 3 threaded heat-set inserts and a pocket for two
20x10x1.9mm neodymium magnets. The magnets hold the display in the rail on the
handlebar (see HandlebarRail
).
Print two copies of this.
The DisplayCableStrainRelief
holds the display cable firmly in place inside
the display case to prevent strain on the solder joints or crimped connectors
inside. The two halves are pushed into the hole at an angle one after the
other, and then screwed together with two M3x8 bolts and hex nuts.
The StandardMountAdapter
is screwed onto the main enclosure. It contains a
channel for the display cable to sit in, pressing it firmly against the outer
wall of the main case and relieving any strain from its connector inside.
This adapter is used to attach the device to the mount that is permanently affixed to the bike. There may be different adapters in the future for different attachment needs, but this one is the default.
The SeatPostMount
gets attached to the seat post of the bicycle with zip ties.
Hint: A piece of an old bicycle tube can prevent it from turning or shifting.
This is a counterpart to the StandardMountAdapter
, which can slide onto this
part's rail and be held in place with a LockingPin
.
The TopTubeMount
gets attached to the top tube of the bicycle frame, similar
to the seat post mount.
Hint: A piece of an old bicycle tube can prevent it from turning or shifting.
This is also compatible with the StandardMountAdapter
and LockingPin
. Make
sure to use a "Top Rider" variant main case (see below for details).
Screw an M3x16 to M3x20 bolt through the LockingPin
part, such that the
bolt's head sits on the long handle's side. Now you have a pin that you can
push into the hole in the StandardMountAdapter
and turn 180 degrees, holding
the pin, and the device, in place.
Attach the HandlebarRail
to the handlebar of your bike with two zip ties or a single
hose clamp. Again, a piece from an old bicycle tube can prevent turning and shifting.
The large wall contains a pocket for two 20x10x1.9mm neodymium magnets, pushed in one after the other. Make sure to consider their polarity to match those of the display. The display can now slide onto this rail and is held in place by the magnets.
An alternative Handlebar rail can be mounted like most bike computers with a rubber o ring;
Often you find magnets where one magnet is strong enough for your display - you can use a platic decoy to save on magnets in these cases
The bike rack mount can be used to attach a "Top Rider" main case to a standard
bicycle rack. It consists of two parts, the BikeRackMountSide
(which is
required twice) and BikeRackMountCenter
or BikeRackMountCenterLongitudinal
.
The side parts are mounted on the longitudinal rails of the rack, either above or hanging below. They are connected with two rods (aluminium or wood) that form cross beams, cut to sized depending on the width of the bike rack. In the center of these rods sits the center piece, which has the attachment rail for the sensor.
In a rotated version, the rods are aligned longitudinally, a difference center
piece (BikeRackMountCenterLongitudinal
, third image) is used to rotate the
OBS correctly. Use this if you need your bike rack's longitudinal tubes for
attaching cargo, and you want to mount the OBS on the cross beams of the rack.
The rods can be affixed to the 3D printed parts by gluing them in place, once they have been sized and fitted to your rack.
If you have a main case that has both attachment points (top rider and back
rider), you may want to cover the one of them that you are not using, such that
the screw holes and (optional) cable hole are not left open. The
AttachmentCover
is a simple cover that fits the screw pattern.
This adapter allows the use of a "back rider" main case on a "top rider" mount. Print a second locking pin as well.
There are tons of variables in the variables.scad
file, mostly dimensions,
which can be adjusted to suit your needs. Some of these variables are however
not necessarily wise to be changed, as other dimensions might inadvertently
depend on them, or they might produce invalid results in certain ranges.
However, some options are meant to be changed to suit your specific needs. The defaults get you most of the way, but certainly, some users will need a different set of features, so here is a list of options you might want to change:
Some options exist to control sizes and features that have been added just for 3D printing ease. Configure these to match your printing setup. The defaults should work for most printers, but if you modify your settings greatly (e. g. to print faster), you might also need to change these model parameters:
extrude_width
enable_easy_print
layer_height
default_clearance
A "top rider" variant main case has an attachment port on the bottom (when mounted), while a "back rider" has it on the front. The "traditional" OBS case therefore is a back rider variant, as it used to always sit behind the seat post, attached horizontally. However, many cyclists configure their bikes in a way that there is not enough room for a whole OBS below the seat, so a different way of attaching the OBS is needed.
Top riders can sit on the top tube, the luggage rack, or anywhere else where there is support from below. Moving the attachment point on the main case makes it simple to design compatible mounts with their rail on top, without a complicated structure that "goes up and around" to provide a backwards-facing rail.
A single case can have both top rider and back rider attachment ports. They don't necessarily need to have an adapter attached, though it is recommended to do so in order to fill the screw and cable holes.
To configure whether to generate top and/or back riders, set the following
variables. The _cable
variables control whether the corresponding attachment
port (if it exists) has a hole for the cable or not.
MainCase_back_rider
MainCase_top_rider
MainCase_back_rider_cable
MainCase_top_rider_cable
The Mounting/BackRiderTopRiderAdapter
is available for people who have a back
rider and would like to use a top rider mount. The opposite is not available.
- General
m3_screw_diameter_loose
: A hole for an M3 bolt has this diameter. The bolt is not meant to grab this hole, but slide into and out of it ("loose" fit). For (almost) each bolt, there is a corresponding threaded metal part (nut or insert), so increase this value if your bolts are hard to get where they need to go. PrintCalibration/ScrewHoles
to find a good value for your printer.m3_hex_nut_diameter
: The outer circle around a hex nut's hexagon has this diameter. This is not the same as the "wrench size" from DIN 934 (dimensionS
), but its nominal value is2 / sqrt(3) * S
. For M3, this equals6.35mm
nominally. Increase this for more clearance. PrintCalibration/HexNuts.stl
to find a good value for your printer.
SeatPostMount
SeatPostMount_angle
: Set to the angle that your seat post is away from the vertical in degrees (usually around 20). This ensures that the device will sit horizontally behind the seat post.SeatPostMount_diameter
: Set to the diameter of your seat post (in mm). The default for most bicycles today is 28.SeatPostMount_length
: Increase this to lengthen the mount, shifting the device further backwards on your bike. You might consider angular force, so don't set it too high, but this can help if your mount is hard to reach, or if the device disappears underneath your seat, potentially blocking GPS signal.
HandlebarRail
HandlebarRail_tube_radius
: The radius (half diameter) of your handlebar, in mm.
The Makefile
supports generating the case with different logos. For now, the
only parts that are customizable with logos are MainCase/MainCase
and
MainCase/MainCaseLid
. Please check the instructions in
logo/README.md
for creating your own logo version.
The files of legacy versions are available in the .stl
format for 3D
printing. But these are discretized versions of more universal 3D Geometry that
can be read and edited by CAD software.
This is a grown project and in the past contributions have been made with
different CAD Programs. Some parts were designed/modified in Autodesk inventor
(filenames *.ipt
), some were designed in Fusion360 (filenames *.f3d
), but
for most parts a step file (*.stp, *.step
) is available which can be opened
by most CAD Programs. For your contributions in CAD software of your choice it
would be great if you could also follow the practice of submitting your changes
in both .stl
for 3D-Printing and .step
for later editing - and maybe the
native format of your CAD software on top.
OpenSCAD is a special case of course: Here submitting .stl
(for now) and the
.scad
file is sufficient.
To run the customizer webservice you run it from the dockerfile (and be sure that you cloned the repo recursively before building the cointainer:
git submodule update --init --recursive
docker build . -t customizer
docker run --rm -p 8001:80 customizer
Whereafter you should be able to access your customizer on your host on port 8001.
Alternatively you can launch the python module directly using uvicorn, but that is only recommended for dev setups an d will be described in the module readme.