Here is an object push button that needs to be hacked:
simulate this circuit – Schematic created using CircuitLab
Hacked object circuit is not accessible.
From multimeter :
- button is pulled up with a 10k resistor (measured resistance between 5V power and button input)
I want to hack it with an external 3.3V MCU, tolerant to 5V on its inputs. My goal is to keep actual behavior and :
- read current button status
- control button from external CPU
Max sink/source current on D0 is 12mA.
- on D0 - GPIO as input - button state is read
- on D0 - button control done by configuring it as output with a low logic level.
Here are sink/source current :
----------------------------------------------------------------
| | PB1 state
----------------------------------------------------------------
|DO Configuration |Level | OPEN | CLOSED
----------------------------------------------------------------
| OUTPUT - |HIGH | 170µA | short circuit!
| OUTPUT - |LOW | 500µA | 0
|INPUT PULLUP- |HIGH | 1,7/(10k+RPullUp)| NA
|INPUT PULLUP- |LOW | NA | 3.3/RPullUp
----------------------------------------------------------------
To prevent shortcircuit adding a resistor before D0 would be safe, but with such a resistor, on hacked object circuit input there is now a voltage divider when D0 driven low (and PB1 open). Adding a 680ohm resistor keeps D0 far from current limitation and now when D0 driven low and PB1 is opened, hacked object circuit has a 0.31 level. When D0 is configured as input I must be sure D0 pullup resisor >> 680ohm
- So is it safe to connect this circuit with only a resistor?Above, I supposed hacked object circuit impedance was fixed (high impedance input with 10k resistor pullup)...
- Can you provide and detail some examples of dangerous cases?
regards