Translated from Türkçe by AI ·
I had almost the same thing happen at home; an electrician friend solved it and I learned from him. There are two problems.First, the JD-VCC jumper. As long as it is fitted, the optocoupler on the board isolates nothing: the relay coil is also powered from the Pi’s 5V and the grounds are common. The pulse produced when the relay coil releases goes straight onto the Pi’s supply. To do:
- Remove the jumper.
- Power JD-VCC and the coil-side GND of the board from a separate 5V adapter (a cheap 5V 1A is enough).
- From the Pi to the board, only VCC (3.3V works too, for the optocoupler LED) and IN1 should go. Do not connect the Pi GND to the coil-side GND.
Second, the contactor coil. The diode Ayşe mentioned is for DC coils; yours is 230 V AC, so a diode won’t work there. Put an RC snubber across the coil terminals (100 Ω + 0.1 µF X2, sold as a ready-made module) or a varistor. The arc when it releases causes noise on the relay contacts, and if the wires run past the Pi it leaks in there too.Even once these are done, keep the Pi 20-30 cm away from the relays, and do not run the 230 V wires in the same channel as the Pi’s GPIO wires.And on the Hermetry side: after sending the pump.set command, have the device report the pump’s actual state (wire the contactor’s auxiliary contact to an input and send it as pump.running). That way, even if the Pi is reset, the rule shows what the device reports rather than what was “sent”.
Evde neredeyse aynısını yaşadım, elektrikçi bir arkadaş çözdü, ben de öğrendim. İki sorun var.
Birincisi JD-VCC jumper’ı. Takılı olduğu sürece kart üzerindeki optokuplör hiçbir şeyi ayırmıyor: rölenin bobini de Pi’nin 5V’undan besleniyor ve toprak ortak. Röle bobini bırakırken oluşan darbe doğrudan Pi’nin beslemesine biniyor. Yapılacak:
- Jumper’ı çıkar.
- JD-VCC ve kartın bobin tarafı GND’si ayrı bir 5V adaptörden beslensin (ucuz bir 5V 1A yeter).
- Pi’den karta sadece VCC (3.3V da olur, optokuplör LED’i için) ve IN1 gitsin. Pi GND’sini bobin tarafının GND’sine bağlama.
İkincisi kontaktör bobini. Ayşe’nin dediği diyot DC bobin için; seninki 230 V AC, ona diyot olmaz. Bobin uçlarına RC snubber (100 Ω + 0,1 µF X2, hazır modül olarak satılıyor) ya da varistör koy. Bırakma anındaki ark röle kontağında parazit yapıyor ve kablolar Pi’nin yanından geçiyorsa oraya da sızıyor.
Bunlar bitince bile Pi’yi rölelerden 20-30 cm uzağa al, 230 V kabloları Pi’nin GPIO kablolarıyla aynı kanaldan geçirme.
Bir de Hermetry tarafında: pump.set komutunu gönderdikten sonra pompanın gerçek durumunu cihazın raporlamasını sağla (kontaktörün yardımcı kontağını bir girişe bağla, pump.running diye gönder). Böylece Pi resetlense de kural “gönderdim” diye değil cihazın söylediğine göre görünür.

