Goodnight Soekris

Sadly, Soekris is shutting down:

Soekris Engineering, Inc.

April 24, 2017
Due to declining sales, limited resources available to design new products, and increased competition from Asia, Soekris Engineering, Inc. has suspended operations in the USA as of today.

It has been our pleasure to serve our customers over the last 16 years. We are proud that we provided reliable, low-power communications computers Made in the USA to many markets worldwide.

Thank you for your business.

I built several pfsense routers with various soekris boxes and they’ve all been running flawlessly for years. I just looked at my router at the hilltop and it has been running for 381 days without a reboot (this router is on a UPS for no especially good reason but it does allow for long uptime runs).

The box has no fan, no moving parts (the filesystem is a nanobsd configuration on a CF card), it’s rack mountable, and it has six ethernet ports (I added a 4-port PCI card). It’s awesome.

The pfsense folks sell hardware (Netgate) now customized with pfsense right out of the box. I have one of their boxes in another location and it works perfectly well too, though I wish they’d support a nanobsd configuration (for the read-only filesystem and the alternating/two-boot-slice concept for updates).  Eventually I’ll change out the soekris boxes for newer gear; but for now … 381 days  of uptime and counting.

 

Oldest “Neil Webber” reference

Inspired by finding some thirty-year-old code of mine online, I wondered if there were any even older references… and I found one!

In the summer of 1979, having just graduated high school, I worked on a macro intepreter for the Initial Graphics Exchange Specification while I was a summer intern at the National Bureau of Standards (now called NIST). I wrote an interpreter for the MACRO statements that were proposed as part of that specification.

I found several copies of the full version 1.0 IGES specification online. This one is in text form:

https://archive.org/stream/initialgraphicse8019nage/initialgraphicse8019nage_djvu.txt

Being text you can easily search it for “Neil Webber” and find my name. 🙂

The actual design of the MACRO language syntax is a hoot and reflects the FORTRAN language practices of the time. For example, variable typing is determined by the first letter of the variable name.

I didn’t design this language syntax all I did was implement a processor that could run the macros and generated IGES statements from them. I vaguely remember that I called the program “bigmac” because it was a macro processor and it was “big” (meaning 64K-ish). It ran on a PDP11 under v6 Unix.

The IGES 1.0 document was published in 1980. This is the oldest reference to any of my work that I can find – partly because I’m pretty sure this would be the oldest bit of my work that was ever referenced anywhere.

I have not, unfortunately, been able to find any copies of the source code of the macro processor. I’m pretty sure NBS released it because part of the point of asking me to implement it as a summer intern was to show that the MACRO capability wasn’t “too hard”. I’m sure my program was probably an embarrassing mess of bad technique; on the other hand, having a summer intern implement the MACRO processor probably helped make the argument that it wasn’t “too hard” to do. 🙂

Thirty year old code almost still compiles (and does still work!)

Thirty years ago, in February of 1987, I published some code of mine on net.sources:

 

 

 

 

 

 

 

 

There is so much deliciousness in this old post, including evidence that my affinity for the word “actually” goes a long way back.

Because I was a hardcore Amiga nerd back then (as opposed to simply now being an all-around hardcore nerd), I also submitted the program for inclusion in the “Fred Fish Amiga Source Disks” that he (Fred Fish) used to curate. It was included on disk #66 and still available as “MallocTest” online here:

ftp://ftp.funet.fi//.m/pub/amiga/fish/001-100/ff066

For reasons surpassing understanding, I decided to download that code, unpack the archive (that itself took some research), and see if it still compiles and works.

IT DOES!

Well, almost. It generated over 40 warnings on my Mac, mostly related to modern declarations of C library functions vs the mismatched (if even present at all) declarations in the code.

It did generate one fatal error – one of my functions does not return a value but is not declared void. I’m pretty sure that’s because the “void” type wasn’t universal back then, and in any case it was common practice to just fall out the bottom of what were implicitly void functions (that had been implicitly declared as “int”).

So, I had to fix that to get it to compile; here’s the diff that made the thirty-year old compile:

29a30,33
> void add_to_events (struct memevent *);
234c238
< add_to_events (m)
---
> void add_to_events (m)

With that change, it still compiles and works! The code itself is a time capsule of everything that was wrong with software development back in the late 80’s, including most importantly the fact that the malloc/free library on a given machine might have a bug in it that this feeble test could uncover (which, apparently, it did, though I have since forgotten which platform I was researching malloc/free problems on at the time).

