Reliable power switch for privacy apps has disconnected memory

Reliable power switch for privacy apps has disconnected memory

Members can download this article in PDF format.

What you learn:

  • How to implement a safer power switch, replacing a mechanical rocker switch, for several applications.
  • Components involved in setting up the circuit breaker.
  • Specifications for macrocell operation.

Today, privacy concerns are raised more often than ever before. Big tech companies are constantly accused of secretly collecting users’ personal information and even selling it to third-party entities.

In times where almost every household has at least one gadget with a camera and microphone, in addition to smartphones, people are starting to think twice about the trust they give to the manufacturer and service provider before buying another device. A large number of cases involve cameras that were hacked and remotely controlled. People started installing external camera covers and taping a microphone hole.

To solve this problem, a mechanical toggle switch can be installed on a camera/microphone by the manufacturer, which ensures protection against hackers and acts as a visual indicator of on/off status. However, the disadvantage is the poor design and ergonomics of such solutions.

The circuit described in this article is designed for devices that must prioritize privacy. For example, in gadgets with a camera and/or microphone, the user must be sure that the camera (microphone) is turned off if desired, even after the gadget has been turned off and on again for an extended period of time. Also, if someone with bad intentions wants to hide the fact that the camera (microphone) is on by removing the LED indicator (or shortening it), the camera (microphone) will be turned off automatically.

The circuit is not connected to the gadget’s processor, making it impossible to hack into and remotely turn on/off the camera and/or microphone.

Essentially, this circuit is a replacement for the mechanical toggle switch; however, it uses a small push button that allows for easy integration into the gadget’s design. See the block diagram in Figure 1 and Go Configure Software Hub’s GreenPAK Designer project i Figure 2 (the design file is available here).

Design Operation: Schematic design

The AnalogPAK SLG47004 has two digital rheostats that can be configured as one digital potentiometer. One of the features is the ability to save the value after it is turned off. This function is used in the current design as a 1-bit memory cell. Each time the button is pressed, the potentiometer RH0RH1 changes its value from 0 to 1023 or 1023 to 0, depending on the previous state.

See also  Cyber ​​security professionals warn of danger ahead with Russia, China and beyond

As a result, the voltage on the middle tap (Pin 7 and 8) changes from 0 to VDD and vice versa, making it a simple switch that controls an internal current P-FET. In turn, it is used to output the voltage to an external device. The switch is capable of delivering up to 300 mA.

The digital potentiometer (made of RH0 and RH1) has built-in memory of 1000 cycles, which may not be enough for a long period of unit use if each button is pressed one cycle. Therefore, in this design, the memory write sequence occurs only when the gadget (the main unit that includes this circuit) is turned off. For this purpose ACMP0L is used as a voltage drop detector.

If the power source voltage drops below 4.5V, the ACMP will trigger CNT3/DLY3 to form the “program” pulse that starts the memory write sequence. Both VDD pins are connected to the source through the Schottky diode and together with the 2.2 µF capacitor to delay current termination. Therefore, even if the source voltage drops rapidly to 0, the VDD voltage will slowly decay, leaving enough time for the memory write sequence to complete (Fig. 3).

To measure the time required for the program sequence, a simple setup was used. It is known that power consumption increases significantly during the erasing and writing procedure. Thus, the power supply to the IC was connected through a 1-kΩ resistor with oscilloscope probes connected to it.

As can be seen in Figure 4, the program time for both rheostats is 25.28 ms, and the current during the process is approx. 1mA. It should be noted that these values ​​largely depend on the voltage level, room temperature and other factors. The program time can increase two to three times. So the switch-off delay must be longer than that.

The program procedure starts when VDD drops below 4.5 V, and it should end at no less than 2.5 V (see the data sheet). The 2.2-µF capacitor ensures a long enough turn-off delay with room to spare (Fig. 3, again). Note that the capacitor type should be chosen with low leakage.

Since the potentiometer is connected between VDD and GND, there will be a constant current flowing through it:

