Author Archives: G.Duval

This Old Phone part 3: Ring my bell.

I have the Bluetooth solution and verified operation of the candlestick handset. What was missing was an old timey ringer. Back in a day, a wall mounted ringer assemble was usually installed next to the handset.  This would require a 90V AC to ring the bell.  I want to have an old style ringer but I didn’t want to hassle with the 90 Volt requirements.   I found a surplus bell from an old phone parts supplier.  I removed the larger coil and installed a 5 volt relay with tie-wraps and wire.  I made it work.

20160320_173039_resized

The ringing is from a 15 to 20 Hz pulse that duty cycles on for 2 seconds and off for a couple seconds.  I piecemealed this circuit to be triggered from the incoming signal from the speaker. It sets the first 555 for the on off duty cycle while the second 555 is for the 20Hz ringing.

bellRingger

In order to make this a desktop application and something that doesn’t have to be anchored to a wall, I decided to create a “ringer base” which will also act as a charging station.  I found a nice small black cigar box that will serve just right for the ringer base.  The candlestick phone will sit on top and when a call comes in, lifting it off the base will cause the ringer to stop and answer the call.

20160320_172528_resized

I created 3 small PCBs from proto material I had hanging around my lab.  The larger one holds the ringer and charger circuit assembly.  I have a single transistor amplifier to act as a simple Schmitt trigger on a smaller PCB ( similar circuit I used for the condenser microphone from last time).  In the center is my connector board which will interface to the phone, charging power, “answer” signal, and speaker from the receiver.

20160320_172509_resized

The lid of the cigar box slides out. I cut out an access point to this molex connector, again from my spare parts bin, where at one point I got this assortment of connectors.  I routed out the underside so that the connector can stick up enough to mate with the base of the phone.

So far all things are in place. Next time I will put it all together with the interconnections from the phone.

This old ( Bluetooth connected) phone Part 2:

Since the old carbon microphone was not operational anymore, I needed to up grade to a more modern approach for the BC127 module. I found an inexpensive electret condenser microphone. Working with these can be a little tricky and not quite straightforward depending on the gain of target application  and how much voltage you intend to run it off. Given that I am trying to run this all off of a 3 V source, I didn’t have enough amplification to directly drive the microphone into the input of the BC127.

This this little circuit came in handy:

12-27-2015 4-10-23 PM

I built the circuit on a solder-able  breadboard and tested it with an oscilloscope first.  I verified the circuit by  testing it on the prototype platform, currently resembling a mad scientist’s tangled mess of wires.

Success! A call made from my land-line to my cell phone paired to the purpletooth jamboree board connected to this kluge of wires, iron and alligator clips was rather exciting for a geek. I was able to test the microphone’s ability to pick up my voice from about 3 feet away before dropping off.

 

Next step: In part 3, I really want to ring an old time ringer which I purchased. This will requiring hacking into the code a little bit to set a GPIO active to engage the bell. The problem is that the bell will require a higher voltage too and may defeat my dream of being somewhat rechargeable and running off of a single battery and voltage source.  At the very least, I will test the connection to the switch which will engage the “answer” mechanism ( play button on the Jamboree board).

This old (Bluetooth connected) Phone: Part 1

2015-09-15 19.04.45

I inherited an old Western Electric candlestick phone from a relative, who in a previous life, converted to a nice decorative little table lamp.   I wanted to restore some of the intentional functionality of this old device  but with a modern twist. When I am at home in my office/mad scientist’s lair, I often miss calls on my cell phone because, well, I have it on silence or vibrate. I thought it would be fun to sort of “Steam-punk”  this old phone to have Bluetooth on it and have an old time RIIINNNNNG coming from an incoming call.

 

My first step was to test the Receiver ( the cone held up to the ear) with a  signal generator. I disassembled the base and removed the guts from the candlestick base. Using a signal generator, I was surprised to hear this old ear piece still worked as it did.

The next thing to test was the transmitter piece.  Unfortunately, this part had seen better days. I couldn’t pick up  a sound out of it and I feared the coil and diaphragm were frozen.  No worries, I will just use a modern microphone in its place hidden behind the mouth piece.

There was no bell in the base so that was another part I will need to get and since this style phone typically had a remote bell box, I will have to get creative on how I want to implement this.

11924-01

For testing and  development purposes, the Purpletooth Jamboree development board makes for a nice break out to try microphones, speaker attachment and GPIOs. It’s based on the BC127  module from Blue Creation. The Bluetooth protocol native to this allows for a Hands Free Protocol ( HFP) as well as an audio device.

 

