Saturday, December 1, 2018

WSPR Weather Telemetry Beacon

Over the past few months I have been working on a simple weather station to transmit temperature and humidity data via HF Radio. I am using components I already had like an Arduino UNO, serial GPS, Adafruit Si5351 clock, etc.

The first version used JT65 and the JTEncode library with the telemetry encoded into the 13 character message field but I later decided to use WSPR after discovering a telemetry method described HERE and HERE. The key take away for me was the use of call signs starting with zero "0" or "Q". Since I just need to send temperature and humidity I will not be using the suggested more complex encoding method.

Normal WSPR Frame is:

<call sign> <grid> <dbm>

Example:

WA6PZB DM03 13          

My Telemetry Frame is :

<0A0hhh> <Rttt> <dbm>

Example:

0A0CEF RR20 13


I will fix the prefix of the call sign field to 0A0 (you could change the last digit for more channels if needed) then use the next three characters of the call sign for humidity and use the grid field for temperature. The data values will have only 3 significant figures and will be multiplied by 10 to remove the decimal point.

Humidity is encoded with the letters A to Z (A=1,B=2,C=3...,Z=0),  here are a few examples:

35.6 % = times 10 = 356 = CEF   full call sign becomes --> 0A0CEF
50.0% = times 10 = 500 = EZZ    full call sign becomes --> 0A0EZZ
80.3% = times 10 = 803 = HZC    full call sign becomes --> 0A0HZC

Temperature (in Celsius) is encoded with the first two digits using the numbers of the grid and the last digit as letters A to R (A=1, B=2,C=3..., R=0) as the second letter of the grid with the first letter fixed to  "R" since it is not needed , here are a few examples:

19.4 C = times 10 = 194 = D19    full grid becomes --> RD19
20.0 C = times 10 = 200 = R20    full grid becomes --> RR20
23.5 C = times 10 = 235 = E23    full grid becomes --> RE23


The full weather report will be two WSPR transmissions. The first is a normal message (for Identification) followed by the telemetry frame:

0200 7.040165 WA6PZB DM03 13        <-- Identification
0204 7.040165 0A0CEF  RR20 13         <-- Telemetry channel 0

This data can be extracted from the WSJT-X application log directory in the file WSPR_ALL.txt

As mentioned above you could have multiple telemetry channels and as long as you ID every 10 minutes you could fit several more channels. For example:

0200 7.040165 WA6PZB DM03 13 
0204 7.040165 0A0CEF  RR20 13        <-- Channel 0
0206 7.040165 0A1EZZ  RD19 13        <-- Channel 1
0208 7.040165 0A2HZC  RE23 13        <-- Channel 2

Hardware Description

The hardware consists of the Arduino UNO connected to a serial GPS receiver, an Si7021 temperature and humidity sensor and a Si5351 clock generator. The Si5351 generates approximate 10 mW to 20mW and when connected to a Low Pass Filter (LPF) like THIS it will produce a clean signal that can be heard for thousands of miles with a decent antenna. I originally tried a basic DHT11 temperature and humidity sensor but the libraries conflicted with the Si5351 library. The Si7021 sensor is more accurate and works well with the Si5351 and is on the same I2C bus since the default addresses are different.



Software Description

As normal the software took a bit longer. This projects uses multiple libraries and would not be possible without all those great people that built them for us to use (I am just standing on the shoulders of giants!). I am using TinyGPS which makes working with GPS strings simple and of course JTEncode to generate the WSPR messages. I did encounter some issues with decoding my early JT65 messages and came across KJ6FO's blog HERE that fixed my issue (and hair pulling) so I carried that over to the WSPR code as well. Basically I read the GPS and wait for the top of the hour, 10, 20, 30, 40, and 50 minutes past the hour and send my identification WSPR frame followed by my Telemetry frame. The code is far from optimized but it is working for me. I need to make some minor timing adjustments for the start of the first frame and between frames because I actually start processing before the actual times so that the time spent on checking the time and getting the sensor readings give me the lead time to end as close as I can to the exact second (we need to be within +/- 2 seconds).

My version 1.0 code is on Github -->  HERE. I included as many comments as possible to help me and anyone else working with it. I ran this with the Arduino 1.8.0 IDE along with the needed libraries. Just the call sign and grid will need to be changed to use it with the same hardware.


Saturday, August 11, 2018

Projectile Motion with Analog Computers

After some recent study of old Analog Computers HERE I thought I would try to get some feel of how to work with them using a software implementation.

I found the Open Source tool Scilab that has a module called Xcos that is a graphical editor to design hybrid dynamical systems models very similar to the  analog computer functional blocks.

I was interested in the projectile motion problem that the old Heathkit EC-1 was able to do, that is outlined in the manual on page 27. The analog Op Amps were vacuum tubes in a EC-1 !

After spending more than half of my time figuring out the software and how it worked I was able to get something close. Below is the XY plot of a projectile launched at a 80 degree angle with an initial impulse and gravity.


The diagram of the configuration is shown below.
Scilab is a very powerful tool and I have just scratched the surface of its capabilities with the use of the Xcos module. I was running this on a Ubuntu virtual machine so it was not super fast.


