Friday, 27 May 2016

The New Antennas

Alongside working on a new tracker, I thought I could upgrade the receiving side of my equipment as well. And so this blog will document that endeavour. My initial objection was against my 9 element YAGI's length which made it difficult to fit inside a car. Browsing the web for a replacement candidate, I came across a HELIX antenna that caught my eye. Promising sufficient gain, wide bandwidth and circular polarization (which might help with a constantly swinging an moving payload) I got my winner. I also liked it visually and wanted to try working with something more than just a bunch of rods.
 
First I modelled it in 4NEC2. I decided for 4 turns of 23.1cm in diameter each with 17.43cm spacing as the antenna was intended for 434MHz. The reflector was an octagon measuring 55cm from side to side. From reflector to the end of the helix the antenna measured 69.7cm while requiring 298.6cm of tubing for the helix. The picture above shows the model of the antenna in free space.
With a real ground added to the model (the antenna hovered 1.3m above ground), the expected radiation pattern changed a little increasing gain in the forward lobe from 11.7dBi to 15.9dBi.
I also tried modelling the antenna at an angle (45°) to get some sense of what it would do to the radiation pattern.
The last model shows the pattern for the antenna pointing directly upwards. Based on other people's experience with real life helix antennas I'd take these calculated gain numbers with a grain of salt.
For the helix I used 3m of 6mm hand bendable copper tubing. The reflector utilized 55x55cm of 1mm aluminium plate. The skelet was made of wooden rods and a square log.
This way of mounting asked for a few pieces of plastic tubing to hold the wood together where the screws went in.
 The rods fit the drilled holes precisely and didn't need any additional fixing or gluing.
Hand bending the copper tubing to fit the exact dimensions took quite some time but in the end the result was satisfactory.
 With scissors for cutting metal shaping the reflector was just a matter of minutes.