Presented, for your amusement: https://github.com/outofmbufs/MallocTest1987

 

FeelTech FY3224S Grounding Modification

I have one of those cheap FeelTech FY3224S  (FY3200S 24Mhz version) function generators. Sometimes sold under different brand names, including “Moo Hoo” and no-name at all, and sold by  “banggood” (not making that up!), amazon, and other online stores.

There is an extensive thread about these on eevblog.com that includes this post about getting a shock from the device:

I was just using my Feeltech FY3224S and felt something biting me…the culprits turned out to be electrons…I was getting a shock.  When I measured AC voltage with a multi-meter from any of the ground points on the Feeltech (e.g. the outside of the BNC connectors) to AC ground, I had around 19vrms

Here’s another blog referencing this same problem: http://www.dalbert.net/?p=322. He measured 82V peak-to-peak. On my device I measured 45V rms or so with nothing connected to the outputs, and measuring between the BNC grounds and earth ground. As all of these write-ups point out, there isn’t enough current to be dangerous; you “just” get a tingle. The problem is caused by the use of a switched-mode power supply not properly implemented for use with floating DC outputs (which this device has).

The best, but most complex, fix is to rip out the switched-mode power supply and replace it with a linear supply suited for floating-DC output configurations.

An easier solution, which many others have also done, is simply to tie the DC grounds to earth ground. In other words, don’t let the DC outputs float. I decided to do that, with a switch enabling me to go back to the original (floating) configuration if ever needed for some specific reason.

The eevblog thread is full of examples of people doing exactly what I did, so it’s not anything new. I’m just documenting it here on the assumption someone might find it useful anyway.

The original back of my generator looked like this:

You will note that the A/C input is two-prong and is not polarized.

I had a so-called “mickey-mouse” (C5/C6) power inlet that doesn’t take up much more space than the original two-prong inlet. I enlarged the opening as necessary with a rasp to accommodate the three-prong inlet. I also had a suitably-sized SPDT round rocker switch (SPST would have sufficed) and mounted it as shown below:

 

The idea of mounting it there is that the ground symbol already present serves as the label for the down-position of the switch; I wired the switch so that when it was down the BNC grounds would in fact be grounded to the earth ground. If you are wondering why the C5/C6 connector is sometimes called “mickey mouse” take a closer look at the above picture and you should be able to figure it out.

This picture shows the inside wiring:

I added the green wires going from the ground on the power inlet to one side of the SPDT switch, and from the center (pole) to the ground lugs on the back-side BNC connectors. But what about the front connectors? Well, all the DC grounds on this device are all connected together, so grounding these back here grounds them all. Obviously, the same observation leads to the conclusion that I did not need to tie both ground lugs together back here; just connecting to one or the other would have been sufficient. However, these two connectors are hooked up to the main board by two separate wire assemblies each with its own separate plug/jack, so by wiring both grounds here the grounding will still be effective even if one of those plugs works its way loose someday. But, realistically, that green connection between the two BNC ground lugs is superfluous.

In the original configuration the input power was not polarized; consequently sometimes the front panel switch was interrupting the hot A/C lead and sometimes it was interrupting the neutral A/C lead, depending on how you plugged the unit into the wall. A three-prong plug is obviously inherently polarized, and I made sure to hook up the power inlet such that the hot side went to the switch so that the input power would be fully cut off at the switch when the device is off (vs the circuit being interrupted only on the return/neutral leg).

I buzzed out the connections to make sure I knew which one was which:

This shows that the connections, when viewed from the back of the mickey-mouse connector, match up with the connections when viewing the plug face-on (the picture shows the not-connected configuration). From there I looked up which prong in an outlet was hot vs neutral. I was reasonably certain I knew this but looked it up again anyway. I carefully labeled and checked my approach 17 times to make sure I wasn’t confusing myself between the “outlet left/right” view and what I would see when soldering the back of the connector.

Obligatory safety disclaimer: don’t try any of this if you aren’t knowledgeable and skilled with 110VAC circuits. I’m not even going to tell you which one of the prongs is hot vs neutral because if you need me to tell you that, you probably shouldn’t be doing this!

Once I wired up the 110V inputs everything was ready to go back together. Here is is all buttoned up:

