Page 2 of 2
Re: What is the best most safe way to drive this Relay?
Posted: Sat Mar 10, 2018 1:13 am
by Archibald
If you completely disconnect the relay board, do you still get that same 1.4V to 1.8V on the ESP32 development board output pin? If so, that proves the issue is nothing to do with the relay board. You seem to have data on that pin during setup and during I²S audio.
Have you considered controlling the relay from some other pin?
How are you supplying +5V supply to the relay board?
Re: What is the best most safe way to drive this Relay?
Posted: Sat Mar 10, 2018 11:22 pm
by renegadeandy
Hi Archibald!
If i disconnect the ESP32 from the relay, and test the voltage on Pin 22, it indeed sits between 1.4v and 1.8v whilst audio is playing.
When audio stops, it sits at 0v.
If I change the ESP32 pin to 13 for the relay low, then this problem doesn't happen. What is it about pin 22 that causes this?!
I can't work it out? Please see this github project which recreates the issue :
Code: Select all
git clone https://renegadeandy@bitbucket.org/renegadeandy/audio_bug_relay.git
Note to prove it works, just change the
to
and connect voltmeter to pin 13 to test.
Re: What is the best most safe way to drive this Relay?
Posted: Sun Mar 11, 2018 4:19 am
by Archibald
Hi Andy,
Sorry, I've not been able to find what's driving pin 22.
Re: What is the best most safe way to drive this Relay?
Posted: Sun Mar 11, 2018 7:28 pm
by renegadeandy
Does yours behave the same?
Re: What is the best most safe way to drive this Relay?
Posted: Sun Mar 11, 2018 8:12 pm
by Archibald
I am not using I²S. I'm taking .wav files from ESP32 flash memory, or from the internet via WiFi, and outputting mono audio from one of ESP32's digital-to-analogue converters. Anyway, checking on an oscilloscope, I am not getting any data or clock signal on the D22 pin.
However, I've recently had the same sort of thing happen. I'm driving an SPI peripheral using pin D13 for serial data (MOSI). I understand that's more-or-less a default pin for the HSPI bus (although I'm not yet using SPI library). I had not realised that the WiFi example code I had copied was also using pin D13 (to drive an LED if required). It took a while to work out why my peripheral was behaving strangely.
Re: What is the best most safe way to drive this Relay?
Posted: Sun Mar 11, 2018 8:47 pm
by renegadeandy
Perhaps literally just run my project and check the voltage on Pin 22....it shouldn't matter if you have the i2s hooked up to a dac or not.
Re: What is the best most safe way to drive this Relay?
Posted: Sun Mar 11, 2018 9:08 pm
by Archibald
I've been assuming you have checked that pin 22 is not one of the four pins set up in your I²S pin configuration.
Re: What is the best most safe way to drive this Relay?
Posted: Mon Mar 12, 2018 10:58 pm
by renegadeandy
Absolutely, look at the source code!
Re: What is the best most safe way to drive this Relay?
Posted: Thu Mar 15, 2018 8:54 pm
by renegadeandy
Does this happen when you run my project on your esp32 or anybody elses?