I would like to experience this setup on a physical analog computer since the plots are not real-time and are not on a oscilloscope like "in the day". I think I am missing the faster iterations and interactivity of the true analog system with the wiring board, meters and oscilloscope :-)

Friday, August 10, 2018

Simple ADS-B Monitoring

I tried out some Linux software tools on a x86 box with my old USB SDR dongle recently and wondered if I could do the same things with a Raspberry Pi ZeroW since the power requirements are much less than a PC or Laptop.

The SDR tools I was interested in are rtl_433 and dump1080 .

I stumbled across a web resource that was basically using dump1080 on a Raspberry Pi Zero just like I wanted. The difference was that this was a modified version of dump1080 for use with flightaware.

In the end this was a benefit since running a ground station for flightaware gives you free access to a Enterprise account on their site.

I am running this basically 24x7 now with the simple hardware below. The USB battery is constantly being charged from the line as a basic UPS. Unfortunately this USB battery drops the output when charge power is removed or inserted so it is really not a UPS (so the Pi reboots)  but since I am using a dietpi image for the Raspberry Pi, Dietpi is configured to put all the logs in memory and not on the SD card and I believe corruption is minimized. I have observed excellent uptime.


The basic recipe to get this up and running with the above hardware is to install DietPi --> HERE you can script the setup of the Wifi so it can be completely "headless" and no need to fumble with a keyboard and monitor. Then after about 30 minutes you can SSH in and run the below commands and you will be operational.
       

wget http://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.3.0_all.deb
sudo dpkg -i piaware-repository_3.3.0_all.deb
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install -y piaware fail2ban libio-socket-ssl-perl
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
sudo apt-get install dump1090-fa -y
sudo reboot

       
 

Monday, July 2, 2018

More ESP8266 fun

I continue to test and validate the stability of Node Red, MQTT (on Rasp Pi Zero) and SONOFF devices with various firmware loads as a home automation platform.

This past weekend at the TRW Swap Meet I picked up a LoLin V3 NodeMcu Lua CH340G ESP8266 development board for $8 from Tim who is there nearly every month and has many cool Arduino and other micro-controller items. This board is cool because it is a ESP8266, has a built in FTDI USB interface all in a nice break-out board. After doing some quick googling I found many resources to get going with this board. The following are my steps:

1.) Download serial driver for LoLin Board -->  HERE
2.) Configure/check-out the board using the Arduino IDE (I'm using v1.8.1) from this site --> HERE
3.) WebServer to control LED from this site --> HERE
4.) MQTT DHT code  -->  HERE , I then modified it for JSON message format HERE

With step 4, we have our own Arduino IDE based MQTT code running on the ESP8266

I created a Node Red flow HERE to monitor the DHT sensors to chart the message that are sent every minute.

I was able to build this Node Red dashboard.

I am now running ESPurna v1.13.0 firmware on one of my SONOFF basics and so far I believe it is simpler than Tasmota for setup and operation. I am now running it to see how it looks as far as uptime and hangs. I was getting restarts of Tasmota every day or so and recently hard hangs that required me to reset them and reconfigure it back on the network.

Tuesday, April 24, 2018

More SONFF, Node Red, and MQTT testing

Below is my simple lash up of the DHT-11 sensor to the basic SONOFF switch using the unused GPIO. I am powering it via the FTDI board. This works great for the sensor and LED on the SONOFF but does not fully operate the relay. I did this so I could range test the Wifi and actually had it powered by a USB battery pack. The range was great, good signal in the house and back yard.
The Node Red UI screen below shows the use of the chart function to plot the WiFi signal level and DHT-11 temperature. The Node Red code is HERE

Tuesday, April 3, 2018

SONOFF Wireless switches, Node-RED, Tasmota, and MQTT

I have been busy playing with SONOFF wireless switches, both the Basic and the 4CH. I have developed some Arduino IDE based firmware for both devices here on GitHub,

I am also looking at an alternative to OpenHAB for home automation using Node-RED (the coolest software I have ever seen to date) and MQTT Mosquitto all running on Docker. I am running it on a PC with Vagrant but I would like to move it to Raspberry Pi Zero W. The idea being two or more running a Docker swarm for the Node-RED and MQTT services. I want to figure out a way to make it highly available using something like Keepalived. My Node-RED flows are here onGitHub. Today I just loaded the alternate firmware for the SONOFF's --> Tasmota. It is very powerful. So far I got the MQTT mode working with Node-RED and I added a DHT11 sensor (super cool).

Wednesday, January 24, 2018

Digi-Comp I v2.0

This last weekend I built my Digi-Comp I v2.0 which is a replica of a Digi-Comp I which was first released back in 1963.

The Digi-Comp I v2.0 available from Minds-On Toys is made of cardboard verses the plastic of the original. Since originals are hard to come by, this is good alternative. I am still tuning it mechanically but the picture above is basically alternately toggling the A and B flip-flops. It is of course hand operated and the GIF is stop motion without my hand in view :-).

It is great entertainment to researching vintage computing toys and actually being able to own one and build it, to understand it with your own hands is even better.