I was able to connect the earpiece to this development board and pair it with my phone.  I played a song from my phone and I was pleasantly surprised listening to some Little Feat being played through the ear piece.

20151213_111954

Next step will be to get the microphone part working so I can actually have a conversation on this old phone.

Halloween prop 2015

It was early September when a friend approached me about a Halloween costume project. “I heard you could augment a gun prop with LEDs!”  Intrigued, I encouraged her to elaborate more. She wanted to recreate the character, Rocket, from Guardians of the Galaxy to rest on her shoulder while she was dressed as something else.  Then she mentioned using a puppet for the raccoon and the project took a life of it’s own.

12037972_10153864714065769_7599203634393871716_n

I had 6 short weeks to augment a Nerf Blaster with a sequence of LEDs, animate the head of a raccoon puppet, and make an industrial backpack to go along with the gun.  I drafted an overall plan for this attempt:

The Gun:

3 bright White LEDs ( 80mA each) for inside the barrel.

2 Purple LEDs for the tip of the muzzle

10 orange LED’s distributed to the chambers and butt of the stock.

20150925_183052

The Backpack:

1  Blue Circular Bar-graph LED (with 16 LEDs)

1 tri-color LED

Racoon Puppet:

2 Red LED’s for the eyes

1 mini position servo 180 degrees for head movement

2 condenser microphones for the ears

I wanted a firing sequence that would start at the backpack with the tri-color LED cycling through it’s rainbow while the circular Bar graph started up. At about halfway around the circular bar-graph, a few of the orange LEDs will start to light up ( flames). At full circle, the bright white LED’s in the barrel would fire a sequence of 3 pulse with the purple LED’s as an effect on the muzzle. Then the rest of the Orange LED’s would all be lit ( after burn) while the Circular LED cycles down.

20150925_193900_resized 20150925_191526_resized

For the Raccoon, his eyes would stay lit. The intention was to have him noise activated. If the left ear picked up a noise  louder than the right ear, move head to the left. The same for the right and if the sound was loud ( a clap or shout) the firing sequence for the gun would start. That was the intent anyway. The problem was the sampling rate for the analog input was not what was desired with all the other functions happening and no time allowed for optimization.  It will be a follow-up feature. Instead I used it for randomization of the head and firing sequence which made it less like an automaton from cheesy restaurant.

20150925_193921_resized

Due to limited time, I decided to basically use an Arduino DUE because it had 54 GPIOs to cover the 32 LEDs I wanted to sequence and still have room for the servo and the condenser Microphone pickup. I spent a considerable amount of time soldering current limiting resistors for the LED’s as well as a transistor driver for the larger and brighter white LED’s which would be too much for an Arduino’s GPIO.

Each LED had heat shrink and wire run all down to the base of the NERF Blaster and came together in a ribbon cable that fed back into the backpack.  On the Backpack ( sorry limited pictures before I handed off to the owner), I had to carefully solder the resistors and feed them through holes. I took apart a Dewalt large capacity chalk line to create the industrial pack for Rocket. The wind-up hole was perfect for the color LED and the Circular LED fit perfect around it.  All of this was thread through the outer casing and then soldered them onto  a board on the inside and another ribbon cable mated with the Arduino.12108962_10153921607450769_6901125894117860820_n

I only had a mini servo. To maximize the movement, I created a metal frame from a robotic’s mechanical assembly kit and mounted it on the spindle of the servo. I tested the proper placement inside the puppet and found the ideal placement was inside the nose of the raccoon to get the most movement.

I coded up the arduino and ran several tests with 3 AA batteries.  I was able to get about 4 to 6 hours of life before the batteries needed to be changed

.12046641_10203580578275355_8069776584775420743_n

I had a working Halloween prop for my friend in time for her to do some last minute augmentations ( she made is jump suit). She took it up to Salem MA to join in the fun. She got a lot of strange looks and wonderment from her little animated Rocket.

1891115_10203604274587748_8765457587115577213_n

Motivating Students with a Cigar Box Amplifier project

Image

Besides my full-time gig as an engineer, I also teach part-time at a local community college. The circuits class is a continuation from the basic AC/DC fundamentals class and introduces the students to active components like diodes, transistors and op-amps.  I tend to be a bit out of the box and decided that  it’s more enriching to drive the class towards a project based learning experience.  Instead of paying for the typical lab manual and building “static circuits” each week in lab to expand on the theory, I suggested to the class to put the money into the materials required beyond the lab stock of devices to build a stereo  amplifier that they can plug their iPhone or MP3 player into and listen  to.