At this point, it became obvious that the antenna was going to be quite heavy. Something I hadn't considered.
Nevertheless, I went on with the assembly.
The helix was soldered to an SMA female connector that was bolted down through the reflector.
As for matching the antenna, I came across an easy method called Wavetrap (described in this thread IBCrazy's Wavetrap). All that was necessary was to cut a rectangle (I used a piece of copper plated PCB material) of 1/8 wavelength by 1/16 wavelength and solder it to the helix starting at 1/16 wavelength from the connector. For 434MHz the dimensions used were 8.64 x 4.32cm and starting at 4.32cm from the connector.
As I mentioned, the weight of the antenna made it impossible to use it with just a tripod. Here it is fitted with a temporary solution, but I am yet to come up with something more reasonable.


That led me to reconsider using a YAGI again, but this time just a small, more utilizable one. My former yagi was just a coax cable attached straight to the driven elements. This time I thought I would look for a properly matched design.
I started by modelling the thing in 4NEC2 again. This time I tried including the aluminium tripod in the model as well to see what impact it would have on the radiation pattern. I decided for just 3 elements to make it easy to carry and use on foot. The initial dimensions were 36.2cm for the reflector, 36.2cm for the dipole and 33.0cm for the director. The spacing between the director and the dipole was 4.8cm and 12.1cm between the dipole and the reflector.
For comparison, I modelled it in vertical polarization configuration as well. That decreased the gain in the strongest forward lobe from 12.6dBi to 11.3dBi. Once again I had reservations about seeing these numbers in the real world.
The materials used for the construction were 2.5mm brass rods for the elements. A wooden square log for the support.
Then 2 pieces of 75Ω coaxial cable 1/4 wavelength long. These were soldered in parallel (as described in The DK7ZB Match for Yagis) to accomplish a 37.5Ω line impedance to match the Yagi's expected 28Ω impedance to the standard 50Ω impedance.
A female SMA connector on its mount that I made out of the remaining aluminium bits and pieces I had from the Helix antenna.
I needed something to hold the driven elements since they couldn't be held in place by running them through the wooden mount like the other two. I had to improvise a little bit and cut this piece of plastic out of a scrap soap dispenser.
The main frame was done. Time to solder the remaining bits.
A look on the final implementation of the matching bit and the connector.
The completed antenna.


Having the 70cm band secured, I turned my attention to the 2m band since I had been interested in APRS for quite some time and I intended to equip my upcoming tracker with APRS capabilities as well.
I didn't want to do anything special here. Just a simple DIPOLE. Once again I tried modelling it first to get a grasp of the radiation patterns. First in vertical polarization mode.
Second in horizontal polarization.
The used materials were very similar to the yagi. Only the brass rods were 4mm in diameter this time. Since the rods were sold in 1m lengths, I simply cut one in half.
To mount the rods on the wooden square log, I used a similar solution to the yagi one. However this time, I had to add a few reinforcements since the rods were somewhat heavier.
With the antenna in my room and after some fiddling about with SDR#, the packets from nearby stations started to decode.


Another thing I added to my setup was a low noise amplifier built around ERA-3SM+. The datasheet promised DC-3GHz bandwidth with gain of 23.4-16.4dB across this range. Based on the specific parts I chose, the range of my implementation should be between 17-480MHz. For anyone interested: LNA v1.0.sch and LNA v1.0.brd.
Newly I noticed that the PCB manufacturer OSH Park offered the lowest price for a small order of 3 boards. In combination with free shipping the cost for these boards was about $5 while the delivery took about 3 weeks to the Czech Republic (based on the post office I assume they manufacture in the US).
As can be seen on the antennas and here on the LNA, I decided to utilize SMA connectors on all of my setups. There are all sorts of variations on EBAY for a reasonable price.
Here is the LNA almost complete. It was an opportunity for me to practise SMD soldering with a hot air soldering station for the first time. I had to, because I knew I would have to tackle much more soldering of tinier components on the upcoming tracker.


One thing that kept bothering me about the antennas was that I didn't have a clue whether they were tuned to the frequency I intended them for. I had seen people using expensive antenna analyzers, vector network analyzers, a few to improvise with an oscilloscope and a directional coupler, but all these options were out of my reach. A bit of googling eventually led me here: SWR meter - Do it yourself project. The thread describes a simple diode probe that in conjunction with a directional coupler and a voltmeter can measure the forward and reflected voltages between a transmitter and an antenna. The original device was intended for FPV stuff in the 1.2, 2.4 and 5.8GHz ranges, but I thought I could try replicating it for the 434MHz band. First I ordered this directional coupler that was supposed to work for 1-1000MHz.
Second I soldered up the probe. A 1kΩ resistor, a 100nF capacitor and a diode. Here I had to choose a different model, because the HSMS-286 from the original thread was designed for 915MHz-5.8GHz range. I went for HSMS-2820 instead.
Next I needed a transmitter. It turned out that despite being a crap high altitude balloon tracker I could have another job for my TT7-40. The RFM22B provided a band of frequencies between 413 and 490MHz which I could use for a sweep.
A couple of modifications later (an SMA connector on the output of the transmitter, two Ublox pads used for serial communication) I had something useful.
The programming and communication now utilized a USB to TTL converter and didn't require the SPI interface. The original device used a voltmeter to measure forward/reverse voltage at one frequency. I thought I would program TT7-40 to quickly sweep a whole band of frequencies and measure the diode's output via an analog input of the ATmega. Then output the data on the serial port. I wrote the script quickly in Arduino IDE so for anyone interested: TT7_40_SWR_Meter_1.ino.
To test an antenna one would connect the RFM22B to the IN port on the directional coupler, the antenna to the OUT port and the probe to the CPL port. That would measure the forward voltage at a specific frequency. Then one would switch the ports (IN - antenna, OUT - RFM22B) and measure the reverse voltage. Using the formula:

SWR = (1 + REVERSE / FORWARD) / (1 - REVERSE / FORWARD)

One would arrive at the Standing Wave Ratio of the system at a specific frequency. Sweeping a band of frequencies, one could draw a curve and possibly see it dip indicating the frequency the antenna was tuned to.
I took the antennas and a tripod outside and started with the yagi. I intentionally made the driven element a little longer so I could shorten it while measuring the effect on the SWR curve.
Here are the curves for 6 measurements I made indicating the length of the driven element. I didn't rely on the absolute value of the numbers with this cheap approach too much and rather focused on the progression of the curve. The blue curve representing the original dimension seemed to dip towards the left side of the spectrum as expected for an antenna electrically too long. So I started cutting and observing the dip moving towards my intended frequency. However, after the fourth cut (second blue) the driven element was now shorter then the director and the frequency response deformed. Afraid I cut too much, I shortened just the director and saw the dip (orange) to appear at 442MHz. Apparently, I was too eager with the cutting and ended up with a not exactly tuned antenna.
I also, perhaps to late, realised that it would have been better to do the measurements at the antenna without the addition of 3m of coaxial cable. I at least made one for comparison. If the numbers were any good in an absolute sense, at 434MHz I might have still been at 1.71:1 SWR. Unfortunately, I didn't have any other meter for reference so, who knows with this thing. The final yagi dimensions were 362mm for the reflector, 310mm for the driven element and 314mm for the director.
I also modelled it again in 4NEC2 to see the impact of the cuts on the radiation pattern.
The helix underwent the same test, however, I initially couldn't measure any reverse voltage. Only after I added an amplifier at the probe's output, I could get something out of it. I am not sure how to interpret this result. A helix promises a wider bandwidth, so to deduce something out of this I would probably need a wider sweep than just 413-490MHz.
Just to see what would happen, I tried sweeping a simple piece of 148mm wire stuck inside the SMA connector. Considering it to be 1/4 wavelength long would make its resonant frequency to be at 506-7MHz which is towards what the incomplete curve seems to be dipping.


One last thing to do was to verify that the antennas could actually receive something at a distance. I placed a transmitter in the garden and set off to my traditional testing spot about 4.7km away.
The 434MHz signal was nice and strong with the yagi.
Having no other means of testing the LNA's performance but with an actual signal, I tried plugging it in. Unfortunately, it seemed that the LNA instead of increasing the signal mainly just increased the noise floor. Perhaps I should have made it with a bandpass filter for just a narrow bandwidth.
The dipole performed somewhat worse, but that was expected since it was designed for a different frequency.
The LNA's impact on the dipole was similar to the yagi.
For comparison, I tried plugging in the standard whip antenna that comes with the SDR dongle. Its performance was comparable to the dipole's.
Last but not least the helix antenna.
After connecting it, it was immediately evident that the helix had the biggest gain of them all.
And the LNA's effect.

In summary, I gained three new antennas. Two are proven to work and ready to be used (yagi and dipole).
The third one (helix) works nicely as well, but I will have to come up with a sensible way of mounting it and I will reserve it for home use.
On the other hand the accuracy of the antenna analyzer would deserve some comparison to know what to think about the data.
And the LNA might benefit from further testing and tinkering about as well.

Monday, 21 March 2016

The Solar Experiments

After my first HAB launch, due to all the excitement, ideas what to do next were coming to me all at once. One very interesting to me was doing a pico flight. Light weight payload, custom or Qualatex balloon and having it all float around the world for several days, hopefully weeks. That meant a different approach to supplying power to the tracker and thus about a year ago, while still working on TT7-40, I ordered a bunch of solar cells from Ebay and started experimenting.
The cells I got are polycrystalline and come in a variety of sizes. Mine are 52x26mm and are advertised as to output 0.5V open circuit voltage and 0.43A short current in direct sunlight. I usually measured about 0.6V per cell and thus 1.2V for two cells and about 2.4V for four cells. These were the panel sizes I generally worked with.
I started with simple setups just measuring loaded current and voltage. Here it is a 1.2V Eneloop rechargeable battery with a diode in series to cut off the current going back to the solar panel when it wasn't lit.
The same setup in full sunlight measuring 230mA charging current.
As the next step, I tried connecting a MCP1640 step-up converter, as used on TT7-40, to the cells to boost the voltage to a stable level. The problem with this solution is that a simple converter like this requires a sufficient level of power on the input or the voltage collapses which limits its usability to cloudless skies with direct sunlight.
The current output after boosting the panel's voltage from 2.4V to 3.15V.
That issue led me to search for a dedicated solar harvesting converter. LTC3105 (on the left) is capable of working off of voltages as low as 225mV and implements MPPC (maximum power point control) to accommodate the output current to the changing solar irradiance while maintaining the same output voltage.
Initially, I set the circuit up on a breadboard.
However, it constantly had trouble performing up to the degree the datasheet stated is achievable. Even with 4 solar cells and direct sunlight the unit kept outputting very little current.
Eventually, I concluded that the circuit is too sensitive to precise values and quality of external components to be set up on a breadboard with all it's additional resistances, inductances and capacitances. I then decided to design a dedicated PCB. Since all of this was a preparation for my future tracker, I added TPS63031 boost converter to create a complete power supply solution that would output 3.3V.
These are the boards I ordered from DirtyPCBs as usual. There is a possibility to change between 90k and 180k resistance on the MPPC pin of the LTC3105 using a jumper to adjust the voltage reference for operating off of 2 or 4 solar cells (or simply solder on a different resistor). I also equipped the boards with jumpers to disconnect both LTC3105 or TPS63031 from the battery so I can test or use them separately. One issue I did not notice while designing the boards was that I didn't enable the TPS63031's power save mode. This meant that the boost converter consumed about 3mA without load. That is a little unfortunate, because it limits its usability as a stand-alone system. The tracker version has the power save mode enabled.
The LTC's output is set to 4.2V to be able to charge a LiPo battery. Here it is connected to an ATmega328P powered data logger that I put together to get some longer-term data of its performance.
This was an initial version that besides the ATmega used an 8MB SPI flash memory (W25Q64BV) and a logic converter to communicate with an Arduino Mega that then transmitted the data to a PC.
I wanted the logger to measure the charging current as well, but I ran into trouble achieving that. The circuit ran 3.3V logic that resulted in 3.2mV resolution of the ATmega's ADC which wasn't sufficient for small currents. I then tried to amplify the voltage drop across a shunt resistor with a variety of amplifiers, but probably because of my inexperience in this area the results weren't satisfactory.
INA219 current sensor came to me as an ideal solution, however, none of the three modules I received from Ebay worked. I suspect that I might have damaged the first one with my clumsy soldering, but that made me extra careful the next time and for the third attempt I didn't even solder the pins to eliminate the possibility of an error on my side. I simply connected 5V (which was within specs) to VCC and ground to GND and the chip immediately burned out both times. That quite baffled me and I still don't know whether to suspect the seller from selling a damaged series or whether despite all the precautions I screwed something up. In any case, I gave up on INA219 and tried to get a better resolution by using ATmega's internal 1.1V reference instead. That immediately brought me to another problem. A virtually identical script that utilized the internal reference ran nicely on an Arduino Nano, however, refused to work on my breadboard ATmega (both being ATmega328P). The ADC worked fine when referenced to the supply voltage, but the internal reference output only zeroes.
After declaring the particular internal reference dead, I finally received an Arduino Pro Mini and a 3.3V compatible USB to TTL converter. That allowed me to simplify the logger and make pulling the data out much easier.
The final Data Logger version runs at 3.3V off of the Arduino's regulator. It is programmed and communicated with using the 3.3V compatible USB to TTL converter. At startup it waits for 5 seconds for a command to enter a communication mode or else it continues to normal data logging. In the communication mode it allows the user to choose between logging every 0.25s or 8s. I wanted to have a high frequency mode and one for long-term operation. The settings are saved in ATmega's EEPROM just like the address of the last data logged to the flash memory so the logger can resume logging after power down without erasing the flash.
The logger implements a power down mode in between individual logs to minimize consumption. To push the current consumption even lower I removed the power LED on the Arduino (about 1.5mA reduction in consumption). To reduce the consumption even further, there is the possibility of removing the Arduino's regulator. I didn't do this because I needed stable 3.3V for the flash memory and even with the regulator the consumption goes down to about 50uA in power down mode (as far as my lousy multimeter can tell).
This particular implementation logs voltage of the solar cells and voltage of the LTC3105's output (which connects to a battery when charging). The third ADC measures the voltage drop across a 1 ohm shunt resistor on the low side of the battery thus allowing to compute the current flowing into the battery. All ADC conversions are referenced to the internal 1.1V which means it is capable of measuring the current with 1mA resolution. The voltages from the solar panel and LTC are divided by two pairs of resistors. The logger saves the values in raw format leaving the conversion to after the data being downloaded to a PC. I set up the flash to expect 4 channels of data so having one spare, I connected a DS18B20 temperature sensor to the whole thing as well. The flash memory is 8MB, the ADC readings are 16bit each and having 4 channels results in 1.000.000 samples capacity. I'd like to provide more information about actual power consumption but I am not in possession of any proper multimeter. The power down consumption was measured to be 56uA, however, I can only estimate the active consumption to about 3-4mA, because the power on time is too short for my multimeter to give any sensible readings. I also estimated the active time to about 18ms with 8s logging interval and 14.4ms with 0.25s interval on average, but when I took the overall time I let the logger run and divided it with the number of samples on the flash, I arrived at 358.8ms and 30.6ms respectively. It's hard to analyze it any better without probing it properly.
This is a two day log of charging a 330mAh LiPo battery in sunny weather by 4 solar cells. The left axis is in millivolts and belongs to the BLUE line (solar panel voltage), RED line (LTC3105 output with a connected LiPo battery) and GREEN line (charge current - voltage drop across a 1 ohm resistor thus the axis shows milliamps in this case as well). The right axis is in °C * 1000 (because of Excel taking forever to display that many floating point values) while the PURPLE line shows temperature. I didn't shield the temperature sensor from direct sunlight so the readings get affected by that, but the night time data should be accurate. Also, I didn't do any calibration so the conversion of ADC readings to actual voltage uses voltage divider coefficients as calculated not as measured.
This is the charge current (mA) alone for better distinctness. As can be seen the LTC3105 on a PCB finally performs as it should.
This is about an hour and a half of data sampled every 250ms with the LTC's output connected directly to the shunt resistor (no battery to charge). It was taken in sunny weather during morning so the voltage on the solar cells stabilizes a little later.
In this case, I set the MPPC resistance to 90k ohms which according to the datasheet is adequate for two solar cells (I was using four). The current without load (other than the 1 ohm shunt) eventually stabilized around 180mA.
The same conditions on the same day. Only this time I set the MPPC resistance to 180k. This should be the proper setting for four solar cells, however, the resultant current fluctuates around 150mA only. I guess the MPPC setting is aimed at worse weather conditions.
This time with added discharged battery and a 90k setting. Charging current of about 100mA is what I was looking for and should be more than enough for a HAB application.
All the four previous data sets were taken in succession during one day with stable sunshine. This last one suffers a little from the late hours and the fact that I didn't discharge the LiPo as I had done in the previous case. That meant that the battery was already in the lower current part of the charging cycle. This was again the 180k MPPC setting.
This is an example of charging the same 330mAh LiPo in cloudy conditions with occasional sunshine (mainly on the third day). All three days contributed somewhat as can be seen from the voltage curve.
I am a little confused by the low levels of current in comparison to the high voltage rise on the first day. I understand that the LiPo battery initially builds up the voltage during the charging cycle, but I would expect that happening with more current than recorded.

To conclude, I consider this power supply solution adequate for my upcoming tracker. Hopefully, the TPS63031's power save mode will reduce the standby current to reasonable levels. I intend to do more tests with only two solar cells (or different sizes) so the tracker doesn't have to carry all four.

For anyone interested, here are the EAGLE files of the LTC3105 and TPS63031 PCB:
LTC3105 v1.0.brd
LTC3105 v1.0.sch
and here is the Solar Logger script:
AVR_SOLAR_LOGGER_MINI_2.cpp