logo elektroda
logo elektroda
X
logo elektroda

Security of ESP8266, relays and 230V connection in aquarium control

wojtaszek171 1128 11
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 20708345
    wojtaszek171
    Level 5  
    Posts: 15
    Hi,
    I have built myself a simple aquarium control device for 4 230V sockets and some sensors. I have been using this for a good 2 years now in combination with my own API server. I wanted to update the program a bit to get rid of the proprietary solution with the API and possibly combine it with homeassistant or make it completely standalone. I still have in the back of my mind whether this is definitely safe in its current form and whether to change something or completely let go and buy a ready-made solution. I'm hoping for some advice.
    I'm most puzzled by the wiring itself and the ESP power supply (It's connected via a USB cable to the charger - the black bundle in the middle of the sockets).
    I'd be grateful for any suggestions.
    Sorry about photo #3 - it's out of date. The hdc1080 sensor is now out of the box and the temperature probe is plugged in and out of the box.
    The photo shows a prototype board with an ESP8266 module, a 4-channel relay module, and additional sensors, placed on a table. Universal prototype board with soldered wires, held in hand. Interior of a homemade aquarium controller with ESP8266 module, relays, and 230V wiring visible. Four 230V sockets next to an aquarium with connected cables, next to a white electrical box. Link to project github
  • ADVERTISEMENT
  • #2 20708461
    Anonymous
    Level 1  
  • ADVERTISEMENT
  • #3 20708496
    wojtaszek171
    Level 5  
    Posts: 15
    I am not that advanced. That's why I'm asking what to change. No, it's not a mistake, I did it according to another online tutorial which explained that it doesn't really matter which cable to switch off. I can honestly say that it doesn't make much difference in my current situation either, because I bought a flat where the electrician flew hard and the cables in the sockets are sometimes like this and sometimes like that and the earthing is not connected at all. But I haven't found anyone who can explain to me why instead of connecting 0 to the pin the cable can be cut off at the panels. I would love to rip everything out and put it back in, but it's not that easy.
  • #4 20708714
    JacekCz
    Level 42  
    Posts: 8670
    Help: 760
    Rate: 1460
    wojtaszek171 wrote:
    is it really safe


    You have used one of the more rubbery words. Only "ecology" is more deceiving.

    safe in the sense of protection from shock
    safe in the sense of hacking
    safe in the sense of .... I don't know ... paying the electricity bill and boiling the aquarium ...
    in the broader sense: does it not contain gross errors in the art which may render it inoperable / less functional

    Added after 1 [minute]:

    So it is somehow the case that for clearly stated criteria / goals comes an adequate and satisfactory solution, for lack of assumptions (vague) no solution is so.
  • #5 20708734
    wojtaszek171
    Level 5  
    Posts: 15
    Here you go. I mean: safe as far as electrocution is concerned and from a fire caused by a short circuit.
  • #6 20708808
    TvWidget
    Level 38  
    Posts: 4386
    Help: 471
    Rate: 691
    As a general rule, a device should be safe in all foreseeable situations. Seemingly the matter is simple, but the average designer can foresee only the most obvious situations. For this reason, the way safety is tested has been formalised. The standards that define how this should be done in practice are, for the most part, a very, very, very long checklist . It is based, among other things, on the findings of thousands of different accidents. The equipment, including its instructions, is tested. What is important is how the product will be used.
    Imagine a situation like this. During some work on the aquarium, something falls out of your hand and into the aquarium. Some water splashes out. The sockets are splash-proof but you have muddled up in such a way that water gets in. The whole thing sits on a flat table water can collect on it. Will it be safe to wipe it off ?
  • ADVERTISEMENT
  • #7 20709110
    wojtaszek171
    Level 5  
    Posts: 15
    Ok the question is generally about the device itself. Is it safe to use such relays and run the cables in the box or could unwanted surges occur. Water will not get in because all 4 sockets come out together when unscrewed. They are connected with silicone.
  • #8 20709205
    Anonymous
    Level 1  
  • #9 20709225
    wojtaszek171
    Level 5  
    Posts: 15
    I understand. Good point. I'll check how it's wired in the wall socket and swap if necessary. Generally you know, things are often done in the aquarium with the lamp and heater on. :D .
  • ADVERTISEMENT
  • #10 20709254
    Anonymous
    Level 1  
  • #11 20709285
    TvWidget
    Level 38  
    Posts: 4386
    Help: 471
    Rate: 691
    wojtaszek171 wrote:

    Water will not get in because all 4 sockets come out together when unscrewed. They are connected with silicone.

    The openings of the sockets in the photo are facing upwards. If I pour water over them, will it not run inside ?
  • #12 20709388
    Ktoś_tam
    Level 40  
    Posts: 5215
    Help: 502
    Rate: 2807
    TvWidget wrote:
    wojtaszek171 wrote:

    Water will not get in because all 4 sockets come out together when unscrewed. They are connected with silicone.

    The openings of the sockets in the photo are facing upwards. If I pour water over them, won't it flow in ?

    - Of course water will flow in there, after all the plug is not with seals.
    - Also, this power supply in the socket is a failure
    - No fuse
    This is so quick.

Topic summary

✨ The discussion revolves around the safety and functionality of a DIY aquarium control device utilizing ESP8266, relays, and 230V connections. The user expresses concerns about the wiring and power supply, particularly regarding the potential risks of electrocution and fire hazards. Responses highlight the importance of proper wiring practices, including the correct handling of neutral and live wires, and the necessity of using splash-proof sockets. Concerns are raised about the lack of fuses and the potential for water ingress due to socket orientation. Suggestions include verifying the wiring in wall sockets and ensuring that devices connected to the relays are adequately protected against electrical faults.
Generated by the language model.

