Pages

Friday 29 January 2021

Testing Relay Life - Update at 72,000 cycles

 Happily for me the STM8 hardware and STM8 eForth combination is once gain proving to be reliable and useful. The board I had made to test the relay is shown below. 

 


The test is reaching the point where I expected to see some form of degradation. But there is no strong evidence that failure is near. Until it fails I will not really know if results to date could have predicted it. 

 Looking at those peaks the 16 readings which are averaged and plotted for each cycle are consistent. It's not just a few high readings during the one cycle which push the average up. So in hindsight 16 readings per cycle was probably too many.

With a 32megabit flash chip hanging off the STM8003 I can save 4 million bytes. Since I take 16 readings for each relay cycle and only save the lower 8 bits for each reading that means I can save 250,000 readings. Will the relay last that long? Stay tuned...

73's


Thursday 28 January 2021

Testing Relay Life - With STM8eforth

 I use a lot of relays in various projects and always wondered what electrical life in the datasheets really meant. Given my skepticism about any claim by a Chines manufacturer I decided to see if life could really be tested. 

My method is to toggle a relay 1800 times per hour while passing a constant current of 2 amps. I measured the voltage drop across the contacts 16 times for each cycle and logged everything to a 32MB flash chip.

Amazes me what can be done with an STM8 and forth.

I intend to operate the relay to failure. That may be a week or so away. But so far, after almost 6000 cycles, the results are pleasing:

 

The Y axis is the raw ADC result, averaged for the 6 readings. Interesting to see periods with a significant degradation in contact resistance which manifests itself as an increase in the ADC reading. 

73's

Wednesday 20 January 2021

Dishal Filter Alignment with the NanoVNA


When aligning bandpass filters it only takes me a few minutes of twiddling before frustration sets in. I had previously used the method attributed to Dishal as set out in Solid State Design. It is a very effective method although there is some set up needed. 

Over the years I had seen some very vague, if not useless, explanations of how to do this with a VNA. So I set out to discover for myself how this was done.  I threw together a 2 section narrow band pass made with coaxial stubs, tuned with high quality beehive capacitors. In the process I learned not only how to tune these filters but also how to design them with coaxial stubs.



 

Here then is how I use the NanoVNA to align multistage filters. (apologies to keen eyed readers who might noticed the dates/times of these images are mixed up. I lost a few so I had to mix two filter tuning records I had)

  1. I used OneofEleven's PC software to drive the nanoVNA but this guide should be near universal.
  2. OSL calibration as required
  3. Connect the filter to be aligned to the VNA. I'm going to use Channel 0 as the Input, Channel 1 as the output in this guide. 
  4. Use a suitable frequency span and add a marker for the desired center frequency eg 146.5MHz
  5.  Select a polar view of S11 and place a short to ground at Point A



  6. Adjust the marker using the "e-delay (ns)" field so it lies on the X axis. This is for convenience, the Y axis would also work. 




    7. Move the short to Point B

     
    8. Adjust the tuning capacitor on the first resonator until the marker rotates to be on the X axis but opposite to the rotated starting point.

    9. Move the Short to point C and tune the second resonator

    Remove the short. That's it. The picture in point 9 makes an important point. The whole trace is now on one side of the plot. That's irrelevant. What is important is the marker is on the right hand side of the two points which intersect the X axis. It started on the left hand side in point 8. Just try this, it is easy once you have had a go. Your traces will look very different to mine but the procedure is the same.

    So how did it work? As expected:

    I then decided to rebuild this for a narrower bandwidth. My tuning caps were just a tad too small so I used a center frequency of 150Mhz. You will notice below the peak is at 149.5Mhz. That's because I used a piece of floating PCB onto which the coupling capacitors were soldered. It was getting mechanically depressed during tuning changing the stray capacitance around the filter. 

     
    73's
     

Saturday 16 January 2021

QN8027 FM Stereo Transmitter

The QN8027 is a high performance, low power, full-
featured single-chip stereo FM transmitter designed for
portable audio/video players, automotive accessories, cell
phones, and GPS personal navigation devices. The
QN8027 covers frequencies from 76 MHz to 108 MHz in
50/100/200 kHz step sizes for worldwide FM band support.
The QN8027 also supports RDS/RBDS data transmit.

 

OK, the datasheet makes this device sound interesting. But the datasheet is not really clear on how the device should be used and there is not much information on the web. Regardless, I purchased a few for a minuscule sum and set about interrogating the device with STM8eForth.

I'll publish my code on github soon but for now here is how I investigated the device:

  1. bit bang an I2C interface
  2. keep a local copy of all the devices registers so I could compare what I send the device with what it accepts and stores
  3. some words to send one or more bytes while updating the local register copy
  4. some words to retrieve one or all of the devices registers
This allowed me to 
  1. reset the device
  2. confirm the device registers when reset matched the datasheet
  3. change frequency as desired 
  4. put the device into transmit
  5. send RDS groups

It didn't take long before I was successfully shuffling bytes to and fro. In the space of half a day I determined that I had a faulty crystal on one board, since fixed, a functioning FM transmitter (now two with the crystal changed) that I could change the frequency of and that after sending an RDS group the registers did not need to be reloaded if I wanted to resend the group since the contents were still there. 

I need to clean up my code to remove stuff I used for debugging and dispense with my local copy of the device registers.  I plan to post it onto github in a around 5-7 days time.

73's