With only 15 weeks for a semester,  the labs turned into project updates and planning. The class started by learning about power budgets and input and output requirements. The first task was to decide how much power they could afford given the cost of the alternative lab manual.

Understanding diodes turned into a power supply design with a power budget to drive up to a total of 15W of power to two 8 ohm speakers.  Basic transistor circuits turned into figuring out bias and gain for the given inputs and requirements for the next stage of the amplifier. Op-amps turned into learning about a tone controls through active bandpass filters.  The final stage was the power amplifier and because of schedule restraints the class decision was to use a linear Class A design though inefficient, was still able to provide enough output to have acceptable volume to the speakers.

Image

I had the students create their own schematic using ExpressPCB tools and eventually create a PCB that still fell within budget.  They  learned about design reviews and tradeoffs  in a project between scope, costs and time.

Image

I had the class practice soldering on breadboards to build prototypes of sections of the power supply and amp. They had to develop a test plan to verify  the specifications. This way when the final layout was complete on the PCB, they were ready to solder the complete board  and experienced with troubleshooting as well as making measurements against the design specifications.

Image

I found a cigar company willing to sell some empty wooden cigar boxes to house the stereo parts as a nice finish.  At the cost of $2/box, this fit well within the budget.  Another student volunteered to come up with a wooden insert to  mount the speakers and the PCB.

Image

Overall, the project was a big success. The output was delivering only  4.5W per channel but still loud enough to enjoy at a desk. There was no distortion to deal with since all the stages were basically linear class A.  All the students ended up with a  working cigar box stereo amplifier that they learned so much from. A few students wanted to make it more power efficient. They asked about turning the final stage to a class D operation.  Over the summer and with a small Maker Faire grant from the school, they actually went on to build and explore the challenges of designing a Class D amplifier to fit in the same cigar box housing.

 

Receiver Adjacent Channel Rejection Testing

Image

Test Description

The adjacent channel rejection testing is an extension of the receiver weak signal performance. The test configuration is similar to the previous discussion on BER testing basics in my last post.. This time, we will look at  verifying the sustainability of  receiver performance while an interferer signal is introduced.

Test Setup

The general setup is shown in in the lead in figure. Depending on how the DUT is specified, the receiver should have the ability to reject an adjacent signal of a given strength. We are not looking for the same performance as the DUT’s path-loss with no other interference. In this case it’s usually looking for a acceptable threshold of BER at about +10 to +15  dBm from the previous floor. For instance, you may allow your DUT to insure no BER at -75 dBm  while an adjacent channel is interfering at -60dBm in proximity.

In order to emulate this on the bench you still need to take the the cable and connection losses into consideration. With the AP set for 12 dBm, and the losses to the DUT through the system equal -7.5, to have the DUT experience -75 dBm path loss, the attenuator needs to be set to – 70.5  ( AP Tx – Connection losss -75 dBm). This can be monitored on the power meter in the set up.

Initialization parameters

Set the test channel on for the DUT on the Telemetry AP Unit and adjust the variable attenuator to a transmitted power level of –75dBm @ test channel as read on the power meter.  The external signal generator ( ESG)  transmitted power level will be –60dBm @ adjacent test channel frequency. Set the ESG signal generator to the center frequency of Channel +1 and Channel -1  around the test channel and measure it’s power at the meter. Adjust the power at the ESG to read -60 dBm at the meter.

Test Procedure

The Adjacent Channel Rejection of the DUT shall be tested by means of measuring the BER of the receiving signal sourced from the telemetry’s AP Unit in the presence of an interferingsignal provided by an ESG operating continuously using the same modulation scheme. Check to make sure the BER measured passes under the above mentioned condition.

For each channel tested, set the ESG to +/- 1 channel away, testing twice for each channel.

I hope you found this helpful. Feel free to drop me a comment.

 

Avoiding Problems during Receiver sensitivity BER testing for a Medical telemetry device

Image

Since some medical telemetry devices fall under low power low bandwidth broadcast, the FCC has strict rules for such classification especially when used in the 2.4GHz spectrum. FCC 15.231 allows 48 narrow channels of low power and bandwidth for use in this spectrum. Normal 802.11 allows for only 11 channels of 20 MHz bandwidths. Medical Telemetry utilizes this same ubiquitous space with MUCH narrower channel spacing at 1.74 MHz per channel.

