ronter
Posts: 429
Joined: Thu Nov 12, 2015 3:11 am

Getting the maximum range from a picoW

Sun May 28, 2023 12:37 am

I have a picoW that I want to put outside. It will connect to a motion sensor that might be as far as 200' from the house. The sensor can connect to the picoW bi-directionally with RS232, or just transmit-only with RS485; the baud rate is 115200. I would prefer the RS232 so that I have some ability to provision the sensor in a live system; with RS485, I have to provision it off-line on another system with RS232. So, basically I need to balance between the picoW being too far from an A/P to get a reliable wireless connection, or a serial RS232 cable run that's too long.

Because it's outside, it has to be in a weatherproof box. I have a PVC box that I've set up for this test. The picoW is mounted upside down on the lid of the box so that the antenna is almost touching the lid. I face the lid towards the WiFi A/P.

For now, I just want to try to find the optimum distance for the picoW where it can operate reliably on wireless; I'll deal with the serial cable later. So far, I mounted a WiFi repeater high in the rafters of the garage, and put the picoW box out in front, about 50'. I get good results with the RSSI in around -66dBm. But then, in that location, a 150' cable to the sensor would probably fail RS232; although totally fine for RS485. When I put the picoW box out over 100', the RSSI drops to less than -80dBm, and the picoW eventually disappears from the network.

Reading the picoW data sheet it says "Adding grounded metal to the sides of the antenna can improve the antenna's bandwidth". I'm not 100% certain I did this correctly. Here's some photos...
IMG_0208-1.jpg
IMG_0208-1.jpg (158.44 KiB) Viewed 1018 times
IMG_0209-1.jpg
IMG_0209-1.jpg (175.91 KiB) Viewed 1018 times
Is this how it's supposed to be done? I don't notice a whole lot better performance after doing this, so perhaps I got it wrong? It's not exactly on the same plane as the antenna - slightly in front of it actually. Is the ground too wide?, not wide enough?

Any thoughts?

ame
Posts: 7797
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Getting the maximum range from a picoW

Sun May 28, 2023 6:31 am

If you have reached the range of your WiFi network then WiFi is not an option. You don't mention how you are powering the unit, but if you're running a wire you might as well run RS485. Is there any reason why you can only send one way? You could run your RS485 link half-duplex.

Even RS232 might work at that distance, if you prefer. Worth an experiment.

Or you could add a cheap PoE board and get power and comms that way. Use a regular Pico and something like an ENC28J60.

I think you should re-evaluate all possible options, including the ones you have discarded.
Oh no, not again.

jayben
Posts: 556
Joined: Mon Aug 19, 2019 9:56 pm

Re: Getting the maximum range from a picoW

Sun May 28, 2023 8:15 am

For this distance, I'd forget about WiFi, and use a sub-GHz module instead, e.g. an HC-12 module, https://www.allaboutcircuits.com/projec ... er-module/

User avatar
bensimmo
Posts: 6286
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Getting the maximum range from a picoW

Sun May 28, 2023 9:23 am

Cannot answer your question, but how much data is being sent over WiFi, you could move to Lora or Zigbee like many have and are (incl Amazon) to send low rate sensor information.
That's if you can't get WiFi (via Powerline?) nearby.

It all depends what the overall purpose is.

Also don't forget better WiFi antenna/setup/position for the AP in the loft. I'm assuming it's only receiving and not sending?

Is it possible in a new board revision to flip the Pico around and get the antenna away from the bulk of metal and wires in the board and just behind it,?

ronter
Posts: 429
Joined: Thu Nov 12, 2015 3:11 am

Re: Getting the maximum range from a picoW

Sun May 28, 2023 4:29 pm

For background, the sensor is a Benewake TFmini LiDAR. Currently I have it configured to create a digital pulse when it detects something that registers above a set threshold. This digital output pin is connected to an XBee that communicates with an XBee network controlled by a pico, that's then hard wired to a central rPi home automation controller. There are other XBee slave devices in this setup, and 200' is no problem for the XBee.

