HomeHome / Blog / Handy

Jul 07, 2023


Clive 'Max' Maxfield | Jan 24, 2023 It seems like only a couple of weeks ago that I wrote my column "Build Amazing Mechanical Circuits That Run Just Like Electronic Ones. But How?" Known as

Clive 'Max' Maxfield | Jan 24, 2023

It seems like only a couple of weeks ago that I wrote my column "Build Amazing Mechanical Circuits That Run Just Like Electronic Ones. But How?" Known as Spintronics, this cunning creation was conceived by Paul and Alyssa Boswell, whose previous claim to fame was a marble-powered computer called the Turing Tumble.

The idea behind Spintronics is to create spinning mechanical analogs of electrical and electronic devices, where these mechanical implementations are connected using chains as wires. In addition to a power supply and switch, there are mechanical implementations of junctions, resistors, capacitors, inductors, transistor, and an ammeter.

Although Spintronics is primarily intended as an educational tool for younger folks, I personally believe it’s going to be of interest to people of all ages. The awesome news is that I recently heard from Paul that Spintronics kits are now shipping around the world.

I’d be embarrassed to tell you how many hours I’ve spent with the Turing Tumble in my office, and I dare not even think about the amount of time I’m going to devote to my Spintronics kit when it arrives.

Perhaps not surprisingly, one thing Spintronics doesn’t provide an analog for is switch bounce. Most non-engineers assume that when they activate or deactivate a toggle switch or a pushbutton switch, it closes and opens cleanly. In reality, that switch will bounce, which means it may open and close anywhere up to 100+ times over a period ranging from microseconds to milliseconds.

Just for giggles and grins, I used my trusty RIGOL DS1054 oscilloscope to capture some representative switch bounce waveforms as illustrated in the image below. From top to bottom we have the traces from a toggle switch, a pushbutton switch, and a limit switch (aka, microswitch).

Representative switch bounce from a toggle switch (top), pushbutton switch (middle), and limit switch (bottom).

Even practicing engineers can be caught out by switch bounce if they’ve not run into it before. We introduced various software and hardware techniques we can use to mitigate switch bounce in my column "How to Keep a Flipped Switch From Bouncing Like a Golf Ball Dropped From the Roof."

One of my favorite hardware solutions is to use an LS18 integrated circuit (IC) from LogiSwitch. I should mention the fact that one of my many “hats” is that of Chief Technical Officer (CTO) at LogiSwitch, so I may be a tad biased, but I think our NoBounce ICs are the “bee’s knees” with respect to debouncing switches.

The 3-channel LogiSwitch LS18 addresses both noise and switch bounce.

In addition to the 3-channel LS18, we also have 6- and 9-channel versions. Also of interest, especially to me when I’m creating my hobby projects, is that all these chips are available in lead through-hole (LTH) and surface-mount technology (SMT) packages (we offer even smaller packages for special applications).

The reason I’m waffling on about all this here is that we recently decided to create a small circuit board to demonstrate the capabilities of the LS18 in conjunction with a specific device from an industry-leading switch manufacturer. My friend Joe Farr in the UK designed this demo board for me one wet Saturday morning.

LS18 demonstration board.

I’ve hidden the names of the company and the switch involved to protect the innocent (me, for one). One interesting point worth noting is that—as seen in the area marked “LogiSwitch LS18”—although we decided to use an SOIC SN packaged version of our chip for this demo, Joe also included the pads for PDIP, MSOP MS, and SOT23-6 packages to provide a quick visual size comparison (the SOT23-6 device is so small that you can barely see it).

But we digress … The reason for this column is the board’s power supply design. As usual for this type of application, Joe created this in such a way as to allow users to plug in an AC or DC source from 7 V to 12 V (in the case of a DC source, you can use either polarity; that is, center positive or center negative).

Joe also included a jumper with two associated loop headers (see the bottom left-hand-corner of the board) to allow the user to monitor the current being drawn by the LS18 (the board’s power LED is wired upstream of this jumper so its current won’t be included).

I’ve seen Joe’s power supply designs before, but there are two aspects to this one that particularly caught my attention. The first is the fact that Joe included header pins and a jumper that allow the user to select between 1.8 V, 2.3 V, 3.3 V, 5.0 V, and ADJ (“adjustable”) values, where the latter can be set using the “V.ADJ” multiturn potentiometer (there are surface-mount pots used to fine-tune the other values located on the underside of the board). The second point of interest is Joe’s use of a Zener diode to ensure the user can’t set the voltage higher than 5.5 V.

On the basis that it’s always handy to have a little power supply for one’s hobby projects, I asked Joe if he could spin out a standalone version of this adjustable unit. He very kindly did so, and the images below show the schematic, layout, and finished board.

Schematic for adjustable DIY power supply.

Layout for adjustable DIY power supply.

Assembled adjustable DIY power supply.

I should perhaps point out that, for reasons known only to himself, Joe always lays out his power supplies from right-to-left, and I’m certainly not going to cast aspersions (my throwing arm is not what it used to be).

As we see, this design features the use of an LM317 adjustable 3-terminal positive-voltage regulator that requires only two external resistors to set the output voltage. In our case, one of these resistors is a fixed 220-Ω device, while the other is a 2-KΩ multiturn trim pot. In fact, we have two such pots on this board, VR1 and VR2, thereby allowing us to select between two voltages using jumper at J1 or J2. We could modify the design to add more pots to provide a larger selection of voltages if we wish…

…speaking of which, Joe also kindly shared the design files so you can build your own boards if you so desire. This compressed ZIP file contains the *.dch (schematic) and *.dip (layout) files in DipTrace format (you can download a free copy of the DipTrace schematic and PCB design software from www.diptrace.com).

Component list.

In addition to the component list shown above, Joe also provided the following notes:

If the truth be told, Joe is a bit of a pack rat in that he snaffles up things like components and connectors whenever he sees them on sale. For example, he has boxes of full wave rectifiers that he picked up for a song deep in the mists of time. This is great for Joe, but not so great for the rest of us who are trying to track down identical parts. This explains why Joe implemented the full wave rectifier on this board using four 1N4007 diodes.

I must admit that I haven’t paid as much attention to the design of power supplies as perhaps I should. All I know is that whenever I ask Joe to design a board for me, it comes equipped with a power supply that is perfectly crafted for the task at hand.

If you do decide to take this design and build your own board—or perhaps use this design as a starting point to evolve your own version—I’d love to hear about it (including pictures). And, as always, I welcome your comments, questions, and suggestions.

More information about text formats