I used my label maker with a black-on-clear cartridge to add the FLOAT label at the top of the switch. The ground symbol already there serves adequately as a reminder for the other position. I didn’t quite get the FLOAT label lined up exactly right. I could fix it, but the switch is going to stay in the “ground” position 99.99% of the time, and all this is in the back of the unit, and only some of my overly OCD friends will notice or care. It stays as is.

With everything buttoned back up I tested the grounding:

This is showing 600 microvolts with the rear switch in the ground position. I should mention that the other multimeter lead was hooked up to a convenient ground elsewhere in my lab set up and that ground was coming from a different wall outlet. Many of my circuits are “home run” back to the panel so there might in fact have been a hundred feet (or more) of romex between these two ground connections. So a non-zero ground potential difference doesn’t surprise me, if we consider “600 microvolts” to be “non-zero” (and not a meter artifact either).

In the original, floating, configuration we get 48 volts:

That will tingle! Obviously the switch will usually be left in the grounded position and if I need a floating function generator I’ll just have to be careful, or spring for a “real” piece of kit instead of this $60 cheap, but rather useful, hack piece of equipment.

One last point, as mentioned in the eevblog threads and elsewhere. The USB port on this device is not ground-isolated. So if you want to float the device (the original configuration), AND you have a computer plugged into the USB port, AND if your computer is grounded (which it won’t be if you have a laptop running off a battery), then the USB ground will de-float the generator output. I suppose it’s also possible that if your computer is floating then the 45 volt “tingle” might make it to your laptop? Ick. In any case, it’s something to be aware of.

I did buy a USB isolator board from Adafruit. This can be used externally if I ever need to float this generator AND have the USB hooked up; alternatively I may explore permanently installing it into the device on general principles. The primary use for the USB port is for defining custom waveforms, which is something I don’t have any immediate need to do. So for now the USB isolation goes onto the “to-do” list and in the meantime I’ve got a function generator that will no longer “tingle” me unless I want it to.

Update: FY2300H

There is another version of the generator out now, the FY2300H (model numbers go backwards? lol!). A 60MHz version is more expensive than my 24MHz version: $330 vs around $90 for mine, but also obviously can provide faster waveforms. Here’s one at Amazon: https://www.amazon.com/Kuman-Generator-Arbitrary-Intuitive-Interface/dp/B06ZY2958F/

They seem to be available at varying prices for other speeds at AliExpress. The cheapest is $80 for a 6MHz version, and I found links for $130 for a 25MHz version though they were out of stock as I write this.

Note this interesting broken-english description:

With the new design of power supply, the utility model eliminates the disadvantage of small amplitude signal interference of the power supply of the hand-held instrument. (10mV small signal still has the perfect signal feature)

and as you can see from the pictures, it has an external wall-wart power supply. Presumably they provide one that is implemented properly and thus fixes the AC mains leakage problem of the power supply built into the FY3200 series. If I didn’t already have my other unit I’d probably buy one of these, even at the higher price (which will likely come down over time if you wait) rather than perform the modifications shown here, especially since that would give me a generator that could DC-float without AC mains leakage whereas the grounding modification only fixes the leakage when you aren’t floating the generator outputs.

pfsense router – almost 1 year uptime

I’m running a pfsense router on a (somewhat obsolete now but still serviceable) dedicated soekris box as the router for my (40 acre) hilltop “empire”. I have a somewhat complicated network topology: my Time Warner cable modem is in a building at the bottom of my hill but my house is uphill about a quarter-mile (as the wires run) away. I have a multi-mode fiber connection between the cable modem downhill and the router uphill, from which four internal networks emanate:

  • HILLTOP: my internal network.
  • GARAGE: runs back down the hill (on another fiber pair) to a separate maintenance equipment garage building.
  • DMZ: a true, isolated, DMZ topology for a few servers I want to allow access to from the network at large.
  • PUBLICWIFI: a no-password open-WiFi network for my guests; it is also appreciated by maintenance personnel working on stuff up here on the hill. Access control for this otherwise-open WiFi access point is provided primarily by the fact that the signals don’t reach the edge of my property line (at least in all the places I’ve tested for this). If you can get the signal the presumption is you should probably be allowed to surf the internet on my dime 🙂

The pfsense software makes it easy to configure these networks with appropriate firewall rules; for example no traffic is routed between the PUBLICWIFI network and any of the other networks (other than the WAN network to the outside world of course).

About a year ago I put the router on a UPS just because the mean time between power failures up here is about 2-3 months. Anecdotally, thunderstorms are the primary source of periodic, short, power outages/glitches.

