Isolated USB Interface Using the CH340G UART-USB Chip

USB TeaserThe monitor I've mentioned will be used to monitor faults in a piece of FAA equipment.  It has morphed from the initial concept of just providing some indicator lights to being a data logger to aid in determining the root cause of a failure.  The original concept was to "play back" the sequence of faults recorded on the board's LEDs; this expanded to having a USB interface to read out data serially.

In the past, I have observed problems when interfacing to installed equipment - most often grounds being at different potentials.  This can result in sparks, tripped circuit breakers and damaged equipment.  In this case, dealing with aircraft navigational equipment, I opted for an abundance of caution.  An isolated USB interface would protect both the computer connected to the data logger and the monitored equipment.

FTDI is the common choice for USB-UART chips but they have been plauged by fake chips and controversy with drivers being revised to not work with fake chips or to even destroy them.  Not a good way to keep people happy.

For this design, I opted to use the Chinese CH340G USB-UART chip.  It's cheap and popular (since many Arduino clones are using it) and the driver is readily available.  DreamCity Innovations have worked up a data sheet for this chip since the original is in Chinese.

My isolated USB interface design is based on an example in the DreamCity data sheet, with slight changes.  Their schematic shows an inverter on the microcontroller transmit line, lists the part number of a buffer with the note "... but helpful when the input pins cannot source too many current."  The PIC 18Fs that I work with can source many current (25mA), so this addition was unnecessary.

The resulting circuit is pretty simple and having it optically isolated didn't add much complication.  The schematic is shown below.  The CH340G is in a 16 pin SOIC package so it's pretty easy to handle.  I can't say the same thing about the micro-B USB connector!  The pins are extremely fine-pitched but the connector I used isn't too difficult to work with - it actually fits in a cutout in the circuit board so the tends to be aelf-aligning to the pins.

Read more: Isolated USB Interface Using the CH340G UART-USB Chip

Discuss this article in the forums (0 replies).

Building Tools to Aid Development

switch box 6 300pxFor development and testing of the fault monitor I'm working on, I need to simulate 8 0v/5v signals.  I used the PICkit 2 logic tool for some simple testing and I could have used jumpers to kludge something together but there will be a lot of testing as I get all the features together, so something a little more user friendly and robust was in order.  One way I could have done this was to use a 8 bit DIP switch, but fiddling around with the tiny levers is kind of a pain in the butt.

I decided the best solution was to build a switchbox with toggle switches that can quickly be set to desired patterns.  I had a handful of mini toggle switches purchased long ago on ebay that are of a quality such that I don't want to use them anyplace where I'm depending on the switch to work, so that was a starting point. My data lines are pulled high by 10k resistors, so I could just use a SPST toggle switch to short each data line to ground.  Nothing too complex to hand wire.

Close at hand was an enclosure I had ordered from iTead for $5.  This stylish box was overkill for this project but it worked well.  I have some measurements for a circuit board which I'll include at the end of the article.

Read more: Building Tools to Aid Development

Discuss this article in the forums (0 replies).

PICkit 2 Logic Tool Trap

PICkit 2 Logic Analyzer - 300pxThe PICkit 2 logic tool/analyzer is a handy tool to have around, especially since the price is right!  The analyzer mode can show the timing of signals, and the logic tool can be used to monitor the output status of a few bits or to exercize a few inputs.  The logic analyzer and UART tool are reasons why I don't upgrade to the PICkit 3.

I'm working on a simple monitor that will record and display the status of 8 test points.  In the piece of machinery being monitored, a number of conditions can lead to shutdown, but the only indication a technician troubleshooting the issue is that one or more of these conditions caused the shutdown but not which particular faults occured.  A couple of the fault conditions are temperature-related, so a technician arriving some time after  a shutdown has occurred has little to go on for troubleshooting.

The monitor I am building will show what faults have occured, and the sequence in which they occurred.  It should be a powerful tool for the technicians.

I need to simulate the fault conditions to develop the software.  As I get it refined, I'll need to generate 8 signals, but for the initial work, simulating a few inputs will be sufficient.  I am using port B of the 18F26K22 to monitor the eight signals.  RB6 and RB7 are the ISCP programming pins, but there won't be a programmer connected in the field.  Using the PICkit 2, I can easily exercise RB6 and RB7 without making any changes in connections.  It's pretty slick.

Read more: PICkit 2 Logic Tool Trap

Discuss this article in the forums (1 replies).

Using OpenBeam Extrusion to Create a Custom Enclosure

OpenBeam profile -300The FAA recently asked me to come up with a solution for mounting one of my Wake Turbulence Timers at a location with a metal console panel; they didn't want to cut a hole through the panel but preferred a surface-mount solution instead.  One hard requirement was that it use a standard timer with no modifications in case the timer had to be replaced at some time in the future.

T-Slots and Tabs

I have used t-slots in laser-cut acrylic before to make a stand-alone enclosure for use in a training center but I'm not sure that approach will stand up to day-to-day use and abuse past the point where I no longer care.  The technique is handy for some applications but perhaps not a heavy-duty industrial application.

Apparently I haven't posted about the t-slot method here before, so I'll touch on it lightly.  In a t-slot joint, one panel has tabs that fit into slots on the mating panel, and a t-slot that's (typically) sized to fit a 3mm nut across the flats.  A screw goes through the mating panel into the nut and is tightened to hold the joint secure.

Read more: Using OpenBeam Extrusion to Create a Custom Enclosure

Discuss this article in the forums (3 replies).

Octopart - A Handy Site to Know

