Improve wi-fi signal on Tuya Relay by adding an external antenna

This is not ESP32 related but I thought it the best place to post as they are predominately wi-fi devices. I have Tuya Local installed and have onboarded all my Tuya plugs and relays. However one device keeps disconnecting from the integration. The relay is working with Alexa skill and via the Tuya app but is very slow to respond although for practical purposes is not really a problem as its a dawn to dusk routine. The relay controls some lights on my electric gates and is located within the gate control panel which is steel. The device is therefore effectively in a Faraday Cage and I was surprised I was able to connect to Wi-Fi at all. My Omada software reports a signal strength of -84dBm for the connected device.
This is the particular relay


I think the antenna is a coiled wire at the top of the circuit board (or is it the circuit board trace on the chip board?). Could I connect a coax pigtail to the antenna connection point and mount an antenna on the outside. Perhaps something like this

Would it improve the signal enough to be more stable?

The coil is likely the antenna for 433MHz. The antenna for Wi-Fi is the circuit board trace on the chip board.

1 Like

That coiled wire is 433Mhz antenna, not wifi.

The resonant frequency for your Tuya based WiFi antenna should be 2.4Ghz and connected to the Tuya module on the side, not the little black coil next to the blue relay at the top of the board that is for 433Mhz . Try an external antenna and see. Waterproofing will be your main concern. Loop the wire so any potential drips are away from any circuitry.

Alternatively, try mounting the device in an external plastic box which is weatherproof, running wires back through a grommet, or replacing it with LoRa technology which supports extended ranges.

Your photo isn’t the clearest. What Tuya board is being used? CB3S? See CB3S Module Datasheet-Tuya Developer Platform-Tuya Developer and https://www.elektroda.com/rtvforum/topic4016376.html

Does the board support BlueTooth? Maybe use that with a BluTooth repeater mounted closer to the unit and the remote end.

Are you using the 433Mhz for the remote? Rolling code? Is that having distance issues as well? If so, moving everything outside the Faraday cage is the way to go.

You could cut out a panel from your Faraday cage and replace it with something like Perspex, suitable sealed with weatherproof silicone, that will allow transmission to happen, and opening up your Faraday cage. Be aware that 2.4Ghz may be more directional than 433Mhz so orientation of your antennas and the ‘leaky’ opening may be important at that distance.

Many thanks @neel-m and @Karosm . What is the 433mhz used for? I thought both Bluetooth and Wi-Fi shared the 2.4Ghz antenna or is that only on ESP2 boards?

Many thanks @neel-m I think I have seen a similar video on YouTube. On some sites it said you have to change the impedance resistors which I was reluctant to do in case I bricked the board, but the article you have pointed me to seems to suggest this isn’t necessary.

Sorry @IOT7712 it was a snip from the AliExpress website. From what I can make out, yes its the CBS3 Tuya module.
I don’t want to cut holes in the gate control box as its still under warranty. however there are cable glands at the bottom I can feed the coax through. I would need an antenna with a coax approximately 800mm long. Is this likely to impact signal strength through losses rather than a shorter coax pigtail?
As far as I am aware I am not using the 433Mhz only Wi-Fi. As I said to neel-m and Karosm I am not sure what this antenna is for.

Yes, 2.4G pcb antenna on Esp is used for wifi/bluetooth. But that relay has additional 433MHz control option. You can pair it with 433 transmitter.

I would just put the device in a water proof (or even just resistant) box and extend the 4-5 low voltage wires. At almost a meter that cable will have quite a bit of loss, but probably better than being inside the metal cage.

I had “faraday cage” problem with a device inside metal box. Drilled 13mm hole solved issue even if it was on the backside of recessed box towards 30cm brick wall. Some small “window” on the front could work as well.

Does just opening the door of your Faraday cage’ metal enclosure boost the signal by much? How much? Is the opening facing your WiFi router at the other end? WiFi transmissions usually prefer line of sight directionality.

Be aware of the resonant wavelength of 2.4Ghz (the standard frequency the Tuya CB3S module uses), and penetration hole sizes approaching these dimensions of around 5 inches/11cm may actually form a waveguide that can attenuate signals. Sticking an antenna at the end of shielded coax cable of indeterminate length (800mm is fine) is standard practise, as long as the antenna itself is of correct resonant wavelength as a multiple/divisor of it, and your coax is properly grounded. At 433Mhz (apparently unused in your scenario but a possible security weakpoint where a passer-by with a 433Mhz controller could operate your gate - snip the black curly pigtail antenna off flush at the circuit board if you are not using the 433Mhz portion and measure it in case you need it in the future), it is a lot simpler, and the pigtail antenna may vary by quite a bit and still be good enough.