Here’s the network statistics report:

Statistics for the hilltop network

As always, you may wish to click to view the image full size.

During the 322 days of uptime:

  • 2.5 terabytes have arrived at my router from the internet. That’s about 7-8GB per day, most of which is presumably netflix or porn (for network tests of course).
  • Of the 2.5TB, 2TB went to the house network and 0.5TB went to the maintenance building where my property manager works.
  • The DMZ served out 5.6GB (a whopping 17MB per day). There are some status servers on this network that my property manager and I periodically surf to check in on things if I’m not here.
  • The public WiFi pulled 20GB down from the internet (about 62MB/day). The maintenance workers don’t seem to surf very much porn 🙂

I had a 12-pair multi-mode fiber installed to run up/down the hill and I am using two of the pairs. One pair runs from the cable modem up to my router. Another one runs back down the hill to the GARAGE to carry the (internal) network back down into the maintenance building. These runs are each about 1300 feet, or about 400 meters. The fiber transceivers I’m using (StarTech MCMGBSC055) are supposed to be good for 550m at 1Gb and appear to be functioning well. There are zero errors across the board except for one output error recorded in the entire year. My guess (and it is purely a guess) is that the output error occurred during a power failure. My router is on a UPS but the transceivers are not, so a power failure that happens during a packet transmission might show up as an output error. Otherwise I’m at a loss to explain how there could be an *output* error detected by the router; I’m guessing what really happened is that the ethernet connection between the router and the fiber transceiver went down when the power failed in the middle of a packet transmission. The router is on the UPS but other network gear is not; the only point of the UPS here is to shield the router from the strain of unnecessary power-glitch reboots; it is not intended to keep my network up during outages.

Knowing a little bit about the waveforms and the technology that makes all this stuff work, I am always impressed that stuff like this actually *does* work.

So far the 1Gb link is faster than my cable modem connection. I’m not going to be able to go to 10Gb without laying new (single mode) fiber. The fiber run is in a conduit with periodic access/pull points, so supposedly this will be possible, but it won’t be especially cheap or easy. Since I have some spare pairs I may be able to get more bandwidth in the future with link aggregation; I’ll worry about that technical problem when/if my internet connection exceeds 1Gbps from the ISP (when is google fiber coming here?!!!)

555 Timer Chip and the importance of bypass capacitors

DISCLAIMER: There’s nothing in this post that hasn’t been said in a zillion other posts about 555 timer chips, power rail decoupling capacitors, and bypass capacitors. I just wanted to see it all for myself and then of course I felt compelled to document what I had learned.

 

I built myself the standard astable configuration of a 555 timer, operating at a calculated 125Hz and measured at 119Hz:

I implemented this on a breadboard with reasonably-neat/short/organized leads, and hooked it up to the oscilloscope to see how it was working:

The yellow trace is the output of the 555 chip and looks pretty reasonable at this scale. The blue trace is hooked up to the 5V rail, AC coupled. Everything looks plausible at this scale, but let’s look closer:

Here we’re zoomed into the rising edge of one clock cycle. You may wish to click on the images to bring them up in full resolution in their own browser tab. Again the yellow trace is the 555 output; it’s pretty nasty and appears to peak at almost 7V and then ring out a bunch. But even worse look what’s happening to the 5V supply rail – the blue trace. I’ve got it on AC coupling so the steady-state 5V DC is “zero” and the excursions from there represent garbage on the power rail. It’s dipping down more than 3V then shooting back up before eventually settling back down at 5V. I’m driving this with an Agilent E3610A lab bench power supply so there is no question that the supply itself is high quality. The problem is the 555 chip is notorious for high current draw and other nasty effects during transition, and we can see that here.

The common solution to this is to put one or more capacitors between the +5V and ground to decouple the chip from the power supply – to serve as “reservoirs” of charge from which these current spikes can be drawn without pulling down the Vcc rail itself.

So, following the cookbooks, I put a 2.2µF electrolytic capacitor across the power rails, and got this:

This is obviously a gazillion times better Now the instantaneous dip on the Vcc rail is just about 1V instead of 3V and it no longer spikes upwards at all. The clock output is also tremendously cleaner, though by no means “clean”. At least now it just shoots up to 5V, stays up there for about 300ns, then heads back down and eventually settles at about 4V (off to the right of this capture it finally settles there).

In this particular case 2.2µF seemed to be sufficient; I tried other values all the way up to 470µF and saw no real change in the curves.

