I'm wondering if there's anyone who may be able to help me figure out how I might control a 5V Dual Coil Latching Relay (maybe something like the Panasonic TQ2-L2-5V or the KEMET EA2-5TNJ) from an ESP32's GPIO pin?
My project is an open source chromatic tuner (Q-Tune: https://github.com/joulupukki/q-tune) that will be housed in a guitar pedal enclosure (125B size). I'm using an ESP32-CYD (Cheap Yellow Display: https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display) and unfortunately there are not maybe GPIOs available for use. I'm reading an amplified guitar signal using GPIO 35, reading the state of a momentary foot switch on GPIO 27, and want to control a dual coil latching relay with GPIO 22.
When a person taps the footswitch, I will see that by reading the state of GPIO 27 and if the tuner should go into tuning mode, I want to signal the relay by sending a constant 3.3V signal on GPIO 22. That will disconnect the incoming audio signal (stereo) from continuing on to the rest of a pedalboard or guitar amp. When a person taps the footswitch again, I will read that and change GPIO 22 to a constant 0V signal which should signal the relay again and put the pedal into true bypass mode so the signal bypasses the tuner circuitry entirely.
Is there some way to watch for the rise and fall of the GPIO 22 signal and send the appropriate 5V pulse signal (> 10ms and < 100ms) to the correct relay coil to set or reset the relay?
I already have a partial PCB designed that uses a standard pedalboard 9V DC IN with a voltage regulator that outputs 5V to power the ESP32 and attached screen.
It seems like this should be possible, but I've been banging my head against the wall trying different things gleaned from the Internet in LTSpice with not a lot of success. Using an external pre-built relay (very common in the DIY world) isn't really an option because most of them are controlling 120/240V appliances, expect 2 GPIOs to be available, and I also need to add this circuitry directly onto my PCB that will sit underneath the ESP32-CYD.
My project is an open source chromatic tuner (Q-Tune: https://github.com/joulupukki/q-tune) that will be housed in a guitar pedal enclosure (125B size). I'm using an ESP32-CYD (Cheap Yellow Display: https://github.com/witnessmenow/ESP32-Cheap-Yellow-Display) and unfortunately there are not maybe GPIOs available for use. I'm reading an amplified guitar signal using GPIO 35, reading the state of a momentary foot switch on GPIO 27, and want to control a dual coil latching relay with GPIO 22.
When a person taps the footswitch, I will see that by reading the state of GPIO 27 and if the tuner should go into tuning mode, I want to signal the relay by sending a constant 3.3V signal on GPIO 22. That will disconnect the incoming audio signal (stereo) from continuing on to the rest of a pedalboard or guitar amp. When a person taps the footswitch again, I will read that and change GPIO 22 to a constant 0V signal which should signal the relay again and put the pedal into true bypass mode so the signal bypasses the tuner circuitry entirely.
Is there some way to watch for the rise and fall of the GPIO 22 signal and send the appropriate 5V pulse signal (> 10ms and < 100ms) to the correct relay coil to set or reset the relay?
I already have a partial PCB designed that uses a standard pedalboard 9V DC IN with a voltage regulator that outputs 5V to power the ESP32 and attached screen.
It seems like this should be possible, but I've been banging my head against the wall trying different things gleaned from the Internet in LTSpice with not a lot of success. Using an external pre-built relay (very common in the DIY world) isn't really an option because most of them are controlling 120/240V appliances, expect 2 GPIOs to be available, and I also need to add this circuitry directly onto my PCB that will sit underneath the ESP32-CYD.

