Some months have passed since the last update, but I have not been idle. I was contacted by PCBWay with an offer of producing a circuit board for the project, free of charge. A custom PCB had been on the roadmap for a while, but this offer gave the necessary push to get it finished.
Using KiCad 6, I designed a 6x6 cm, 2 layer PCB. It hosts the Arduino Connect RP2040 module, connections and power switches for accessories (1x MOSFET, 1x relay). I decided to experiment with connectors a bit, and opted for a combination of 2.54mm pitch screw terminals (smaller than you imagine!) and JST PH 2mm connectors.
PCBWay didn't let me down and within a week of submitting the design files, I had the boards in my hand. They came packed pretty well, sealed in bubble wrap and padded with a soft foam inside a small box.
It was not the first time I've had custom boards made, but the Christmas-y feeling of seeing your creation become real is still there. The boards had been made precisely with no visible quality issues.
Nevertheless, there was a problem. Taking some measurements, I discovered a short between the +3v3 and GND nets. On the PCBWay website it is possible to re-download the Gerber files used for manufacturing (I had used PCBWay's one-click export plugin, so I had not actually submitted these files myself)
And indeed, therein was the problem:
It is clear the ground polygon fill was not reflowed after the last movement of this capacitor. I was pretty sure that my DRC was clean at time of submitting the design, so I wanted to blame the export plugin. However, I was not able to reproduce the error when consciously trying, so I cannot say anything with certainty.
In any case, the problem was solved quite easily with a few strokes of a knife. I did not encounter any further issues during assembly or bring up, and soon enough the new board found its home in the 3D printed enclosure.
I have also re-done some of the internal wiring in a neater way. My only regret is not getting an orange wire to fit with the color scheme of the project!
After nearly 200 km with the initial version, the time has come for a redesign. The main control unit is now housed in a 3D-printed case. The Raspberry Pi Zero has been swapped for an Arduino RP2040 Connect. Same MCU, but can be powered directly from higher voltage (9 V at the moment, but a 2S Li-Po would work as well), and comes with some very interesting on-board peripherals. To facilitate experimentation and iteration, the internal electronics are mounted on a proto-board which has a grid of copper pads on the back side.
The OLED display is no longer inseparable from the wiring harness; it can now be disconnected to take everything apart more easily.
The wiring harness fans out into 3 branches: rear light, wheel speed sensor, OLED display.
It is clear from the picture that the new housing is rather oversized. This is not a mistake, but rather a "conservative approach". In the next phase of the project, I would like to design a custom PCB for the control unit, and shrink the enclosure accordingly.
In the initial prototype, the bare reed switch (its enclosure being made of glass!) was just taped to the frame next to where the magnet passes; fortunately there was not much rain or mud, since this 'solution' would have fallen apart pretty fast. The switch was soldered directly to the cable harness, with no possibility of disconnection. This is now history.
I am now using a factory-sealed sensor and I crimped an IP67-compliant connector to ease maintenance.
While the initial cardboard-box prototype has been quite a success, clearly for long-term reliability, waterproof enclosures and connections will be required. I have ordered samples of several connectors to evaluate their fitness for this project.
To connect the reed switch sensor, I decided to try out the EDAC 560. Rated IP67, this should provide more than sufficient protection from the environment -- assuming correct crimping. These are only available in a wire-to-wire variant, and they have a disadvantage: it is not really possible to apply strain relief for the individual wires near the connector.
The second sample is the Weipu SP13, a wire-to-wire, soldered variant. Its clones are abundant on sites such as Aliexpress, but I decided to try the original due to its good availability. This is a 4-pin version, which I wanted to use for connecting the front I2C bus (which carries the OLED screen and, in the future, buttons via a port expander). It feels very well-made, however, as expected, it is quite large, so I will not use it at the moment. Instead, I will try to get my hands on a pair of Weipu's miniature SA6 series (these are 6mm aluminium connectors)
Finally, a pair of 14-pin TE AMPSEAL connectors (1-776262-1 + 776273-1). And boy, are they massive. A wire-to-panel combination, these were candidates for the connection between the "ECU" and the cable harness, but I think I will instead go for the more compact SP21 (21mm round plastic connector). I will need about 10 pins for version 2 of the project, so the AMPSEAL would be an unnecessary overkill (the only smaller variant is 8 pins).