Rothari devlog

The relay, the bike, and a little smoke.

The relay arrived and fits beautifully. The bike gave me a better power switch than I could have designed. And one board taught me, the smoky way, why a square pad didn't mean what I thought  it did.

The missing piece

Last time, the boards arrived without their most important part: the relay that rests on the rider's own throttle and only lets TIM in when everything checks out. It came this week. Its footprint had been drawn from a datasheet and had never met a real relay. It dropped straight in, sat flat, and soldered clean. That's a small thing to be this pleased about, but it's the heart of the safety design. It looks pretty darn good to me.

A TIM main board with a large clear-cased relay fitted at one end, two rows of black header sockets and a USB-C port.
The relay fitted by hand, the first real part I've added to a machine-built board.

Power that has to be asked for

TIM needs power from the bike, and I don't want it to ever wake up on its own. Probing the wiring, I found a feed that is live only while the headlight is on. Better still, the bike turns the headlight off every time the key comes out. So TIM starts every ride off, and the rider has to choose to turn it on. That's exactly the behaviour I wanted, and I didn't have to add a single switch to get it.

A small converter brings the bike's battery voltage down to the 5 volts the board uses. I checked it on the bike before anything else was connected, and checked again that it really did go off after a key cycle.

I also learned something about fuses. A fuse has two ratings: the current at which it blows, and the current it can still safely stop energy flow once it has blown. My glass fuse blows at the right current, but a lithium pack can push hundreds of amps into a dead short, far more than glass can stop. Ceramic sand-filled fuses are on the way.

The smoke

I wired the power lead to the second board, switched on, only to be confronted  by sparks and a puff of smoke!  Under the board, a trace had burnt open:

Close-up of the underside of a green circuit board, showing a scorched, burnt-open copper trace running past a mounting hole.
The underside of board #2. The scorched line is the trace that feeds the whole board.

Remembering that the square pin means pin 1, I for some reason assumed it to be ground and didn't check the circuit...   that it also meant I put the black wire on the square pad. On this board pin 1 is the positive input. The supply went in backwards, and I blew the main power trace.

The power-input end of a TIM board: a black wire soldered to a square pad and a red wire to a round pad, next to the relay.
Black on the square pad. It looks right, and it isn't. Nothing on the board says which is which.

To avoid it in future I WILL make the square pin 1 GND for all future designs.   I have decided on a schema:

  • One rule for every connector: 
    • pin 1, the square pad, is always ground, 
    • pin 2, round pad power,
    •  then signals. I'll never have to think about it again.
  • Labels in the silkscreen: 
    • + and − on the power input, 
    • ground, power and signal marked on every wire connection.
  • Protection: 
    • the board will survive power connected backwards,
    • the plug will only go in one way.

Board #3 wakes up

Board #3 got its wires the right way round, checked with a meter before any power went near it. It powered up with no smoke, drawing almost nothing. Every voltage I measured was where it should be, including the relay sitting quietly off, waiting to be told.

Next: connecting the brain, a small display-and-processor module, and asking every sensor on the board to say hello.

— Paul

Comments

Loading…

Leave a comment