For power, I'm using 12VAC from a landscape lighting transformer. The wire ( 2 conductor 16 ga. ), is buried a few inches, but I can pull it up and move it if need be.

This works most of the time, but the sensor is fooled by conditions like snow, rain, etc. It sometimes even misses valid detections. So, rather than use the simple digital output of the TF-Mini, I would like to receive the serial raw data and process it heuristically. I tried using the XBee network to deliver the raw samples at the high report rate, but it seemed to overwhelm it. Slowing down the report rate might mitigate that, but I concluded that putting a processor at the source of the sensor would be more efficient. A regular pico would work fine for this; I have it set up on the workbench, and it seems to do the job. The real test would be putting it outdoors.

Given that it's still rather experimental, I might want to upload new firmware, or even just change configuration parameters. This is where the picoW comes in. I have implemented Telnet to do command line configuration changes, and TFTP to upload new firmware. Without the WiFi capability, I would have to fetch the pico and bring it inside every time to change the configuration or firmware.

I'm trying to do this on a budget, i.e. use things I already have. I have a mostly full 500' reel of communication cable that's two individually shielded twisted pair wires; 5V/GND on one pair and 'comms' on the other pair. If RS232, that would be bi-directional Rx/Tx; if RS485, just one way +/- differential. Another option I just thought of might be to put a repeater on the RS232 at the half-way point. That part I'm not so concerned about, it's the RF voodoo that's a big mystery to me.

So, I will try different techniques of mounting a ground plane around the picoW. I think copper might be best material, but until I can find some copper foil cheap, I'll be cutting up an aluminum pie tin. :roll:

Also, forcing my WiFi repeater onto ch1 is a good idea, thanks @MatSOBDev.

ronter
Posts: 429
Joined: Thu Nov 12, 2015 3:11 am

Re: Getting the maximum range from a picoW

Sun May 28, 2023 8:36 pm

Much success !

I changed the grounded metal to stick to the carrier board with 2-sided tape; now it's behind the plane of the picoW antenna - if that matters?
I think that a local electronics store sells 1-side copper clad blank circuit boards; not too expensive. I'll see if I can get one of those and cut it out to fit around the picoW, & glue it to the carrier board - but in the meantime, the pie-plate will do.
IMG_0210-1.jpg
IMG_0210-1.jpg (192.96 KiB) Viewed 784 times
Using my phone, I mapped out the WiFi reception along the route, and found a point ~100' from the A/P that had no line-of-sight obstructions ( trees ); it read in the -60's RSSI. I put the picoW box there, and it appeared on my network. I connected to it with Telnet and queried the network WiFi; it was channel 9 , -67dBm. Unfortunately, I can't change the channel of just the repeater; I can only do that at the router. I'll leave it at "auto" for now.

That -67 level should be fine, if it stays around that. I'll let it run for a few days before doing any more cabling for RS232/485. But this is encouraging.

ghp
Posts: 3412
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany

Re: Getting the maximum range from a picoW

Sun May 28, 2023 8:55 pm

With one of the first picoW I got I walked down the street, the AP in line of sight. A small program sent telegrams which toggled LED on pico. Reached 45m with this setup.

With a 915MHz Adafruit RFM69, I reached 70m with two buildings brick/concrete in between.

ame
Posts: 7797
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Getting the maximum range from a picoW

Sun May 28, 2023 9:17 pm

ronter wrote:
Sun May 28, 2023 4:29 pm
For background, the sensor is a Benewake TFmini LiDAR. Currently I have it configured to create a digital pulse when it detects something that registers above a set threshold. This digital output pin is connected to an XBee that communicates with an XBee network controlled by a pico, that's then hard wired to a central rPi home automation controller. There are other XBee slave devices in this setup, and 200' is no problem for the XBee.

For power, I'm using 12VAC from a landscape lighting transformer. The wire ( 2 conductor 16 ga. ), is buried a few inches, but I can pull it up and move it if need be.

