Monday 14 January 2019

circuit design - Invert signal from an on/off switch


I have a circuit (below) where there's an IC responsible for battery charging, voltage boosting, power/regulation, etc. It has an "Enable" pin which is pulled up to VCC by default, and determines whether it supplies power or not. (High == ON, Low == OFF)


I want to hook this up to a toggle switch so that when the toggle is "open", the "Enable" pin is pulled down to ground. Is there a simple/easy way to wire this? I'd like to avoid adding any additional components if possible.


Right now I have the leads connected as below, which works but is confusing because it is the opposite of the switch's labeling. (Open-switch turns the system on and closed switch turns it off).


Thanks!


schematic


simulate this circuit – Schematic created using CircuitLab




Answer



schematic


simulate this circuit – Schematic created using CircuitLab


Figure 1. Inverting the enable logic.



  • Connect a milliammeter across the switch on your existing circuit and note the current to ground.

  • Calculate the value of the internal pull-up resistor: \$ R_{PU} = \frac {V_+}{I} \$.

  • Add a pull-down resistor of about one tenth the value of the pull-up. (Note 1.)

  • Rewire the switch to pull high.



Note that in this circuit R2 will consume a little extra power when the switch is closed.


Note 1. R2 will be fighting R1 in trying to pull the input low. Most digital logic families switching point is below half-supply. e.g., One would think that a 5 V logic input would read anything below 2.5 V as 'low'. This isn't the case and the thresholds are usually defined as a guaranteed low threshold and a guaranteed high threshold. A 10:1 pull-up / pull-down ratio should guarantee a zero when the switch is open.


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...