Friday 12 October 2018

LoRat Trap Monitor. Part 4 - PCBs and Antennas

The PCBs arrived, first from PCBWay and not too long afterwards from OSHPark. They look pretty good. Although the classic purple from OSHPark is interesting, I was pleased I selected white from PCBWay.




More importantly they seem to work. I found that there is an issue with the footprint for the SMD u.FL antenna connector which I have fixed for "next time" and also added some holes for direct antenna wire connection. However I'm unlikely to use the u.FL connector as simply a piece of wire or one of the coil antennas which comes the LoRa modules is likely to suffice. The part I was most concerned about - the SMD footprint for the LoRa module, seemed to be spot on and was not hard to solder - just run a fillet of solder up against every pin and remove any bridges with wick.





After that excitement there was a fairly long gap in this project as I was busy at work and ski season meant we were away many weekends.  All that time I still had my prototype out in the garden attached to a rat trap. Sadly there are no rats around at the moment, in our garden at least. At the same time I do check it from time to time and set it off manually to confirm the batteries are still good and the receiver is still running. There have been no false positives so far.

I wanted to experiment a bit with an antenna on the receiver. It was just sitting in my office with a small coiled antenna but to get the most range out of it I want to have an external antenna, located in the garage. This required the use of a WiFi extender to get a decent WiFi signal out to the garage and the construction of a suitable antenna.

Before I did that I wanted some way to estimate range. To do this I use built simple device using a Arduino Uno and a I2C LCD screen connected to a LoRa module. Code for this is on github. Faced with the difficulty of cutting a square hole, neatly, for the LCD I decided to have an enclosure laser cut out of acrylic sheet. This the first time I've tried anything like this, but it worked out pretty well. I used this box generator to generate the starting point for the design. A couple of bolts and standoffs keep the thing together, although I later added some plastic adhesive around the base.




When the test button is pressed it generates a random number then sends that to the base station and waits for a reply. If it gets the same number back in response then it prints the confirmation of that and the signal strength:




The science of antennas, for LoRa along with other radios, is pretty complicated. There's a lot of information on the Internet, some of it contradictory. I had bought this antenna off Aliexpress but wasn't really convinced it would be a good outdoor solution. In the end I decided to build a quarter-wave ground plane antenna as described here. That site also has a very useful calculator so I could cut fives pieces of single core copper wire taken from a domestic supply type cable and use a SMA->TNA adapter I got off TradeMe. This conveniently has four holes which can be used to bolt on the ground planes.




The pieces of wire are not super straight but I assume that won't matter too much. Along with a home-made 2m coaxial cable my initial tests showed it was slightly better than the antenna I bought off Aliexpress.





The antenna sits neatly on top a piece of 15mm pvc tube which then serve as a mounting post:



Initial tests suggest I get pretty good coverage all around the neighborhood. But I'll be trying to quantify that over the next few days.






A Proton Precession Magnetometer - Part 1: Overview and Polarisation Coil

 A Proton Precession Magnetometer - Part 1: Overview and Polarisation Coil For some time now I've wanted to add a magnetometer to my wea...