dektronics / printalyzer-timer

F-Stop enlarging timer and print exposure meter
24 stars 6 forks source link

Fix power side-effect with level shifting circuitry for meter probe interface #37

Closed dkonigsberg closed 1 year ago

dkonigsberg commented 1 year ago

A portion of the meter probe interface's level shifting circuitry, specifically the part used for the sensor interrupt pin and the probe button, is based around a particular BSS138 circuit.

While this circuit is simple, and generally works, it has one major problem. If the +3.3V rail is live, but the +5V rail is off, then some amount of voltage leaks through to the +5V side. This seems to cause the PROBE_VBUS net to maintain a constant voltage of around +2.8V when the meter probe port power (PROBE_DRIVE_VBUS) is explicitly turned off.

That is just enough voltage to cause the meter probe button to work, even if the meter probe should be off. It might not be enough for the rest of the meter probe to function in this state, but its not a chance worth taking.

This problem absolutely needs to be solved for the next hardware revision, and there are a number of possible approaches:

It might also make sense to put the next revision on hold, pending a change to the availability of the PCA9527 bus extender, as using that part would reduce the number of lines we need to care about here from 2 to 1.

dkonigsberg commented 1 year ago

The path forward with this is going to involve changing components in two areas of this interface. First, the I2C bus portion will be switched from the TCA9517A to the PCA9527. The latter IC was initially avoided due to part availability issues, but its now starting to become available from the usual vendors. Its overall a better choice, for a number of reasons:

The likely implementation will somewhat resemble this example from the datasheet: image

Second, the approach taken for level-shifting the button will now be changed. We no longer need to worry about the interrupt line, due to the above IC, so that helps somewhat. The problem with the popular "bi-directional" BSS138 level shifter circuit is that it doesn't handle the case of the 5V rail being turned off. The new approach will still use the BSS138, but in a different configuration that will no longer place a voltage on the button output when the 5V rail to the meter probe port is disabled. Furthermore, this new approach should probably also be applied to the footswitch port.

This alternate circuit looks something like this: image