Sunday, October 07, 2018

Skylab SKM52 - C&Q 84 - GPS module

Had this Skylab SKM52 GPS module for some time, in the past I tested it but nothing special made with it.


 Another ref/name for the module is: C&Q 84

Data-sheet here:

Original idea was to use the pps output to discipline another oscillator but no need for the moment.

This is the pps out:

Lat/Lon display:

Time display:

Interesting enough I could never see the $GPZDA (date and time) ever coming out of the module (during debug output) as on the spec data-sheet, this display of data is just taken from the normal output string. ZDA string would give the microseconds.... probably not implemented.

The code made will scroll alternately between the the values of position and time.

Connections and module view:

Vcc   - Arduino 3v3 output
RX    - Arduino D4 (softserial)
TX    - Arduino D3 (softserial)
GND - Arduino GND
PPS out: connect to a LED with a resistor. PPS only outputs when there's a stable GPS signal.
Pin 10 on Arduino to a 1k resistor then anode of LED, cathode to ground and this will indicate a GPS fix


////////////////// code here bellow
 // read the SKM52 Skylabe GPS module (C&Q 84) via softserial and dumps lat/lon/time on the Arduino nano USB
// pin D3 on Arduino to TX and D4 to RX on the GPS module
// power to module from the 3v3 output on arduino.
// CT2GQV 20180922

// initialize the library with the numbers of the interface pins
#define I2C_ADDR    0x27
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7
LiquidCrystal_I2C       lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);


unsigned long fix_age;

SoftwareSerial GPS(3,4);
TinyGPS gps;
void gpsdump(TinyGPS &gps);
bool feedgps();
void getGPS();
long lat, lon;
float LAT, LON;

int fix_detected=0; // no fix yet

int year;
byte month, day, hour, minutes, second, hundredths;

//For the dual display
long previousMillis = 0;
long interval = 3000; // 3 seconds
int a = 60;

void setup(){
  pinMode(10, OUTPUT);
  lcd.begin(16, 2);
  lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); // init the backlight
  lcd.setBacklight(1);        // Backlight on