What did make a big different in the curves was the precise location of the capacitor. This is a really good lesson in the saying: “the difference between theory and practice is greater in practice than it is in theory”. You might think that all the points on a given row on a breadboard are “the same” but they are not: there is quite a lot of stray capacitance, inductance, and resistance lurking in the connections beneath the alluring abstraction of the breadboard, and it matters when working on things like this.

I moved the 2.2µF capacitor so that it was plugged into the point directly adjacent to pins 1 and 8 on the 555 (i.e. the Vcc pin and the ground pin). That gave me this result:

 

Notice how much smaller the effect on the voltage rail is now.

Just to eliminate any questions about the interpretation of values given the AC coupling, I took this capture with the blue trace on DC coupling:

Here we can see the power rail dip at the start of the transition is less than 1V.

Next, again following advice from everyone who ever writes about things like this, I added a smaller bypass capacitor again right at pin 8 on the 555. This trace show the result of adding an 0.22µF tantalum capacitor also “immediately next to” the 555 chip:

[ I changed the horizontal time scale in this one; sorry ]

This shows some slight improvement. I fiddled around with various values for the smaller capacitor but couldn’t find one that worked any significantly better than this one. The dip is substantially less than 1V at this point.

There are many write-ups where people talk about the 555 being a “nasty” chip with bad effects on power rails, and this little exercise shows some of that.

If you don’t have an oscilloscope and you don’t put in appropriate bypass capacitors, you may find other parts of your circuit designs misbehaving depending on how big the spikes on the voltage rails are and how sensitive your other circuitry is to those spikes!

 

SnapPower Charger – USB Outlet Installation

I installed two SnapPower usb charger outlets today:

The idea is that you just replace the faceplate of your outlet and get a built-in USB charger “without being an electrician”. It works, as far as that goes, but really it’s almost the same amount of work as installing a genuine USB outlet, e.g., one of these:

I turned off the breaker to my outlets, opened the faceplate, and found out that my outlets had been installed wrapped in electrical tape around the screws. So I had to take the outlet out of the enclosure anyway, to remove the electrical tape:

Once you are to this point, it’s not really a whole lot different to disconnect the entire old outlet and replace it with a “real” built-in USB outlet such as the ones shown above. Nevertheless, I took off the electrical tape (as mentioned in the “obstructions” section of the SnapPower installation brochure), put the outlet back into the wall, popped the SnapPower cover onto it, and everything works:

[ this picture also shows off a charger cord I repaired ]

I’d recommend these outlets if you specifically had a desire for the cable to come out flush to the wall, perhaps if you were installing this behind a piece of furniture. Otherwise I’d have to say you may as well go all the way and buy the “real” USB outlet, which has the benefit of looking at little more professional and gives you two USB connections instead of just this one.

 

Who Let The Blue Smoke Out?

I took apart a piece of gear to see if I could figure out why it stopped working. I found this on the power supply section of its board:

Well, understanding why that chip decided to blow up is above my pay grade, but I think we found at least one problem…

Coin Flip 555 Timer Circuit

Today I built a 50-50 coin toss circuit using a 555 timer circuit, for no particularly good reason other than just to try it.

I’ve seen several variations of these circuits that use the 555 to generate a clock signal which is then conditionally fed into a flip-flop when you push a button to “flip the coin”. The button connects the oscillating clock output of the 555 to the flip-flop clock input. The flip-flop is configured to toggle on each clock transition, so when you let go of the button the flip-flop basically has a 50% chance of being high or low. This is then usually shown to you via two different LEDs – one for heads, one for tails.

It occurred to me that there was already a flip-flop inside the 555, which then led to the idea that if I could build a 50% duty cycle astable 555 circuit and make a way to start/stop the oscillation, that the whole thing could be done with just the 555 and no other chips.

Previously I had built a fairly common configuration of an astable 555 circuit as an exercise. This is the circuit that allows you to easily vary the duty cycle of the oscillation:

The duty cycle in this circuit will be 50% when the charging path, which runs through R1 and the “left half” of potentiometer R2, has the same resistance as the discharging path which runs through the “right half” of R2 (but not R1). The general idea behind picking R1 small and R2 large in this circuit is to minimize that asymmetry so that positioning the potentiometer near the middle results in nearly a 50% duty cycle.

Given that idea here is my circuit to flip a coin:

 