FAQ

TL;DR: Add a 30 mA RCD—"30 mA RCDs must trip within 0.3 s at IΔn"—switch Live only, use IPX4 outlets, and add fuses; avoid upward‑facing sockets and plug‑in chargers inside boxes. [IEC 61008-1, 2023]

Why it matters: This FAQ is for DIY aquarium keepers building ESP8266/relay controllers on 230 V and shows how to reduce electrocution and fire risk.

Quick Facts

Should my relays cut the Live or Neutral on 230 V?

Always switch the Live conductor. Switching Neutral can leave equipment energized when “off.” That is dangerous around water. With Class 0 heaters or lamps, a fault could energize the aquarium. Rewire so Live passes through each relay COM/NO. Keep Neutral and Earth continuous. [Elektroda, Anonymous, post #20709205]

What shock protection should I add to an aquarium controller?

Use a 30 mA RCD/GFCI upstream. 30 mA devices must trip within 0.3 s at IΔn. At 5×IΔn, they trip within 40 ms. Bond all Class I devices to Protective Earth. Press the Test button monthly and after any changes. This reduces shock risk significantly. [IEC 61008-1, 2023]

What IP rating should outlets near an aquarium have?

Choose equipment rated at least IPX4 (IP44) where splashing occurs. IPX4 indicates protection against water splashes from any direction. Orient outlets sideways or down to limit ingress paths. Use covers or enclosures that maintain their IP rating when in use. Keep drip loops on all cords below outlets. [IEC 60529, 2013]

Do I need fuses inside the box if the circuit has a breaker?

Yes. Breakers protect building wiring, not your internal harnesses. Add a main fuse and per‑channel fuses sized to the cable and relay ratings. Place them where they are accessible. Label their values. The discussion flagged “no fuse” as a clear issue to fix. [Elektroda, Ktoś_tam, post #20709388]

Is a phone USB charger OK to power an ESP8266 in the enclosure?

Avoid plug‑in chargers crammed inside boxes. They can vibrate loose and lack strain relief. Use an enclosed, certified power supply mounted securely. DIN‑rail Class II PSUs (e.g., Mean Well HDR) fit enclosures. Keep low‑voltage wiring away from mains parts. [Elektroda, Ktoś_tam, post #20709388]

Can I keep WAGO connectors next to the Wi‑Fi antenna?

Separate the antenna from mains connectors and wiring. Keep the antenna clear of metal and high‑voltage conductors. This improves RF performance and maintains safe distances. Mount mains terminals away from RF modules and provide insulating barriers where needed. [Elektroda, Anonymous, post #20708461]

How do I rewire to switch Live with a relay board?

Follow this quick procedure:
  1. Identify Live, Neutral, and Earth using a tester and labels.
  2. Route Live into each relay COM; wire each outlet’s Live to the matching NO.
  3. Keep Neutral and Earth as unswitched busbars; do not break PE. This keeps appliances de‑energized when “off.” [Elektroda, Anonymous, post #20709205]

Are generic relay modules safe for heaters and pumps?

Use relays rated for 250 VAC and your load current. Maintain required clearances and creepage inside the enclosure. Separate low‑voltage control from mains. Automatic control safety standards outline insulation, separation, and fault testing requirements for such builds. Choose certified parts when possible. [IEC 60730-1, 2020]

Will silicone sealing alone make my outlets waterproof?

No. Silicone around the faceplate does not seal the plug and socket interface. Water can still enter, especially when outlets face up. Use purpose‑built splash covers or relocate and reorient the outlets. Do not rely on sealant as your protection. [Elektroda, Ktoś_tam, post #20709388]

What about earthing and Class 0 devices near water?

Prefer Class I lamps or insulated stands around aquariums. Avoid Class 0 devices within reach. Connect all metal parts and Class I cases to Protective Earth via a reliable PE conductor. Use an RCD for additional protection. [Elektroda, Anonymous, post #20709254]

How should I separate low‑voltage ESP wiring from mains inside the box?

Provide physical separation, barriers, or adequate distances between 230 V and 3.3/5 V circuitry. Route low‑voltage on one side. Keep mains on the other. Use grommets and strain reliefs at entries. These practices align with control safety requirements. [IEC 60730-1, 2020]

How do I test that my RCD/GFCI still works?

Press the Test button to verify the device trips. Reset it after the test. Repeat monthly and after modifications. For a deeper check, use a plug‑in RCD tester that injects a small fault current. Replace devices that fail tests. [IEC 61008-1, 2023]

What does “safe” mean in practice for this project?

Design for foreseeable misuse, not just ideal operation. “A device should be safe in all foreseeable situations.” Imagine splashes, dropped tools, or a failed heater. Then add layers: RCD, fuses, proper earthing, and IP‑rated hardware. Write clear instructions and labels. [Elektroda, TvWidget, post #20708808]

Can I share Neutral across multiple relay‑controlled outlets?

Yes, keep Neutral as a continuous bus. Do not break Neutral or Earth with single‑pole relays. Bridge Lives at the relay board if you need common feeds, using proper copper links or terminal blocks. Verify color coding and labeling to avoid mix‑ups. [Elektroda, Anonymous, post #20708461]
Generated by the language model.
ADVERTISEMENT