This works most of the time, but the sensor is fooled by conditions like snow, rain, etc. It sometimes even misses valid detections. So, rather than use the simple digital output of the TF-Mini, I would like to receive the serial raw data and process it heuristically. I tried using the XBee network to deliver the raw samples at the high report rate, but it seemed to overwhelm it. Slowing down the report rate might mitigate that, but I concluded that putting a processor at the source of the sensor would be more efficient. A regular pico would work fine for this; I have it set up on the workbench, and it seems to do the job. The real test would be putting it outdoors.

Given that it's still rather experimental, I might want to upload new firmware, or even just change configuration parameters. This is where the picoW comes in. I have implemented Telnet to do command line configuration changes, and TFTP to upload new firmware. Without the WiFi capability, I would have to fetch the pico and bring it inside every time to change the configuration or firmware.

I'm trying to do this on a budget, i.e. use things I already have. I have a mostly full 500' reel of communication cable that's two individually shielded twisted pair wires; 5V/GND on one pair and 'comms' on the other pair. If RS232, that would be bi-directional Rx/Tx; if RS485, just one way +/- differential. Another option I just thought of might be to put a repeater on the RS232 at the half-way point. That part I'm not so concerned about, it's the RF voodoo that's a big mystery to me.

So, I will try different techniques of mounting a ground plane around the picoW. I think copper might be best material, but until I can find some copper foil cheap, I'll be cutting up an aluminum pie tin. :roll:

Also, forcing my WiFi repeater onto ch1 is a good idea, thanks @MatSOBDev.
Excellent summary. Thank you.

RS485 is bidirectional, but half-duplex.
Oh no, not again.

User avatar
GTR2Fan
Posts: 1968
Joined: Sun Feb 23, 2014 9:20 pm
Location: South East UK

Re: Getting the maximum range from a picoW

Sun May 28, 2023 9:23 pm

ronter wrote:
Sun May 28, 2023 8:36 pm
Much success !

I changed the grounded metal to stick to the carrier board with 2-sided tape; now it's behind the plane of the picoW antenna - if that matters?

Make a note of the dimensions and precise positioning of your current solution just in case a "better" solution makes it worse as you may have accidentally made a suitable cavity-backed slot antenna of sorts.
Pi4B 2GB Rev1.4 Mini-PC/Media Centre: ARM=2.25GHz @1.1v, Core=600MHz, GPU=850MHz. Raspberry Pi OS with KODI on 128GB Sandisk Extreme Pro A2 microSD card in Integral card reader in USB3.0 port (138MB/s read). Geekworm P173 case with copper shim on SOC.

DarkElvenAngel
Posts: 2724
Joined: Tue Mar 20, 2018 9:53 pm

Re: Getting the maximum range from a picoW

Sun May 28, 2023 9:27 pm

I did a design with the Pico W and I was advised by dp11 to
Make sure there is no copper under the antenna.
I did some design revisions and I think some of your range issue are do to having copper where it should not to be.

Based on the orientation of your Pico you have a problem as I was advised again by dp11
Please remove all copper between the Pico W and the edge of the board otherwise the WiFi performance will be reduced.
My final board design is here You can see I how much I had to remove. I've tested this board and it the range isn't bad I don't have exact figures but I was able to stay connected to the AP for well over 200 ft while the AP was in the front room of my home on the second floor. I don't know how stable the connection was as I was testing for the ability to reconnect, and data was logging back to the server. I think you need a board redesign and leave out the Pico's debug pins since you don't need them.

ronter
Posts: 429
Joined: Thu Nov 12, 2015 3:11 am

Re: Getting the maximum range from a picoW

Sun May 28, 2023 11:15 pm

ame wrote:
Sun May 28, 2023 9:17 pm
RS485 is bidirectional, but half-duplex.
Yes, that's true. The TFmini has only LVTTL serial async. There's no handshake signals that could be used to turn-around the RS485 ina half duplex mode; it assumes that something is always listening to its Tx while it's always listening to its Rx. I have a little board that can be populated with either an RS485 or RS232 driver chip to convert from LVTTL.

ame
Posts: 7797
Joined: Sat Aug 18, 2012 1:21 am
Location: New Zealand