At 2.4Ghz WiFi frequencies, it is more critical, but as long as some signal improvement is achieved, you may be able to get away with it. Putting your device outside the metal box, on the side facing your WiFi device/router (the signals on those wires not being at radio frequencies) will be probably work better - using cables that are mains rated in thickness will result in negligible loss as you only have power connections wired to the board. Try it with temporary wire extensions (suitably insulated for safety reasons) but hanging free without putting it inside a plastic waterproof enclosure, and see how well it works. Same with an external 2 4Ghz antenna - just make sure there is proper grounding as this forms a critical part of the antenna functionality and effectiveness. This also give you room for orientation experiments to find the optimum way to point the antenna to get the best signal.

If pointing a stick antenna up on the outside of the metal enclosure works best, try pointing down at the bottom, and you may find it is just as good but less exposed to the weather for longer life, and you can use the grommets to pass the coax through.

A 2.4Ghz stick antenna rated for 3dB gain gives you double the signal. 6bB four times - it is exponential. No point in going for anything too expensive as the benefits of a bigger antenna don’t necessarily improve with greater expense, as now you are picking up signal from other devices and interference from other devices too. Monitor your signal strength. The existing -84dBm is at the lower threshold of good transmission. If you can raise it to the -70’s then you should notice significant improvement in reliability.

Google the term ‘cantenna’ for some interesting insights. If you are going to experiment with rolling your own antenna, and you decide it works well enough, make sure to weatherproof the final result, not just for wind and rain, but spiders and nesting birds

Should this fail, consider dumping WiFi as your transmission method and get something that supports a transmission technology such as hardwired RS485 that will give you robust connectivity for up to a km, but you will have to run twisted pair cable back to your HomeAssistant box and have an adapter at that end. A gate controller supporting RS485 may cost a bit more, but be far more reliable. Consider rolling your own, with a RS485 relay board at the gate, and the smarts inside your home.

Another option is LoRa, similar to WiFi but rated for greater transmission distances. You may find gate controllers for LoRa hard to find or not on the market yet.

Curious to see how your experiments turn out.

Regrettably the door is pointing away from the Access Point to which it is connected. I have a TP-Link mesh system using EAP 225 and 245’s. The relay is currently connected to the one in my entrance hall that’s an EAP225 (2x2 MIMO).
I could turn that off briefly and see if it connects to the one in the kitchen which is an EAP 245 (3 x 3 MIMO) however that might only relates to the 5Ghz frequency so have no effect. But I will try with the door open to see how much difference it makes.
I will keep you updated when I have tried a few of the helpful suggestions from people in this thread.

Unfortunately that’s not really practical due to the way the gate installers terminated the cables to the lights. I could drill a hole in the side of the cabinet to take the sma connector if I can find a panel mount one that’s “water resistant”. This would keep the coax length much shorter.

Any signals escaping the Faraday cage are good!

Have you considered reflected signals, either inadvertent or deliberate by putting a sheet of metal to bounce them in the right direction? For interest, monitor the signal strength as you slowly open the metal door, looking for a peak. Check the angle from your device, the door and the remote end when it peaks. Interesting?

Another option: A small wok, with a parabolic reflector to concentrate signals, similar to the satellite dishes on your roof, pointing at your remote WiFi router or access point? Put your device in the focal area. Using a torch at night will help find the sweet spot where the focal point will be. For neatness, cover the whole lot with a large plastic sandwich lunchbox type cover so you don’t frighten people with a death-ray looking device. Combining this with the external antenna previously discussed will be a good solution, possibly overkill. Just put the antenna in the focal point of the parabolic reflector.

It doesn’t have to be huge. The size of your hand should provide an useful boost. The size of the parabolic antennas to receive faint space signals on the Voyager 1 and 2 space probes from Earth are only a 3.7 metres/12 feet across - you only have to go across your property, not a light year away.

See WokFi:

Keep us posted on your different tries to get this working reliably.

Try it first with the antenna free, just hanging out the door with the coax connected and see how directional it is and how much extra signal boost you get in real life.

Use a generous amount of outdoor rated, non-corrosive curing silicone sealant between the base and the antenna over the hole before you do up the screw for a reliable waterproofing solution.