banner - 300Whether you're designing something new, or building an existing design, Octopart is a handy website to know about and use!

Until recently, my biggest use of Octopart has been to track down needed components and to compare prices.  I checked the availability of a high side switch I'm considering for a USB charger is the car I'm working on.  I could go to Digikey and Mouser to check the price and availability, but an easier way is to type the part number into Octopart and you'll instantly be presented of a table with price and availability from a number of distributors.  Just a note - Octopart covers commercial distributors like Digikey, Mouser and Allied Electronics, but doesn't cover places like Jameco.  The table below shows the results for the high side driver.

Read more: Octopart - A Handy Site to Know

Discuss this article in the forums (1 replies).

Found Enclosures - Using What's Available

pic 2 - 300At some point, many of our projects should go into an enclosure so that it looks nice or is projected from damage and even weather.  Many styles of enclosures are available from Radio Shack (yes, they are still in business), Digikey and Jameco but cost can be high and finding exactly what you want can be difficult.  Often, with a little ingenuity, enclosures can be found at hand.  I've shown some different options here in the past for enclosures but you may be neglecting a great source of stylish enclosures as close as your bathroom - stick deodorant containers!

These come in different colors in a small range of sizes and some even have transparent end caps if you want to show some LEDs.  These containers are nearly air-tight too, so a water-tight enclosure can be arranged with some judicious use of silicon sealant.

The pictures here show a couple of Old Spice Deodorant containers.  A TAP-28 Plus board (98mm x 60mm) slides right in the larger container with about 12mm to spare in the length.

Read more: Found Enclosures - Using What's Available

Discuss this article in the forums (5 replies).

Piezo Beeper Volume Control - Sometimes Projects Aren't Easy

My FAA Wake Turbulence Timers have been installed at 10 test sites for a year.  The evaluations from the Air Traffic Controllers who have used them are favorable, but one requested feature was a volume control for the piezo beeper used to signal the end of the countdown period.  In some towers, the beeper was just the right volume, but in quiet towers, it was way too loud.  This didn't seem like a difficult problem to solve.

Floyd Bell Beeper - 300The beeper used was actually a magnetic beeper - it's an active beeper, requiring only the application of 5VDC to sound.  An active piezo beeper could just as easily be used, so I started with a search for controllable-volume piezo beepers.   There are indeed piezo beepers with a volume control - a mechanical shutter to control the size of opening of the sound exit.  Beepers of this type are huge and not suited to my application where the maximum beeper diameter is about 16mm.

Read more: Piezo Beeper Volume Control - Sometimes Projects Aren't Easy

Discuss this article in the forums (15 replies).

From EDN: Clever engineering creates rock-bottom component tester

Michael Dunn -August 15, 2014

While this sub-$20 board may not gain pride of place in your T&M rack, it's a fine tool for hobbyist and pro alike, and demonstrates the power of clever design.

Recently, while thumbing through eBay, I stumbled upon what appeared to be a magical everything component tester, for under $20. Always hungry to try new gizmos, I couldn't resist its charms, and placed my order with this seller, located in Shenzhen, China (there are other sellers too).

I normally wouldn't risk even $20 on such a toyish object, but this one inspired some confidence. The voluminous screen shots and the good seller rating were cause for some hope. And (spoiler alert), I wasn't disappointed. This is a really nice little design.

Read more: From EDN: Clever engineering creates rock-bottom component tester

Discuss this article in the forums (5 replies).

Test article for kunena discuss

Nullam sagittis. Nunc sed turpis. Nullam vel sem. Etiam iaculis nunc ac metus. Nunc nec neque.

Phasellus dolor. Praesent venenatis metus at tortor pulvinar varius. In hac habitasse platea dictumst. Praesent metus tellus, elementum eu, semper a, adipiscing nec, purus. Praesent egestas neque eu enim.

Vestibulum dapibus nunc ac augue. Duis arcu tortor, suscipit eget, imperdiet nec, imperdiet iaculis, ipsum. Curabitur ullamcorper ultricies nisi. Nullam accumsan lorem in dui. Nullam sagittis.

Proin faucibus arcu quis ante. Sed mollis, eros et ultrices tempus, mauris ipsum aliquam libero, non adipiscing dolor urna a orci. Cras ultricies mi eu turpis hendrerit fringilla. Vivamus elementum semper nisi. Praesent blandit laoreet nibh.

Nam ipsum risus, rutrum vitae, vestibulum eu, molestie vel, lacus. Fusce commodo aliquam arcu. Donec orci lectus, aliquam ut, faucibus non, euismod id, nulla. Nunc nulla. Sed aliquam ultrices mauris.

DesignNews – Sherlock Ohms: Corroded Copper Stops Dial Ton

Corroded Copper Stops Dial Tone – Dave Boccuti 

A few decades ago, I owned a home in one of Boston's western suburbs. The house had been built during World War II, when nobody with any business building houses was doing so. But that's another story. This one is about the telephone.

One day, I picked up the phone, and there was no dial tone. I went to the neighbor's house (this was before cellphones) and called the phone company to report the problem. The company said it would look into it, so I returned home. A little while later, the phone rang -- it was the phone company asking about the problem. I hung up, checked for a dial tone, and called back to report it was A-OK.

All was fine for a few days, but then the problem came back. I walked over to the neighbor's house, and this time I called my house. My wife answered, and the phone seemed OK.

Read more: DesignNews – Sherlock Ohms: Corroded Copper Stops Dial Ton

Discuss this article in the forums (4 replies).

Forum Activity

Member Access