With such a narrow channel in an overused broadcast spectrum, accurate Bit-Error-Rate (BER) testing becomes even more important. Measuring Bit Error Rate (BER) in a digital system is the equivalent of measuring the Signal-to-noise ratio (SNR) in a low noise amplifier.  Basically, the BER test measures the receiver’s weak signal sensitivity.

This article looks at the basics of conducting BER measurements for lowest RSSI (Rx Signal Strength Indication).

Test Setup accounting

The general setup is shown in the BER test configuration diagram. Before any measurements are taken, one needs to measure the path losses introduced into the system. This may sound rudimentary as it’s RF test 101 practices.  This should include cable losses, splitter attenuation, and especially taking into consideration any cabling conversions ( like Type F to Type N or TNC  at the power meter and SMB to Type N at the DUT).  In my setup, I prefer to use  similar sized cables from the splitter to the DUT  and from the splitter to the power meter. Keeping  the cable conversion losses of the interconnects for both as close as possible  allows for a matched power reading at the DUT as read on the power meter!

In this configuration the total path loss from the AP to the DUT will be -6.5dBm when the variable attenuation is set to 0dBm.

Verifying the loss calculations

Connect to the access point (AP) through your server (not shown) to control the transmit power and channel access at the telemetry’s AP. Select the first channel and set the Tx power to 10dBm. In my set up, I accessed the AP through one of the diversity antenna ports. I had to configure the AP to only transmit out that port.  Also, since I removed the antenna, I had to take into consideration the +2dBm antenna gain is not in effect. Thus, in order to emulate a +10 dBm Tx from the AP, I had to set the power level to +12 dBm.

Setting the variable attenuator to 0 dBm, I was able to get a reading on the power meter of about  5.48dBm. This is a provided a good indication that I accounted for all the power losses due to the system setup.

Provided you have a command line interface to the DUT and an allowable access through a wired port ( USB, SPI etc), the DUT controller should allow you to establish a link to the AP,  read RSSI and channel data. The power level on the DUT was at +5.43 dBm. Since this is close to what is measured at the Power meter and within 0.1 dBm of the calculated and measured losses, I can be satisfied that these measurements are accurate enough to continue. I  scan through all 48 channels to insure a flat response from the AP and keep track of any variations.

Test Procedure and BER calculations

Start by establishing a link with the DUT while you have the variable attenuator set to 0 dBm. Verify you link by running the BER software at your AP.

The telemetry AP should also have a command line access interface either from the server or through a wired serial port.  Depending on the setup, the low BW low power application may have a time division multiplexing scheme where calculating BER needs to take into consideration the slots.

The AP software  should be capable of reporting  the number of bad bits, total number of slots that where sent and the number of bad slots.  A bad slot is when there is a bit error in the sync word or when the total number of bit errors exceeds more than half the total number of bits in the slot.

The equation for calculating the BER for the AP Telemetry is:

Bits in error  = Be

No of slots = Ns

No of bad slots = Nsb

n = one line of reported data (typically  100 slots / frames)

n-1= the previous line of reported data (typically  100 slots / frames)

b= # of data bits ( 8)

Slts= # of slots plus any framing slots