The output side of the 555 circuit is where the coin flip is displayed. If the 555 Output is high, there is insufficient voltage differential between the Output and Vcc to turn on light-emitting diode D3; conversely, the Output voltage will flow through R7/D4 and that LED will illuminate. If the 555 Output is low, the reverse is true. LED D3 will illuminate, and the current from Vcc through R6/D3 will be sunk into the 555; conversely there is insufficient (nearly zero) voltage differential between Output and ground and so D4 will remain dark.

On the left-hand side we see that when the switch is in the “run” position, the circuit is the standard astable oscillator shown before. I’ve drawn it showing fixed resistors for R2/R3 but in fact I built it using the potentiometer from the previous adjustable duty cycle circuit, so that I could experiment with the effects of different duty cycles.

If the switch is moved into the “stop” position, the Trigger and the Threshold input are disconnected from the RC network and instead are connected to a simple voltage divider. With R4 and R5 being equal value, the voltage at this point will be 1/2 Vcc which is too high to trip the Trigger and too low to trip the Threshold; consequently the 555 simply remains in whichever state it was last in at that point.

I used a push-on momentary single-pole double-throw switch, wired so the normal position is “stop” and the momentary is “run”.

In my first idea for this circuit I planned to use a double-pole switch because I thought I’d also have to toggle the Discharge pin between two connections. But that’s not really necessary; if the Discharge pin is low when the timer is stopped (50% chance of this happening) it simply continues to sink current from Vcc through R1; this will be between 5ma and 15ma depending on what voltage you use for Vcc (5V – 15V). It’s a waste of power, 50% of the time, but it works. Also, don’t forget that one of the display LEDs is also always on, so the power wasted in the Discharge is only part of the power use of the circuit and could be made somewhat insignificant. But if you cared about this wasted power you could use a double-pole double-pole switch and so that in addition to moving the Trigger/Threshold between a “run” and “stop” position you could move the Discharge in tandem (between the connection as shown above and “no connection” in the “stop” position). Alternatively you could increase R1 as the asymmetry effect R1 has on charge time versus discharge time is not really important in this application; you could choose R2 and R3 to compensate for a larger R1 such that R3 = R2 + R1 is maintained for a 50% duty cycle.

The frequency of the oscillation isn’t especially important other than you want it to be fast enough so that you can’t time your press of the button to influence the result, and slow enough that the flickering can be seen because that’s a cool effect. With the values shown above the frequency will be in the neighborhood of 25-30Hz.

So, the circuit definitely works. Here’s a movie showing that:

555 flip circuit

I had originally powered the circuit from a 5V bench supply. You can see in this movie I was trying it from a 9V battery; I probably should have increased the resistors R6/R7 for that as there is no real need to pump 90mA through the LEDs. You may wish to experiment with that if you follow this idea.

There is a pretty significant drawback to this circuit: the 50-50 fairness of the coin-flip depends on having an exact 50% duty cycle. Using my oscilloscope, and taking advantage of the fact that I had used a potentiometer for R2/R3, I was able to tune the circuit to precisely that point:

However (and “of course”) … the cheap resistors used in this circuit can drift as they warm up or cool down, and there are plenty of other variance effects that all can lead to the duty cycle drifting even after it has been adjusted to 50%.  I saw that myself just while playing with the circuit; after I had adjusted to 50% a few minutes later it was off at 49.6% as an example.

Before I built this circuit I did a lot of google searching for other examples of this idea and came up empty. I can see now why people don’t build a coin-flip circuit this way, because it’s impractical to guarantee an exact 50% duty cycle and so there is no guarantee of 50/50 heads/tails fairness.

Using an external flip-flop eliminates this problem, because the external flip-flop (assuming you have set it up this way) can toggle between high and low states only on the rising edge of the 555 output clock cycle. This makes the duty cycle irrelevant, as the amount of time the 555 output is high or low has nothing to do with how long the second flip-flop will be high or low. The second flip-flop will alternate between being high and low each for an ENTIRE clock cycle of the 555 output; only the rising edge from low to high will toggle the external flip-flop. In this way any asymmetry in the duty cycle becomes irrelevant and the coin toss is inherently fair.

Thus, this circuit I built is interesting as an exercise, but probably shouldn’t be recommended for use in any real coin-flip application. Though obviously that hasn’t stopped me from posting it — if for no other reason than other people might find it and understand why no one else builds a coin-toss 555 circuit this way! 🙂

 

I can't complain but sometimes I still do