void loop(){
  long lat, lon;
  unsigned long fix_age, time, date, speed, course;
  unsigned long chars;
  unsigned short sentences, failed_checksum;

  gps.get_position(&lat, &lon, &fix_age);
  gps.get_datetime(&date, &time, &fix_age);

  // do we have a fix or not
  if (fix_age == TinyGPS::GPS_INVALID_AGE) {
    Serial.println("No fix detected");fix_detected=0;
    digitalWrite(10, HIGH); delay (1); digitalWrite(10, LOW);
  } else if (fix_age > 5000) {
     Serial.println("Warning: possible stale data!");fix_detected=1;
    digitalWrite(10, HIGH); delay (10); digitalWrite(10, LOW);
  else  fix_detected=2; //Serial.println("Data is current.");
  // lcd.setCursor(0,1); lcd.print("fix: "); lcd.print(fix_detected);

  if (fix_detected==0 ||  fix_detected==1) {lcd.setCursor(0,0); lcd.print("WAITING FIX!!");};

// fix_detected=2; // for debug only to see output even without fix

  if (fix_detected==2) { // let's print gps data
    digitalWrite(10, HIGH); // set the green LED to allways on
   Serial.print("Lat : ");      Serial.print(LAT);
   Serial.print(" :: Lon : ");  Serial.print(LON);
   gps.crack_datetime(&year, &month, &day, &hour, &minutes, &second, &hundredths, &fix_age);
   Serial.print("::"); Serial.print(year);
   Serial.print("-"); Serial.print(month);
   Serial.print("-"); Serial.print(day);
   Serial.print("T"); Serial.print(hour);
   Serial.print(":"); Serial.print(minutes);
   Serial.print(":"); Serial.print(second);

   // every interval print the lat
   unsigned long currentMillis = millis();
   if (currentMillis - previousMillis > interval) {
    previousMillis = currentMillis;
    lcd.setCursor(0,0); lcd.print("Lat:"); lcd.print(LAT);
    lcd.setCursor(0,1); lcd.print("Lon:"); lcd.print(LON);
   lcd.setCursor(0,0); lcd.print("                ");
   lcd.setCursor(0,1); lcd.print("                ");
   lcd.setCursor(0,0); lcd.print(year); lcd.print("-"); lcd.print(month); lcd.print("-"); lcd.print(day);
   lcd.setCursor(0,1); lcd.print(hour); lcd.print(":"); lcd.print(minutes); lcd.print(":"); lcd.print(second);
   // no NMEA sentences see where it displays the hundreths...
   // probably needs module programing, says on the manual that outputs the $GPZDA date and time...
   // manual
   //  Serial.print("."); Serial.print(hundredths);
  }; // endif fix detected

void getGPS(){
  bool newdata = false;
  unsigned long start = millis();
  // Every 1 seconds we print an update
  while (millis() - start < 1000)
    if (feedgps ()){
      newdata = true;
  if (newdata)

bool feedgps(){
  while (GPS.available())
    if (gps.encode(
      return true;
  return 0;

void gpsdump(TinyGPS &gps)
  gps.get_position(&lat, &lon);
  LAT = lat;
  LON = lon;
    feedgps(); // If we don't feed the gps during this long routine, we may drop characters and get checksum errors

//////////// Have a nice week!

Saturday, September 15, 2018

New AD8307 power meter

Having done previously two power meter's based on the AD8307, with analog display and with computer interface, decided to build one other unit more self contained and with a ref calibrator included.

Here's the outcome:

The circuit is a simple one:

Taken from here.The AD8307 output is connected to an Arduino analog input and computation is done in software, with output to the LCD and usb line.

Build process here:

 The slug repellent tape is excellent for RF blindage, only need's to have something bellow to give some more rigidity.
It brings the AD8307 noise level to -76dBm.

Board assembly:

The calibrator was based on the one here.

It's not spot on according to the Marconi and R&S but does an approximate job in case the input needs to be validated.

Bellow validating the 0 dBm output of the Marconi power meter:

1.5db down the reference is not bad (possible accounting 0.5 for the cable and plugs thenselfs).

20 dB attenuation of the 0 dBm signal:

..still of by at least 2.1 db down. The attenuator used was measured at 19.7db.

If I need more precision will use the other meter's I have:

For quick check in circuits with risk of blowing something it will be better to use the homemade one, the price different between an AD8307 and the other sensors is in the 20 fold at least.

The other power meter meter's I built before was this one:

from the post here.
The digital voltmeter, on top of the unit, does not display dBm instead the output of the opamp after the AD8307. So the compute dBm needs a table.

And the one inside this VNA

From this post.

The Arduino code used on the new AD8307 power meter is this one:

// AD8307 with LCD and serial output
// main code example from here:
// some changes made by CT2GQV - 2018
// version 20180915

// initialize the library with the numbers of the interface pins
#define I2C_ADDR    0x3F
#define BACKLIGHT_PIN     3
#define En_pin  2
#define Rw_pin  1
#define Rs_pin  0
#define D4_pin  4
#define D5_pin  5
#define D6_pin  6
#define D7_pin  7
LiquidCrystal_I2C       lcd(I2C_ADDR,En_pin,Rw_pin,Rs_pin,D4_pin,D5_pin,D6_pin,D7_pin);

//pwr sensor stuff
const int sensorpin = A0;

// serial print the voltage at the Arduino A0 / from,44216.0.html#13
void printDouble( double val, byte precision){
 // prints val with number of decimal places determine by precision
 // precision is a number from 0 to 6 indicating the desired decimial places
 // example: printDouble( 3.1415, 2); // prints 3.14 (two decimal places)

 Serial.print (int(val));  //prints the int part
 if( precision > 0) {
   Serial.print("."); // print the decimal point
   unsigned long frac;
   unsigned long mult = 1;
   byte padding = precision -1;
      mult *=10;
   if(val >= 0)
     frac = (val - int(val)) * mult;
     frac = (int(val)- val ) * mult;
   unsigned long frac1 = frac;
   while( frac1 /= 10 )
   while(  padding--)
   Serial.print(frac,DEC) ;

void setup() {
 Serial.begin(57600); // should be enough
// set up the number of columns and rows on the LCD
lcd.begin(16, 2);
lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE); // init the backlight
lcd.setBacklight(1);        // Backlight on

void loop() {
 // power in
 int sensorval = analogRead(sensorpin);

 // might need to read or match agains analog ref.
 //float voltage = (sensorval/1024.0) * 5.0;
 float voltage = (sensorval/1023.0) * 5.0;
 float pwr = ((voltage-0.269) * 40)-77;
 float volts = ((voltage-0.269) * 40);
 float pwrW = pow(10,((pwr-30)/10));
 float vts = sqrt(pwrW * 50);
 float ptp = vts * 2.828;
 lcd.print("Pwr ");
 lcd.print(pwr, 1);
 lcd.print("dBm   ");

// Serial.print(sensorval); Serial.print(" DAC   ");
printDouble(voltage,3); Serial.print(" Vdc   ");
Serial.print(pwr); Serial.println(" dBm");

if (vts > 0.9)
  lcd.print("rms  ");
  lcd.print(vts, 2); lcd.print("V  ");
  float ptp = vts * 2.828;
  //lcd.print(" p2p ");
  //lcd.print(ptp, 2);
 if (vts < 1 and vts > 0.001)
 vts = vts * 1000;
 lcd.print("rms  ");
 lcd.print (vts, 2);  lcd.print("mV  ");
 float ptp = vts * 2.828;
 //lcd.print(" p2p ");
 //lcd.print(ptp, 2);
 if (vts < .001)
 vts = vts * 1000000;
 lcd.print("rms  ");
 lcd.print(vts, 2); lcd.print("uV  ");
 float ptp = vts * 2.828;
 //lcd.print(" p2p ");
 //lcd.print(ptp, 2);


That's it, have a great day!

Sunday, August 26, 2018

New RF frequency generator for the shack

Nothing build here, next time!

Before going on holidays I had the idea to get an rf frequency generator of good quality to be used as a reference when testing circuits.
Previous I built one based on an Si5750, also used at times an AD9850 or a quick crystal circuit but nothing permanent and referenced.
Searching online, I found probably one of the cheapest 1Gz frequency generator available  that an ham near my QTH was selling. The looks are not perfect, it had in the past a not so caring previous owner but gives a precision frequency output. Now developed a fault in the output circuit which I suspect probably due to calibration data missing, so I hope. Still it outputs a constant signal but still need to measure to confirm specs.

Here it is:

The knob is not the original one and the bezel around the power button is not in good shape, parts that I probably replace one of this days:

Knob: 0078.1192.00

The fault that it has is error 4 and according to page 11 of SMY Service Manual

Error message "Err. 4"
Level control does not work correctly:

- Level overrange
- AM overrange
- Overrange with AM EXT DC
- 'Level-Preset' calibration faulty

I just hope it was not me making any wrong setting (did it once when selected external reference and was error'ing since nothing connected), in any case will check output and run the calibration details to see if it goes away....

For reference the routine and troubleshooting areas are

Service manual Level Error
A5 Output Unit OPUY01/02
A12 Power Module option SMY-B40
A6 Attenuator ATT01

Page 18 - Level-preset calibration is special function 45.

And some more pictures. By the way the frequency is bang on, only the level, still not measured, looks a bit low when an S9 is generated and connected to an uncalibrated radio in any case.

Have a nice week!

Thursday, June 14, 2018

Park Air Electronics Model 2100 DIP switch settings

Just got an email from a radio enthusiast living in the "small" island East of this one (I'm currently in Ireland just for reference). He was asking for the dip switch settings of the Park Air Electronics 2100 airband receiver since he has a model with similar programing.
I will share here all info I have since I'm pretty sure it will also be useful for me in the future (case I loose the papers).

Inside the receiver you can see the DIP switches for VFO programing:

The documentation I have and that helped me programing it and making a Arduino based controller for it:

Page 1:

Page 2:

Page 3:

..unfortunately the frequency excursion/programing without retuning of the VFO coil is too short (2Mhz) and made the external controller project useless as I documented here. If you follow the blog, I then used the code to control an Si5351 + airband receiver kit here.

Have a nice day Terry!

Wednesday, June 13, 2018

Back to the future - Arduino DCF77 transmitter

Here's the proof:

..that's December first, 2072!

On a serious note, needed to test a DCF77 receiver box that was (and still is) giving some problems to get reception since there was no other way of testing with a "real" strong signal why not making a transmitter for it.

Luckily that's pretty simple and someone already had done it here.

I first tested if was transmitting with my VLF receiver: was

And then with my watch:

which includes a DCF77 receiver to keep updated but antenna wire needs to be close by.
The schematic is strait forward, 1K resistor from pin 3 to ground with antenna wire in the middle.

The Arduino code you can get it here. There's also details include on how it works. Keep in mind that you need an Arduino with a quartz crystal for clock, most likely a ceramic will not work.

I just hard-coded the start time but you can change by serial port:

Still the DCF77 receiver box that I wanted to work, doesn't.... that will be another post (and no it's not the antenna wire you see disconnected in the picture)

Have a nice day!

Sunday, June 03, 2018

Teensy 3.6 + Si5351 connection and code

Just another example for the Teensy 3.6 board. This one with the Si5351 clock generator breakout from Adafruit.


There is no need to supply external power if the board (+5V on Vin) is being used with USB, that's enough for the Teensy and Si5351 boards.

Resulting wave:

  Outputs 1.1 Mhz on CLK2 output of the Adafrui Si5351 board connected to Teensy 3.6
  Just for demo.
  CT2GQV 2018


#define Si_5351_crystal 25000000 // Adafruit breakout board
#define Si_5351_clock  SI5351_CLK2

Si5351 si5351;
long calibration_constant = -8000;

// Pin 13 has an LED connected on most Arduino boards.
// Pin 11 has the LED on Teensy 2.0
// Pin 6  has the LED on Teensy++ 2.0
// Pin 13 has the LED on Teensy 3.0
// give it a name:
int led = 13;

void setup() {               
  // initialize the digital pin as an output for the LED blink
  pinMode(led, OUTPUT);    

si5351.init(SI5351_CRYSTAL_LOAD_10PF, Si_5351_crystal, calibration_constant);
si5351.set_freq(110000000,Si_5351_clock); // 1.1Mhz


void loop() {
  // just blinks the led while power lasts
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second


And that's it,

Have a great week!

Sunday, May 27, 2018

Teensy 3.6 + 2.8" TFT LCD Display SPI Serial 240*320 ILI9341 connection and code

Just doing some experiments with a Teensy 3.6 microcontroller board, a graphical display and some other bits and pieces.
Since it was not easy to find a single source of information with a code example and pin connections, here's a compilation of it:


For testing porpoises the supply is not needed as long as USB power cable is connected to the board.

Bellow the code to run:

  Just place some text on the ILI9341 display using a Teensy 3.6
  CT2GQV 2018

#include "font_Arial.h"

#define BACKLIGHT_PIN   3
#define TFT_DC          20
#define TFT_CS          21
#define TFT_RST         255  // 255 = unused. connect to 3.3V
#define TFT_MOSI        7
#define TFT_SCLK        14
#define TFT_MISO        12


// Pin 13 has an LED connected on most Arduino boards.
// Pin 11 has the LED on Teensy 2.0
// Pin 6  has the LED on Teensy++ 2.0
// Pin 13 has the LED on Teensy 3.0 and 3.6 by the way
int led = 13;

void setup() {               
  // for the built in LED.
  pinMode(led, OUTPUT);    
  // for the backlight
  analogWrite(BACKLIGHT_PIN, 128); // 0 to 255

  tft.setRotation( 3 );
  tft.setCursor(10, 1);
  tft.print("This side UP");
   tft.setCursor(50, 20);
  tft.print("Arial 10 font");

// the loop routine runs over and over again forever:
void loop() {
  // it just blinks the led
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second


Code result:

The display back side (top of the display as on previous picture is the sd card side)

The testing board with backside connections:

 Teensy 3.6 pin assignment diagram.

 Have a nice week!

Saturday, May 26, 2018

MIC5205 (LB30, KB30) Low noise regulator, increasing voltage output

Yes, made a mistake, ordered a mic5205 low noise regulator 3.0V output model, when I should had ordered the 3.3V version for a project in the "pipeline".

The typical application for the IC is like this:

This particular IC is not absolutely needed on the project but why not testing new devices....I should had read better the IC reference chart when ordered... should had been MIC5205-3.3BM5 instead of MIC5205-3.0BM5, as you can see, after the dash there's the output voltage, as on the data-sheet:

Looking at the internal diagram (fixed output version on top): looks pretty much a "standard" series regulation schematic so there's room for change the output voltage and that can be done the following way:

By inserting a drop voltage from ground, at the IC GND pin, to a new ground it will "force" a "floating" ground at the anode of the 1N4007 diode, being the drop voltage value at the diode the increase in the schematic output. Any diode will work and depending of the forward voltage there will be the matching increase on the output. In my case the output is now 3.5  V from the original 3V, and that is inside the 2.6 to 3.6 V specs for the devices being powered by this IC downstream.

I'm really not a big fan of the SMD format since I don't have all the proper tools to solder them, anyhow since it's getting harder to get IC's in standard DIP format, in the future, will try to get more up-to-date on surface mount.
Here's a size, comparative to a resistor and the soldering iron tip.

I had to solder it with extra solder and then removed the excess with solder wick.  

Have a nice weekend!

Sunday, May 13, 2018

ADS-B In-line amplifier experiments and bias T for 1 Ghz

By Easter was in Portugal and got an in-line satellite amplifier since it covers the ADS-B frequency of 1090Mhz
The idea was to put it in service for the ADS-B receiver, improving reception

Without any proper quality equipment to verify the effectiveness, decide do use the QSpectrum analiser software and record the data for comparative analyses.
In the process also trimmed the antenna to different lengths...
ending up in around 7cm (6.8 should be the calculated exact size).

Testing was done inside so subject to nearby interferences and yes, the support is a broom stick...

Here's the experiment and results:
 Testing with just the cable, no power and the amplifier inline:

 Powering the amplifier and no antenna:

Amplifier on without antenna and smoothing 100nF cap on the power line to the amplifier:
 Here with 1pF as DC blocking capacitor on the bias T:

 Now, opening the balcony door on the living room (where I was experimenting) changed results:

 Now still with the open door and a 10pF cap blocking DC:

I closed the door and experimented with a 120pF capacitor:

Testing the antenna ground plane:
7cm with GP:

7cm no grGP:

Ground plane helps :)

Different antenna sizes:



8cm (different scale since approaching the expected length)


In the final configuration it improved reception from my previous experiences, still the antenna being in house only get's a max of 60miles/100Km coverage.

The bias T for the amp ended up as a simple 180pF dc blocking capacitor (C1) one RF choke and a smoothing capacitor. The value was selected as a low capacitive reactance at 1Ghz and a little higher at lower frequencies:

@ 1000 Mhz

    1 pF - 159    Ohm
100 pF -     1.59 Ohm
180 pf -      0.88 Ohm
100 nF -         1.59 E-3 Ohm

@ 100 Mhz

100 nF - 1.59 E-2 Ohm
180 pF - 8.8 Ohm

The implementation and schematic:

Only missing now is to enclose everything and place it on the roof.

Have fun!