BER = [Be(n) – Be(n-1)] / [[[(Ns(n)-Ns(n-1)]-[Nsb(n)-Nsb(n-1)]]*b*Slts]

Once you are sure you have a good link to the DUT and the AP is reporting bit error correctly, start attenuating the signal. I tend to use a coarse adjustment to  increase the attenuation until I just start to see the point where BER is reported.  Then using the fine adjustment, I record where the “knee” starts to occur and look for the 0.001 threshold.

Sample Test Results

In the setup I used, I compared the receiver’s sensitivity threshold using both a USB power supply connected to the DUT ( switching power) and just Batteries running the DUT.  The chart below shows the results averaged over the 48 Channels for each case. The .001 BER threshold was -90.5 dBm for the USB power connected DUT but with a batteries I was able to push the sensitivity of the telemetry receiver to -94 dBm.

  BER REsults

Next time

Next time I will discuss how to expand this set up for Adjacent Channel rejection testing.

If you found this helpful or if you have any suggestions, please feel free to leave me a comment.

Solving a Pesky PLL tuning issue for an RF transceiver

As a debut article, I’d like to share about one of the problems solved on a PLL circuit and problems when the product transferred to production calibration. Without revealing too many details due to sensitivities of trade secrets and all, I still would like to share how I  worked through this  problem on  a medical telemetry transceiver.

Let me first set the stage.  Let’s say a product is to be deployed worldwide but each geographical region has different frequency channel  allocations for the ISM band you are trying to meet.  In an effort to save design costs, a single PCB was fabricated in trying to meet all the 8 different operating bands. Each option had a modified BOM to and a programmable PLL  and DAC that allowed for tuning each of the options.

PLL1

4th order Loop Filter basic representation.

On the production floor we had a coarse tune adjustment and fine tune adjustment used the same PLL  and VCO.  Finding the sweet spot for all frequency ranges ( 400- 900MHz) AND gain variations for course versus fine meant having a challenging design constrained  to changing a few passive components for a 4th order loop filter for the PLL.

The main purpose of the loop filter is to act as a low pass filter (LPF) for the DC adjustments to the VCO.  It needs to be responsive enough for the charge pump changes in the PLL, yet not too wide of a bandwidth  or it allows the VCO to track harmonics of the frequency.  Ideally, you are looking for a narrow bandwidth from DC to 1K Hz in this particular setup.

There was a corner case on one of the frequency options where we had fallout in terms of yield. The problem showed up on the production floor during course tuning  when the board would go into an unwanted 800Hz oscillation.  Prior attempts to duplicate this particular problem  on the bench failed. Accepting the challenge I rolled up my sleeves made the following steps:

STEP 1: Design a test jig that can control just the radio module and allows access to the R and N counter values of the PLL as well as make the DAC adjustments for the course tuning. The schematic below is a representative interface I worked with

TESTJIG1

Test jig to recreate problem in the lab.

.

I had a simple SW interface to change the register for N and R values of the divide-by-N PLL  values on the fly.

STEP 2: Duplicate the same process as on the production floor. Once I was able to control the PLL and tune the VCO, I wanted to make sure the same sequences on the production floor were followed.  With this setup in the lab,  I was able to duplicate the tuning sequence on the production floor on the radio module under test and recreate the problem. It was important to follow the same algorithm as on the floor which meant starting from a MAX setting on the course tuning. In doing so, I found the corner case where the unwanted 700-800 Hz  oscillation was taking place.

Step 3: Understand the stability over the different gain adjustment in the closed loop.  The loop filter was designed for a fine tuning VCO gain ( k factor) of 6 MHz/V.  However, with  the course adjustment used on the floor, the frequency of the VCO changes   at a rate of 15 Mhz/V.  This created a 2.5 Delta in the anticipated gain when the loop filter values were chosen.

Step 4: Closed loop versus open Loop transfer characteristics: In the lab, I inserted a Gaussian noise in the loop to see the response of the circuit over a range of Frequencies at different VCO gain settings.  I made do with what equipment was available in the lab. I use a very old HP 3562A Dynamic Signal Analyzer.  It plotted the dynamic response of the closed loop circuit with the odd gain setting. Low and behold, was a pole at the unwanted ringing frequency seen on the production floor.

Pole1

Screen capture of the unwanted Pole causing the ringing at 706Hz

 

Step 5: Finding a practical solution :  The loop filter values didn’t consider  the higher VCO gain k-factor when tuned on the production floor. Values needed to be considered  for dynamic gain adjustments. The problem is that the use case for  the course gain will not be used once production calibration is  complete. Could a middle ground be reached which allowed production to go ahead without changing the process and still not impact performance of the transceiver?

I found a mathematical model that broke down the time constants for the orders in the loop filter.

In order to look at the closed loop transfer function the open loop characteristics needed to be defined first. The impedance of the open loop filter can be expressed in terms of the time constants for each order of the filter .

Formula1

But the closed loop gain needs to be considered for the stability factor. From the impedance of the open loop gain is determined as a function of the gain of the charge pump(KΦ), the VCO gain (KVCO)  as follows;Formula2

The closed loop transfer function takes into account the N counter  of the PLL . The N counter value is the output frequency of the VCO divided by the reference comparison frequency from the VCTXO.  Generically this expression looks like:

Formula3

In order to find the stability of the circuit the following Routh criteria must be met

Formula4

During the High gain, R2 and R3 were picked such that the stability factor was <1 after everything was crunched.  I managed to find the a set of values that increased the stability with a moderate tradeoff in overall loop bandwidth which still met all our operational and regulatory specifications.

With a minor BOM change,  we went from a yield of less than 50% to one that was over 94% without doing a redesign or having to validate a new production calibration procedure.

Problem SOLVED!

I thought I’d share this. Hope you find it useful.

George Duval

RF Analog Engineer.

Design a site like this with WordPress.com
Get started