What is the best most safe way to drive this Relay?

Archibald
Posts: 110
Joined: Mon Mar 05, 2018 12:44 am

Re: What is the best most safe way to drive this Relay?

Postby Archibald » Sat Mar 10, 2018 1:13 am

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?

renegadeandy
Posts: 19
Joined: Tue Mar 06, 2018 2:08 pm

Re: What is the best most safe way to drive this Relay?

Postby renegadeandy » Sat Mar 10, 2018 11:22 pm

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

Code: Select all

relayPin1 = 22;
to

Code: Select all

relayPin1=13;
and connect voltmeter to pin 13 to test.

Archibald
Posts: 110
Joined: Mon Mar 05, 2018 12:44 am

Re: What is the best most safe way to drive this Relay?

Postby Archibald » Sun Mar 11, 2018 4:19 am

Hi Andy,

Sorry, I've not been able to find what's driving pin 22.

renegadeandy
Posts: 19
Joined: Tue Mar 06, 2018 2:08 pm

Re: What is the best most safe way to drive this Relay?

Postby renegadeandy » Sun Mar 11, 2018 7:28 pm

Does yours behave the same?

Archibald
Posts: 110
Joined: Mon Mar 05, 2018 12:44 am

Re: What is the best most safe way to drive this Relay?

Postby Archibald » Sun Mar 11, 2018 8:12 pm

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.

renegadeandy
Posts: 19
Joined: Tue Mar 06, 2018 2:08 pm

Re: What is the best most safe way to drive this Relay?

Postby renegadeandy » Sun Mar 11, 2018 8:47 pm

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.

Archibald
Posts: 110
Joined: Mon Mar 05, 2018 12:44 am

Re: What is the best most safe way to drive this Relay?

Postby Archibald » Sun Mar 11, 2018 9:08 pm

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.

renegadeandy
Posts: 19
Joined: Tue Mar 06, 2018 2:08 pm

Re: What is the best most safe way to drive this Relay?

Postby renegadeandy » Mon Mar 12, 2018 10:58 pm

Absolutely, look at the source code!

renegadeandy
Posts: 19
Joined: Tue Mar 06, 2018 2:08 pm

Re: What is the best most safe way to drive this Relay?

Postby renegadeandy » Thu Mar 15, 2018 8:54 pm

Does this happen when you run my project on your esp32 or anybody elses?

Who is online

Users browsing this forum: No registered users and 79 guests