3

I am using a Raspberry Pi Pico, a W5500, and a relay module. When I don't connect 24VDC for the relay module (NO and COM pins,) the Pico, W5500 and relay module work properly (the relay only blinks.)

When I added 24VDC for NO and Com side, my code is working for 1 or 2 minute then the ethernet disconnects from the internet.

I changed the relay module's signal pin and it fixed the problem.

I used the relay module on GP14 which is I2C1 SDA and SPI1 SCK. Thr W5500 uses GP10 I2C1 SDA and SPI1 SCK.

Are GP14 and GP10 the same? If they aren't, why doesn't the ethernet module working and why did it strart working when I changed the relay module's signal pin from GP14 to GP28? Did it not work because the signal pin of the relay module was close to the pins of the W5500?

enter image description here

SPI1_SCK => WIZ850io SCLK

SPI1_TX => WIZ850io MOSI

SPI1_RX => WIZ850io MISO

SPI1_CSn => WIZ850io SCNn

GP15 => WIZ850io RSTn

GP-14 was Relay's signal pin. I changed to GP28

JRE
  • 67,678
  • 8
  • 104
  • 179
  • 1
    maybe the relay contacts are not isolated – jsotola Dec 01 '21 at 07:00
  • 1
    No, I didn't move or didn't change anything on relay. Only I changed pin14 to pin28, and it is working. I tried to connect pin14 again to see what will happen, It gave error again. – mrneedshelpalot Dec 01 '21 at 07:02
  • (1) Are you using uart01/uart1 or SPI0/SPI1? (2) I found Pico uart0 on GP0, 1 OK. (3) I found uart1 on GP4. GP5 not reliable, intermittently failing. (4) I found uart1 on GP8, GP9 reliable. Is it this one? (5) W5500 Ethernet with POE IoT Board (Arduino Compatible) DFRobot $45. (a) https://www.dfrobot.com/product-1286.html, (b) https://wiki.dfrobot.com/W5500_Ethernet_with_POE_Mainboard_SKU__DFR0342. – tlfong01 Dec 01 '21 at 07:06
  • 1
    @tlfong01 Sorry I didn't mention it before. I added pins, w5500 , relay module and connections on question. I am using [banggodlink](https://tr.banggood.com/W5500-Module-TCP-or-IP-Ethernet-Module-Compatible-with-WIZ820io-RC5-Internet-of-Things-IOT-Board-p-1842808.html?gmcCountry=TR&currency=TRY&cur_warehouse=CN&createTmp=1) this and SPI1. – mrneedshelpalot Dec 01 '21 at 07:11
  • (5) Thanks for the updated wiring diagram. So you are using SPI1 (GP10, 11, 12, 13) and GP 14, 15 (later GP28). I have been using GP14, GP15 very often and found them OK. (6) But GP14, 15 seem to 'overlap' with SPI1, so you might like to try other pins with alternate SPI functions. (7) For a similar reason, avoid using GP28 or other ADC pins. (8) Your relay is JD-Vcc type, and might have the Pico/Rpi GP pins "High not high enough" problem. / to continue, ... – tlfong01 Dec 01 '21 at 07:24
  • (8) Your JD-Vcc relay is Arduino compatible 5V logic, but Pico is 3V3. You might need to remove the relay's JD-Vcc jumper and power relay side with 5V. See this: (9) How to properly use a relay module with JD-VCC from Arduino/Raspberry? Asked 1 year, 5 months ago Active 3 months ago Viewed 15k times https://electronics.stackexchange.com/questions/505318/how-to-properly-use-a-relay-module-with-jd-vcc-from-arduino-raspberry. (10) One more thing - GP22 seems very 'clean', so less chance making trouble. – tlfong01 Dec 01 '21 at 07:26
  • (11) For Rpi3/4. built in on board I2C pins have heavy pullups of 1k8, and other pins 50k (not sure about Pico). So this might cause complications, especially if your 3V3 Pico output level is marginal to 5V logic. (12) Just wild guessing, I am still experimenting with Pico uart/I2c/SPI stuff. Good luck, cheers. – tlfong01 Dec 01 '21 at 07:39
  • 1
    @tlfong01, thank you. First I actually use this [relay] (https://forums.raspberrypi.com/download/file.php?id=49019) but when I use this on GP14, W5500 isn't working even 1 or 2 min. It is disconnecting immediatelly. Now I tried this on another pin GP28 (I will change it don't worry, I will use GP23 or smt that not Analog pin) , It is working good. So I guess the problem is really GP14 pin. I guess I shouldn't use it when I use SP1. – mrneedshelpalot Dec 01 '21 at 07:40
  • Many thanks for telling me the good news. So GP14 might be guilty. BTW, I am playing with 4 or 5 Pico boards, I do find GP pins not working from time to time. I just swap pins or boards and often problem disappears. Happy learning. Cheers. – tlfong01 Dec 01 '21 at 07:45
  • 1
    In that link, they use 2N3904 but I couldn't find it in my shop so I am using 2N 2222. Thank you for your great knowledges. Have a nice day, cheers. – mrneedshelpalot Dec 01 '21 at 07:46
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/131939/discussion-between-tlfong01-and-mrneedshelpalot). – tlfong01 Dec 01 '21 at 08:07

0 Answers0