See also  Crypto Wallet Bitkeep Pinpoints Malicious APK Packs for $8M Exploit

5 V/100 kΩ = 50 µA

It is an order of magnitude more than the quiescent current of the SLG47004. To reduce the overall power consumption, the Wake and Sleep (W&S) timer is used. It is set to 1:100, which means that current will flow through the potentiometer only once out of a hundred of the clocks of OSC0. About 0.49ms awake and 49ms sleep. As a result, the quiescent current of the device described here is close to 3 µA in the off state, making it perfect for battery-powered gadgets.

As previously mentioned, the designed device is equipped with an LED display. Two operational amplifiers configured as ACMPs are used for this purpose. OPAMP0 detects the LED brake and OPAMP1 detects the LED short circuit. In both cases, it turns off the P-FET and turns off the load (camera/microphone). Both op-amps are also enabled only when the switch is on, which helps save battery in an off state.

This design is also equipped with an internal button to remove the delay (CNT2/DLY2), instead of the typical external RC filter in such cases.

Design Operation: Macrocells

Pin12 is configured as a digital input with a Schmitt trigger that has a 100k pull-up resistor. It acts as an input for the push button (Fig. 1, again). Then the signal goes through 30-ms debounce delay (CNT2/DLY2), which triggers a 1.46 ms one shot (CNT1/DLY1). This starts OSC1 (2.048 MHz), forming a write window with a series of pulses to change the state of potentiometer RH0RH1. See the screenshot of the oscilloscope i Figure 5.

OSC0 acts as a clock for all counter delays in this design. Since it has very low power consumption (0.44 µA), it is set to Force Power On.

As mentioned in the “Schematic Design” section, the SLG47004 has two rheostats – in this project they are configured as one digital potentiometer. Its upper and lower pins (pins 6 and 9) are connected between ground and pin 15, which is an output for the W&S timer. The middle tap (Pin 7 and 8) is connected to Latch 1 through a digital input with Schmitt trigger Pin 21.

Latch 1 locks the potentiometer state during sleep mode (using an inverted W&S signal), and looks like the potentiometer is constantly connected to VDD, but uses 100X less current. After the latch, the signal goes to a potentiometer’s up/down input through a 2.44ms delay (CNT5/DLY5) needed for the pot to settle. This signal turns the potentiometer count up or down for each next write window. At the same time, the signal passes through the filter (filtering a 20-ns spike that appears due to the latch’s layer) to the 2-bit LUT3. The LUT controls the output power P-FET (pins 19 and 20).

See also  China fights lockdown protests by targeting smartphones - DW - 12/01/2022

The LED monitor consists of OPAMP0 and OPAMP1 and analog inputs Pins 4 and 24. It detects the LED’s short circuit or circuit break, and with the help of 2-bit LUT0, DFF3 turns off the P-FET if the LED fails.

The Wake and Sleep timer (WS Ctrl) plays an important role in saving energy if the device is battery powered. Since this project uses analog macrocells which are the most “energy hungry”, W&S makes it possible to save energy by turning on these macrocells for a short period of time. The wake-to-sleep ratio is set to 1:100.

CNT3/DLY3 starts together with the ACMP0L pot “program sequence” as described in the Schematic Design section (see Fig. 1 and the oscilloscope screens in fig. 3).

It should be noted that the I²C macrocell along with pins 10 and 11 are only used to program the chip during manufacturing and should not be used during operation of the device. Pins 10 and 11 must be unconnected on the circuit board.

Tables 1 to 11 below provides specifications for the various elements involved in the macrocell’s configuration.


The circuit described in this article works like a mechanical rocker switch, but uses a micro-push button that can be easily integrated into the gadget’s design. The power switch has a memory similar to a mechanical switch, meaning that if the user turns it off, it stays off.

In this design, an LED is used as a power indicator. It has fault protection, so if for some reason the LED does not light up, the load (camera/microphone) will also be off, ensuring the desired privacy. In addition, in the off state, the device has a very low current consumption of approximately 3 µA, which is perfect for most battery-powered devices.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *