Saturday, April 16, 2016

Frequency Counter OCXO Upgrade on The Signal Path

Shahriar of The Signal Path Blog posted a YouTube video a few months ago about a Fluke PM6680B frequency counter that he has in his lab. He performed a successful repair on the counter in that episode and got it fully operational. The unit was equipped with the stock XO timebase, however, that did not provide the necessary stability for a counter of that resolution.

I sent him one of my PM66xx OCXO upgrade boards for his unit. Check out his video where he installs and tests the board in his counter.


This upgrade board is shared as open source hardware. If you have a compatible counter and would like to make your own, check out my write-up here.

- Dan W.

Wednesday, April 13, 2016

Fluke/Philips PM66xx Frequency Counter OCXO Upgrade

In this post I will document an OCXO upgrade board I designed for the Fluke/Philips PM66xx line of frequency counters.

Custom OCXO upgrade installed in my Philips PM6674.

Introduction


A few months ago I purchased a Philips PM6674 frequency counter on eBay. It's an older 9 digit counter with two channels that has a maximum input frequency of 550MHz. The design feels dated compared to more modern counters, such as my Agilent 53131A. However, it is still a fully functional piece of lab equipment with a simple user interface and compact design. I often prefer older counters for day-to-day use because I don't have to fuss with complicated menu-based interfaces and features that I don't need. (Set the gate time on a 53131A and count how many button presses it takes).

A nice old frequency counter: The Philips PM6674.

My counter came with the standard XO timebase option, which has fairly poor specs for stability and drift. It is difficult to trim precisely with the single-turn trimmer capacitor on the board. For most testing in my lab I use an external reference from a GPSDO, but it is still nice to have an accurate timebase available in the counter if I need to take it somewhere and do testing away from the bench.

Previously I posted about an OCXO upgrade I made for my Racal-Dana 1992. The fun of designing a similar upgrade for the Philips counter was one of my motivations for purchasing it. My upgrade board is roughly equivalent to the original PM9691 OCXO module, and it should be compatible with any Fluke/Philips counter that is capable of using that option.


Designing an OCXO Upgrade


Creating a timebase upgrade board for the PM6674 was a bit more involved than the process for designing the Racal-Dana upgrade. That counter had a clean 5V supply available on the header where the timebase board connected, which was exactly what I needed for the OCXO. The header for the OCXO module in the Philips counter also has a 5V rail. However, that rail does not stay active when the counter is in standby. The original Philips OCXO modules operated from the 24V rail, and I had to use that for my own upgrade. In my counter, the "24V" rail actually runs at about 27V, and drifts up to 30V when the counter is in standby. There is also a substantial amount of ripple.

I opted for a Recom 78C5.0 DC-DC converter to get the 5V I needed to power my board. This is a nice little module with a pinout that mimics the 7805 linear regulator. It has good specs for efficiency (as high as 96%) and was very easy to implement on my board. I used a combination of electrolytic and ceramic capacitors on the input and output for filtering.

With power taken care of, the remainder of the board is very simple. I used the CTS 10MHz OCXO that I did a teardown on and reverse-engineered the schematic for. This OCXO has a 4V reference available on one of the pins, so I did not need to add a separate reference IC to the design. Additionally, the CTS OCXO has a ~1.4Vpp sine wave output, which is quite compatible with the Philips counters. The input spec for the internal reference signal is 1Vpp into 1kohm.

My take on a modern replacement for the PM969x series of OCXO modules.


The form-factor of my upgrade board mimics the original OCXO module as closely as possible. I found the exact header I needed on Digikey for the mounting arrangement used in the Philips counter, and there is a single hole for a securing screw. The module mounts nicely in my counter and looks pretty snazzy. The performance of the CTS OCXO is sufficient for the 9-digit resolution of the counter. It warms up quickly and hugely improves the accuracy and usefulness of the counter when it is away from a proper 10MHz external reference.

The CTS OCXO warms up very quickly.


Shared as Open Source Hardware (OSHW)


Fluke/Philips PM66xx OCXO Upgrade: Order PCBs on OSHPark!

Eagle Files: Shared on Github


Schematic of the PM66xx OCXO upgrade board.


Parts List

OCXO: CTS model 1960017 (available on eBay) or compatible substitute
DC-DC Converter: Recom 78C5.0-1.0
C1: 100uF / 50V, 105*C rated electrolytic (8mm diameter)
C2: 2.2uF X7R 0805 50V rated ceramic
C3: 220uF / 35V, 105*C rated electrolytic (8mm diameter)
C4: 10uF X5R 0805 25V rated ceramic
C5, C6: 100nF 0603 ceramic
R1: 51 ohm 1206
VR1: Vishay M64Y103KB40 10k 21 turn pot
Header: Molex 22-14-2104

The ceramic capacitors install on the bottom side of the board.


Installation Note: On some counter models, such as the PM6674, you need to remove the stock 10MHz crystal when you install this board. I simply cut the two legs of the crystal from the top of the board and left it glued in place, as you can see in the first picture in this article. Other counter models such as the PM6680B have jumpers near the crystal to easily disconnect it and select the OCXO reference.

12V/24V Rail: Some frequency counters in the series, such as the Fluke PM6680B, have a 12V rail available for the OCXO instead of 24V. This upgrade board is still compatible with those models, as 12V is sufficient to operate the DC-DC converter.

Rev A?


Sharp-eyed readers will note that this shared version of the board is Revision B. Well, that begs the question: what happened to Revision A? The original version of the board used a different OCXO, the 1" square NDK unit that I incorporated into my Racal-Dana upgrade. Due to the lack of a voltage reference on that OCXO, I had to incorporate an LM4140 into the design. The square wave output of that unit was also not ideal for the Philips counter. The whole design seemed needlessly complicated to me, especially when I knew I could make a more elegant solution based around the CTS OCXO.

Revision A of the PM66xx OCXO upgrade board. This one didn't make the cut.


Wrap Up


Please let me know if you assemble one of these boards for your counter! I have also provided the Eagle files, so you can modify the board if you like to use a different OCXO footprint. I have an entire case of the CTS OCXOs to use up, so expect some more shared projects that use them in the future.

Thanks for reading!

- Dan W.

Monday, April 4, 2016

New "Lab" Equipment: Nikon D3300 DSLR

I have needed a good camera for some time now. I've always been interested in photography and owned a couple of film SLRs back in the day, but never made the jump to a DSLR. The cameras in modern smartphones are so good, it's really easy to get by without a proper camera. As of today, however, I have some new equipment in hand to re-kindle an old hobby.

My new Nikon D3300 DSLR.
Photo taken by an iPhone 6S (and heavily post-processed).

Nearly all of the photos on this blog were taken by my iPhone. It has a decent camera, but taking pictures of small objects in indoor lighting can be challenging even with a good set of equipment. Two issues I constantly struggle with are underexposure and white balance. I have to heavily post-process the photos to make them presentable, and even then I can get some very strange color and noise artifacts. Lately I've just been blowing out the white background by cranking up the exposure, and then tweaking the temperature until it it looks "ok".

That all changes today! I am now the proud owner of a Nikon D3300. It is certainly an entry-level DSLR, but it has the features I need at a good price. I'm really looking forward to using it over the next few weeks and re-learning all the things I have forgotten about proper photography. The camera is also capable of recording video at 1080p/60fps. One of my plans for the blog is to launch a YouTube channel and start producing video content. This will be a starting point equipment-wise for getting that up and running.

I can't offer a lot of insight on the camera right now, but I did set up the tripod and take a couple of sample photos.

My Citizen Eco-Drive. Watches are very photogenic, aren't they?

A lovely open-source frequency counter board by Andy Brown.
I need to do a post about this one in the future.

What do you think of the above photos? Both would have been quite difficult to do with the iPhone. I certainly notice huge differences in the raw images but they may not come through in the uploads. I did have to do some post-processing, primarily because of the poor lighting I have available to me. I am planning to purchase a soft box to help with the lighting situation for taking pictures of my projects.

That's all for now. Expect higher quality photos (and videos!) on the blog in the future.

Thanks for reading!

- Dan W.


Thursday, March 31, 2016

LoRa Products Coming from Adafruit!

Over the past couple of months I've been working on bringing LoRa support to the Adafruit Feather line of microcontroller boards. I designed a small Development Breakout FeatherWing for the HopeRF RFM95/96(W) module, as well as the LoRa FeatherWing IOX that uses an I/O expander to drive the numerous pins of the RFM module over I2C.

My boards are of course non-official FeatherWings that can be added as daughterboards to Feathers (similar to shields for Arduinos). Well, it looks like Adafruit has also been working on LoRa products! On a recent episode of their weekly Ask An Engineer web show, Ladyada gave a sneak peak of some boards she has in the works. One looks to be a Feather board with an RFM95W module directly on it. Another board is a breakout for the RFM module.

Prototype of a new "Top Secret" LoRa Feather.

Breakout board for the RFM modules (yellow PCB) along with a tester and a live demo.

This is great news for the LoRa community. As official products, they will be sold in the store and no doubt come with excellent code support and tutorials. Additionally, it will help to integrate LoRa Feathers with other FeatherWings and eliminate the need for a daughterboard just for the module itself.

There was no ETA given on the LoRa products, but with functional prototypes and testers already completed, we shouldn't have to wait long.

Thanks for reading!

- Dan W.

Sunday, March 20, 2016

Atmel SAM D09 Development Board

In this post I will document a development board that I designed for the Atmel SAM D09 microcontroller.

A fun little development board for the Atmel SAM D09.

Introduction


The Atmel SAM D series of 32-bit microcontrollers includes several devices, each with a long list of features at great prices. Perhaps the best known of the series in the maker community is the SAM D21 due to its use on the Arduino Zero. However, there are several other devices in the product line that are worth taking a look at. The smallest of the bunch is the SAM D09 that comes in a 14-pin SOIC package. The 14SOIC package is one of my favorites. It is easy to solder, easy to break out on a PCB, and takes up little board space. I decided to order some SAM D09C chips and design a small development board in order to learn more about the capabilities of the device.

Atmel SAM D09C


The SAM D09C in the 14-pin SOIC package is capable of running at 48 MHz, includes 8K of FLASH and 4K of SRAM, and has 12 GPIO pins with numerous peripherals. Despite the significant upgrades compared to similarly-sized 8-bit AVR microcontrollers, it is actually cheaper! For example, when purchased in single quantities the SAM D09C costs $1.15 USD, versus an ATtiny841 which is $1.67 USD. (Prices from Digikey, 3/20/2016). The ATtiny841 is one of my favorite AVR devices, and quickly replaced the use of the venerable ATtiny84A in my projects when it came out. However, this SAM D09C has me considering yet another update for my projects that need a 14-pin microcontroller. Once you are familiar with programming ARM Cortex-M devices, upgrading to feature-packed 32-bit microcontrollers makes sense for numerous reasons.

Let's take a look at the pinout and a table of features for the SAM D09.

Pinout for the Atmel SAM D09C (14SOIC).


Features of the SAM D09 devices in SOIC and QFN packages.


Development Board


The development board that I designed for the SAM D09C makes it very easy to work with the device. The pins of the microcontroller are broken out to standard 0.1" headers. I included a high-quality 32.768 kHz external crystal, which can be used with the on-board DFLL or DPLL to generate system clock frequencies up to 48 MHz. You can also use it with the Real-Time Counter (RTC) in the SAM D09 for accurate timekeeping. Additionally, I included a reset button, power LED, and a user LED connected to pin A25. The chip is programmed via a 10-pin Cortex Debug header.

Connect an Atmel ICE to the Cortex Debug header for programming and debugging.

For powering the board, I added a spot for a CR2032 coin cell battery holder on the bottom. This is a nice solution for testing low-power configurations and/or using the board without power supply wires attached. The supply voltage range of the SAM D09 is 2.4V to 3.6V, and this matches nicely with the output voltage of a CR2032 over its discharge cycle. You can also power the development board with an external power supply by connecting to the VDD and Ground pins on the headers. Make sure to remove the CR2032 battery before connecting an external power supply!

CR2032 battery holder on the bottom of the development board.

Programing the device is quite easy in Atmel Studio. The Atmel ICE integrates nicely with the IDE, and the Atmel Software Framework (ASF) helps you to develop programs rapidly. Programming 32-bit microcontrollers is much more complex than programming 8-bit devices, and a good set of libraries is important when you are getting started. The development board does need to be powered externally for programming. I found that throwing in a coin cell battery to power the SAM D09 and upload my program was quite handy.

Atmel ICE programmer/debugger connected to the development board.

Assemble Your Own


Here is the information you need if you'd like to make your own development boards for the Atmel SAM D09C.

Atmel SAM D09C Development Board: Order PCBs on OSHPark!

Parts List:
  • Microcontroller: Atmel SAM D09C 14SOIC
  • CrystalCitizen CM200C32768
  • Reset ButtonC&K PTS525SM15SMTR2 LFS
  • C1: 10uF 1206 Tantalum SMD capacitor, 10V rated minimum
  • C2, C3: 100nF 0603 Ceramic SMD capacitor
  • C4, C5: 22pF 0603 Ceramic SMD capacitors
  • LEDs: 0805, colors of your choice
  • R1: 10k ohm 0603
  • R2, R3, R4: 560 ohm 0603 (adjust values of R3 and R4 to change brightness of LEDs)
  • Battery Holder: MPD BK-912 CR2032 Holder
  • Debug Header: Amphenol FCI 20021111-00010T4LF
  • Headers: 2x 7 pin standard 0.1" headers (your choice of male or female)
  • Screws and Standoffs: Sized for M3 screws, standoff length is your choice.

Notes: If you want to do away with the power LED for low-power testing, you can also omit R3. The value of R2 is not critical, use whatever value you pick for the LEDs. There are various stability and load capacitance options for the CM200C 32kHz crystal. I picked the +/- 5ppm version with 12.5pF load capacitance.

Assembly Note: Before soldering on the CR2032 holder, tin the square ground pad in the middle of the footprint. It should have a little mound of solder on it to ensure good contact with the battery.


Atmel SAM D09C development board schematic.

Atmel SAM D09C development board layout.

Here's a straight-on shot of the board to help with assembly.

Wrap Up


Let me know if you order PCBs and make your own development boards! This is a fun little board, and I'm looking forward to doing some projects based around this very capable microcontroller.

Please post any questions and comments below.

Thanks for reading!

- Dan W.

Saturday, March 19, 2016

DIY LED Light Bulb Kits

Recently I saw a video by bigclivedotcom on YouTube about LED light bulb (lamp) kits from eBay. I decided to pick up a few of these kits and check them out. I was not disappointed!

LED light bulbs I assembled myself. Lots of fun!
The LED colors shown are cool white diffused, multicolor and warm white clear.


Cheap LED Lamp Kits from eBay


These kits can be found for less than $2 USD on eBay. One example listing to start your search if you want to purchase your own is #171505070176. That price does not include LEDs, but the real beauty of these is that you can assemble them with any LEDs you want. You can purchase white LEDs in many different color temperatures, such as cool or warm white. Colored or multi-color LEDs are also an option, as Big Clive did in his video. He also did a video assembling one of these kits with neon lamps!

The kit comes with the plastic housing, a clear plastic dome, two small circuit boards, and the parts you need to assemble the power supply circuit. The ones that I ordered house 38 LEDs, but there seem to be a variety of kits on eBay in different configurations. Grab some of these and a huge bag of cheap LEDs and you are ready to make some light bulbs!

Contents of the DIY LED lamp kits.

Assembly


The kits do not include any instructions, but assembling them is pretty easy. All of the component values on the small green power supply PCB are labeled in the silk screen. Just place the parts as shown and solder it up. Do be careful with the polarities of the electrolytic capacitor and diodes, though. The circular LED board clearly shows the correct polarities for the LEDs, so that is also easy to stuff.

The LED and power supply boards assembled and ready for installation.

Strangely, the attachment points for the power supply on the LED board are just pads without drills. Hmm.... The board in one of the kits I got had misaligned solder mask that exposed a trace between two LEDs next to the DC input pads. Yikes! These issues may or may not be present on the boards you get.

Attachment points on the power supply and LED boards.
Can you spot a safety hazard here when they are crammed into the housing?

As I started to install the boards into the housing, I saw that it would be very easy for shorts to happen between the exposed electrical connections on the undersides of the boards. I decided to put electrical tape across the bottom of the power supply board to insulate it from the LEDs.

Almost done!

Before snapping on the clear plastic dome, test the bulb to make sure it works. Murphy will ensure that at least one LED doesn't work if you don't test it first. It goes without saying, but please be careful when doing this. The power supply board has completely exposed mains AC voltage on it.

Super cool custom LED light bulbs.
The bulb with blue, yellow, and orange LEDs makes a nice violet color.

Wrap Up


These are fun little kits. I wouldn't recommend them for making light bulbs to install throughout your home. The obvious safety hazards of these kits and inconsistent hand assembly make them a bit dangerous. However, I think they are useful for fun projects and making novelty LED light bulbs that will be used in a controlled setting.

Thanks for reading!

- Dan W.

Friday, March 18, 2016

Checking Out the New Atmel ATtiny102/104

In this post I will discuss my experiences with the Atmel ATtiny104 Xplained Nano kit, and compare this new microcontroller from Atmel with other ATtiny devices.

The Atmel ATtiny104 Xplained Nano evaluation board.

Introduction


I love microcontrollers, and I do my best to keep up with new devices being released from the major manufacturers. Recently, I saw that Atmel had released new ATtiny devices, the ATtiny102 and ATtiny104. I decided to order one of their Xplained Nano kits for the ATtiny104 and check it out. The board costs $4.50 USD and is available from Digikey right now. Other distributors have it on order.

Update (4/5/16): Mouser now has the kit in stock as well.

Let's be honest, the cool box is worth the price of admission. 


ATtiny102/104


First step in researching any microcontroller: look at the datasheet. Let's get a few of the basics out of the way first. The ATtiny102 is an 8-pin device that comes in SOIC and UDFN packages, and the ATtiny104 is a 14-pin version of the device that comes in SOIC only. The larger device has extra GPIO, and extra channels on some of the peripherals such as the Analog-to-Digital Converter (ADC), but otherwise they are identical.

 Pinouts of the ATtiny102 and ATtiny104 in SOIC packages.


As I read through the key features of the new microcontroller, I immediately saw some parallels to the ATtiny4/5/9/10. I played around with the ATtiny10 quite a bit when it first came out, and recently developed a super tiny breakout board for it. However, I saw some very interesting additions to this new device, such as a hardware USART. I decided to make a table comparing the key features of the ATtiny102 and ATtiny10 (8- and 6-pin devices respectively). I also included the classic ATtiny85 in the comparison that has served me well in numerous projects. The ATtiny85 is well-known and loved by many embedded developers and electronics enthusiasts alike, and it even has coveted Arduino support to help make the device accessible to all.

Comparing the key features of the ATtiny102, ATtiny10, and ATtiny85.
(Unit costs shown are from Digikey, 3/18/2016)

We see many similarities between the ATtiny102 and the ATtiny10, especially in the amount of FLASH, SRAM, instructions, and general purpose working registers. However, the new device has some key upgrades. The most important of these is probably the hardware USART, which can also work in an SPI Master mode. While the ATtiny10 is very capable at collecting data from sensors and the like, it has almost no way to pass that data on to another device for processing. It is meant to handle simple, embedded tasks on its own. Given the tiny board space occupied by the SOT-23-6 chip and the low cost, it does very well in that regard.

The hardware USART on the ATtiny102 opens the device up to many more projects and potential uses. You can pass data on to another microcontroller, or even transmit it using a wireless module that accepts data over serial and handles the wireless transceiver functions on its own. Additionally, the ATtiny102 has some upgrades on the ADC front. Importantly, it has 10-bit resolution, where as the ATtiny10 has an 8-bit ADC. Besides an extra ADC channel, you also have three internal voltage references in the new device which can improve the accuracy of your measurements, especially when powered from varying supply voltages.


Comparison with the ATtiny85


In many regards, the ATtiny85 is a more robust device. The extra FLASH, SRAM, working registers, and instructions are crucial when developing more complicated solutions. Tasks we take for granted on many AVR devices such as floating point arithmetic and string manipulation are very difficult to implement on the ATtiny10 and ATtiny102/104. The ATtiny85 also comes in a DIP package, which is important to many electronics hobbyists.

However, the lack of a hardware USART on the ATtiny85 has always been a limitation. You can do software serial, but a hardware peripheral is very welcomed when available. Also, the ATtiny85 only has 8-bit counters, where as the smaller ATtiny devices have single 16-bit counters.

Finally, the ATtiny85 costs more, even when purchased in volume. The price difference doesn't seem large on the table above, but component cost adds up when using many of the devices in a solution, or designing something that will be produced in quantity.


ATtiny104 Xplained Nano


Atmel did a great job on their evaluation board for the ATtiny104. The board has a programmer and debugger built in! Simply plug it into your computer with a USB cable and it connects directly to Atmel Studio 7 for programming. I encountered no issues working with the board in Atmel Studio, though I did have to update the program before using the board.

My favorite feature of the Xplained Nano board is that you can connect to the USART on the ATtiny104 over USB and talk to it with a serial terminal. This is HUGE for prototyping and development when you need to read out your data for debugging and verification. The serial link is available as a simple COM port, and I found that I could keep it connected to my terminal program even when re-programming the chip.

The ATtiny104 Xplained Nano has a user button and LED on board, and breaks out all pins of the microcontroller. Additionally, you have some options for taking current measurements and running the ATtiny104 at supply voltages other than 5V USB.

Check out the official documentation on the evaluation board for more info:

ATtiny104 Xplained Nano User Guide
ATtiny102/104 Getting Started Guide

Wrap Up


I enjoyed working with the ATtiny104 evaluation kit, and I plan to order some bare chips when they are available from distributors. This new microcontroller from Atmel does have limitations as I discussed above, and other AVRs may be better options for your project. But if you have worked with the ATtiny10 before and just wished it had a USART, or if you need a low-cost chip for simple embedded tasks in a project, I think this is a good device to consider.

Thanks for reading!

- Dan W.