Re: Getting the maximum range from a picoW

Sun May 28, 2023 11:17 pm

ronter wrote:
Sun May 28, 2023 11:15 pm
ame wrote:
Sun May 28, 2023 9:17 pm
RS485 is bidirectional, but half-duplex.
Yes, that's true. The TFmini has only LVTTL serial async. There's no handshake signals that could be used to turn-around the RS485 ina half duplex mode; it assumes that something is always listening to its Tx while it's always listening to its Rx. I have a little board that can be populated with either an RS485 or RS232 driver chip to convert from LVTTL.
Ah. Got it.
Oh no, not again.

ronter
Posts: 429
Joined: Thu Nov 12, 2015 3:11 am

Re: Getting the maximum range from a picoW

Sun May 28, 2023 11:48 pm

GTR2Fan wrote:
Sun May 28, 2023 9:23 pm
Make a note of the dimensions and precise positioning of your current solution just in case a "better" solution makes it worse as you may have accidentally made a suitable cavity-backed slot antenna of sorts.
Will do. Success is a destination; I don't mind that I arrived there via blunder rather than by carefully executed plan.

Before retirement, I worked for a company with RF engineers on staff. Listening to these folks at design meetings made me realize just how little I knew about antennas and such. At one point they asked our software team to 'dither' any tight loops because they generated harmonics that bled through the RF and created out-of-band spurs. Makes sense, but who would have thought about that if not an expert?
DarkElvenAngel wrote:
Sun May 28, 2023 9:27 pm
I did a design with the Pico W and I was advised by dp11 to
Make sure there is no copper under the antenna.
I only have a few thin traces under the antenna on a two layer board. Most of these traces don't even go anywhere because I didn't populate several components under the picoW. I don't have a large ground plane or ground layer. I only started 'monkeying' with this grounded metal because the pico W datasheet suggested it ( sect 2.2.1 ). There were no specifics on how wide it should be, or where exactly it was to be placed. I thought perhaps someone here knew if there may be some special requirements - like the width must be an integer fraction of the wavelength or some such other RF law.
MatSOBDev wrote:
Sun May 28, 2023 10:12 pm
You can test bare Pico W with shield combinations. Height above ground matters as well.
I started this experiment by putting a naked picoW in a zip-lock bag with a 4AA NiMH power pack. I hung it at eye level on a tree ~25' from the A/P. The results were poor; I have no idea why. Maybe I can repeat this test with the shield, but ultimately I need some kind of carrier board for my DataFlash and RS232/RS485 converters. I really don't want to do a whole new board spin for what ultimately will be a "one-of".

DarkElvenAngel
Posts: 2724
Joined: Tue Mar 20, 2018 9:53 pm

Re: Getting the maximum range from a picoW

Mon May 29, 2023 2:29 pm

ronter wrote: I only have a few thin traces under the antenna on a two layer board. Most of these traces don't even go anywhere because I didn't populate several components under the picoW. I don't have a large ground plane or ground layer. I only started 'monkeying' with this grounded metal because the pico W datasheet suggested it ( sect 2.2.1 ). There were no specifics on how wide it should be, or where exactly it was to be placed. I thought perhaps someone here knew if there may be some special requirements - like the width must be an integer fraction of the wavelength or some such other RF law.
I was not able to get that information, only by posting redesigns of my board did I find out if I did something wrong. I was hoping to get an idea of how big such a keep out area should be since I want to do a redesign I've seen some other designs use cut outs for the wireless modules under the antennas. There was a post about a maybe designing a Pico W to use the external raspberry Pi WiFi Antenna that would be very useful who knows if that would ever be.
MatSOBDev wrote: Sun May 28, 2023 6:12 pm
You can test bare Pico W with shield combinations. Height above ground matters as well.
When I tested my board I was walking and held my board at chest height and over my head (people passing must of thought it was strange)

Ah forgot something have you turned the power management stuff off and turned the power up? I did all this to keep my cheap USB power bank from shutting off.

Return to “General”