Electrical – Alternative On/Off Toggle momentary button and Raspberry

arduinobuttonswitches

Alternative On/Off system with momentary button

Hello. I found this system with Alternating ON/OFF Switch that I want to use it with a momentary button to turn on/off a led. It's working with IC 4069 Hex Inverter on 12V. The question is how can I change the state of the system(On or Off) in parallel with the momentary button, using Raspberry Gpio output pin?

Thank you,
Razvan (hobbyist)

Best Answer

First, change the LED drive to a common emitter as follows: enter image description here

This will invert the sense of the LED ON/OFF relative to U1F. An inverter can be put in series with U1F to restore the original sense.

Change the supply voltage of the 4069 to 3.3 volts, same as the R-Pi, or use the R-Pi's power supply. The LED drive voltage can still be the 12 volts.

Connect the GPIO port to the junction of U1A, R2, and the switch through a 1K resistor as shown. This will limit current through the GPIO port id the switch is close while the GPIO pin is an output. enter image description here

Use the GPIO pin to control the toggle function as follows:

  1. The pin is configured as an input.

  2. Read the logic level on the input.

3A. If the input is high, change the pin to an output with a logic low, wait for the signals to propagate, then change it back to an input.

3B If the input is low, change the pin to an output with a logic high, wait for the signals to propagate, then change it back to an input.