Close
0%
0%

Schrödinger's Trigger

Using the joy of electron-tunneling, this device drives one of two outputs when triggered.

Similar projects worth following
Using the cheapest finest parts from my scrap heap, I set out to build the most science-fiction sounding device that actually worked (and where the electronics could be built in 8 hours or less).

The result is a device that drives one of two outputs when it sees a rising edge on the input. Which input it will drive is determined by sampling the time difference between three electron-tunneling events. As such, the output is unknowable until observed, even with perfect knowledge of the system.

I couldn't decide whether to name this Schrödinger's Trigger or a quantum buffer, so I used two LEDs and the device itself to resolve the issue. I observed the output, and Schrödinger's Trigger was born. So if you don't like the name, don't blame me :D

This project status is complete. I might add a logo to the case later.

Years ago, I had proposed a related device: https://hackaday.com/2019/04/01/schrodinger-quantum-percolator-makes-half-decent-coffee/

Sadly, it was on April Fool's day, so I suspect there was some doubt that this was a device that I was really working on. It's also April Fool's Day just about now, but I assure you this is an actual device -- April Fool's is just the deadline I set to complete my New Year's resolutions. Life got in the way of completing it for a couple of years, and finally I had to settle for building just the quantum core of the device (for now).

The device itself is composed of 4 stages:

1. The power stage: It needs both a variable 10-15VDC input and a 5V input. I just do the lazy thing there and use a USB powered boost converter, and put a linear regulator on the board. A 100uF electrolytic capacitor provides a little noise reduction on the 10-15V supply.

2. Electron-Tunneling event generator. Here, we are reverse-biasing a semiconductor junction. You can think of the junction as a diode, and we carefully put a voltage across it the wrong way, blocking current from flowing. Classically, we would expect no electrons to flow across the barrier. However, some electrons can be detected "jumping" across the diode, even though the have insufficient energy to do so! This is called 'tunneling', and it has the interesting property of being a purely random effect -- even with perfect knowledge of the system, there's no way to determine which electron will undergo tunneling or when.

3. Amplification Stages. As you might imagine, a few electrons jumping across a barrier doesn't generate a huge signal. To do any processing on it, we'll need to amplify it and clean it up. I could use op-amps, but hex-inverters work well and are better value for money here. Why do for a dollar what we can do for a dime?

4. Sampling and I/O. Something needs to observe the signal, and produce something about it that the outside world can understand when requested. I'm certainly not going to do it manually each time, so I wrote some firmware to do it. It's in Assembly because I considered timing to be important. I heavily commented the code, and the algorithm is simple, so you should be able to understand and port it to a platform of your choice.

I'll go over each of these sections in more detail in separate posts. The circuit diagram is as follows:


Finally, I'll wrap up this description with a Truth Table for the device as this is a good summary of what it does. Note that output latches as long as the trigger is held HIGH.

TRIGGER INPUTOUTPUT 1OUTPUT 2
LOW
LOWLOW
HIGH

new_circuit.jpg

Circuit diagram in full resolution

JPEG Image - 206.43 kB - 04/11/2022 at 08:58

Preview
Download

quantum_buffer.asm

Assembly language algorithm for sampling quantum events.

asm - 3.22 kB - 04/03/2022 at 04:49

Download

  • 2 × 2N5551 (or other) transistor
  • 2 × CD4069UBE (or other) Hex Inverter
  • 1 × ATTiny12 (or other) microcontroller pretty much anything 4Mhz or better will do as long as it sample I/O fast
  • 5 × 10K resistor
  • 2 × 1K resistor

View all 8 components

  • Case Design

    Legionlabs04/11/2022 at 09:58 0 comments

    I had bought a number of ABS enclosures for ground control stations and generally to carry client prototypes around. I had a spare one that didn't fit the stuff I wanted it to:

    They are very good cases and it was a shame not to use it. I installed some banana connectors on the far side (not shown) to connect a variety of external power supplies.


    Inside, it is filled with foam scored in a grid pattern. You break off pieces to fit the part you want to store. In our case, we want to store a small piece of perfboard with our circuitry:

    The connector at the top is for power, to the bottom is trigger input, and to the right is output. In our case, we will connect the trigger input and the output to a control panel. I have tons of scrap brass panels around, leftovers from building various prototypes. One happen to fit!

    I dug through my parts bin for switches and flanged LEDs (I always have flanged LEDs). We're spoiled for choice when it comes to industrial switches in Vietnam, so I found some pretty good stuff. I drilled holes, mounted the parts, and it all fit in pretty well... except the panel would slide around when you tried to flip the power switch. I mean, of course -- It isn't attached to anything!

    I had kept some mounting points for glass tabletops for the better part of a decade for some reason. They looked quite good, so I drilled holes in the corners and in they went.

    These have a shaft that inserts itself into the foam, securing the panel in place reasonably well. The whole thing now looked quite decent, had a good weight, and good tactile feedback on all inputs!

     I finished up by adding some labels. I'm out of ferric chloride and solvent, so I printed up some stickers. The solution to the problem is always in the room!


    For now, the output is simply connected to the control panel LEDs, however it's designed to be connected to another device one day. For now, this is fine though -- the button lights up nicely when active, and the flanged LEDs look good are lit clearly:

  • The Post In Which I Reveal the True Nature of this Project

    Legionlabs04/03/2022 at 06:18 0 comments

    Some people might be inclined to ask about the performance of this device as an entropy source. This section is for you. Hello friends!


    I rebuilt this device using a fancier ATMEGA16 clocked with a 20Mhz crystal, and used 3904 transistors to generate the quantum tunneling events at ~15V. I also used the 16-bit on-chip timer. This is to generate more tunneling events. The algorithm is the same except it accumulates entropy to an 8-bit register before serial output. That output goes to a MAX232, and then to my PC.

    I accumulated somewhere over 100 megabits of entropy and split it into 100 equal parts for analysis using the NIST Randomness Test Suite (https://nvlpubs.nist.gov/nistpubs/legacy/sp/nistspecialpublication800-22r1a.pdf).

    I don't recall the exact test results (it was late at night, OK?), but they didn't reveal any obvious problems. I realize that *much* more evidence is required before you could call this system cryptographically secure, but for it's intended purpose, it should work fine.

    ...also I'll admit here that I might have lied a little about this device not being a joke. I mean, it's a real device that exists! You see, tying complex macroscale events (the name of this device) to quantum events, and them publishing it on a popular website is just my way of playing a little practical joke on anyone trying to simulate this Universe. It might not be that funny, but it is my first attempt at an interdimensional practical joke, so cut me some slack, don't be a tough crowd!

    Anyway, there's your science fiction for the day. Or maybe just science. It was science fiction last week, anyway.


    Oh, and if you're the programmer in our parent reality and read this, please don't respond here. Just encode something cool for us to find between the 23,074,248th and 23,075,235th hexadecimal digits of π. Maybe a picture of Waldo or something? Don't make it perfect though, add some noise to keep us guessing.

  • Processing Stages

    Legionlabs04/03/2022 at 05:41 0 comments

    This is where we convert a raw signal to a device that does something (questionably) useful!


    I considered several ways to do this. At first, it had only a single output that would be either HIGH or LOW based on the observed state of the system on trigger input rising edge.

    Eventually, I realized a second output that is set to the opposite of the first output on trigger rising edge would be useful -- that way the device can be connected to two circuits down the line without extra components. I settled on this, and use a 4-pin connector to provide 5V, Ground, and the two outputs to whatever this gets connected to (coffee percolator or otherwise). I made the output latch for as long as the trigger is raised HIGH.

    I also considered making it latch until a reset line is triggered, but did not implement this. My reasoning is that this device is most likely going to be connected to a toggle or knife switch, which of course provides mechanical latching! If I wanted it to work with intermittent switches (SET/RESET), I'd go back and add this feature. In case someone wants to do this in a hurry, the fastest way is probably to make the program NOP loop forever instead of going back to the start of the algorithm, then driving the RESET line of the MCU LOW via an intermittent pushbutton.

    Anyway, back to the core algorithm. The full commented code is attached to this project. Overall, it's an implementation of a Von Neumann debiasing algorithm. You can read more about that here:

    https://dornsifecms.usc.edu/assets/sites/520/docs/VonNeumann-ams12p36-38.pdf

    If that link dies from bit rot, there's a formal reference at the end of this post.

    In short, we start a timer when we see a tunneling event ending, and measure the time until the next event. Then we do it again, and measure the two times. The timer runs on something like 4Mhz +/- 1%, we just use the microcontroller internal oscillator because that's good enough here. If the first measured time is longer, we set the state ϕ = 1. If the second time is longer, we set the state ϕ = 0. If they are equal, we produce no output and try again until they are not equal.

    Finally, we produce output. While the trigger input remains high, OUTPUT 1 is equal to the state ϕ, and OUTPUT 2 is always
    ¬(OUTPUT 1) -- in other words the opposite of OUTPUT 1. We wait idle while the trigger input remains HIGH.

    That's about it! Here's that reference I promised earlier:

    J. Von Neumann, “Various techniques used in connection with random digits,” Applied Math Series, Notes by G. E. Forsythe, in National Bureau of Standards, Vol. 12, pp. 36-38, 1951.


  • Amplification and Buffer Stage

    Legionlabs04/03/2022 at 05:27 0 comments

    The signal past the 0.1uF DC blocking capacitor is not very strong, so we need to amplify it. Normally, I would design something with op-amps -- but that would likely mean some form of dual-rail power supply, and parts that cost more than 30 cents -- but this is a *science fiction* contest, and a future where we can afford such luxuries sounds more like high fantasy to me.

    So instead, we'll use hex inverters. I like the CD4096, and keep plenty around. They have 6 inverters per chip, which translates to 6 inverting amplifiers, excellent value for money! To make that happen, we just put a 100k resistor between the input and output of an inverter stage, creating a feedback loop. In this design, I use two stages this way.

    For details on how this works, you can read more here: https://wiki.analog.com/university/courses/electronics/electronics-lab-20

    Overall, this is not only economical, but the resulting amplifier has reasonable bandwidth!

    After two stages of amplification, the resulting signal has a maximum amplitude of around 5v and a slight DC bias. We remove that bias with another 0.1uF capacitor, and pass it though a 1k resistor before entering the buffer stage.

    The buffer stage consists of another hex inverter that shares ground with the rest of the circuit so far, but has a regulated 5V supply. This is to ensure that the signal never has a voltage that the microcontroller cannot deal with. We pass it through 2 stages of the hex inverter (no feedback resistors). This both provides a safety margin for our microcontroller (I only had the one unit left), and shortens the rise and fall times for our signal, making it a fairly clean square wave.

    With that, we've converted quantum tunneling events to a signal that can be easily processed by a microcontroller! Below is an image of how that looks, any apparent pattern is an artifact of the small sample size:

  • Quantum Tunneling Event Generator

    Legionlabs04/02/2022 at 04:48 0 comments

    This is the interesting part of the device! Before we launch into the specific implementation, I realize a little background might be useful.

    Some of you may have heard of the Heisenberg uncertainty principle. A good summary is here: https://www.physicsoftheuniverse.com/topics_quantum_uncertainty.html

    To summarize that summary, imagine trying to view an electron in a microscope. It doesn't matter what the magnification of your microscope is, you won't be able to see an electron using visible light. The ability of light to resolve objects depends on its wavelength -- if what you are trying to see is smaller than the wavelength of the light you are trying to bounce off it, you're not going to have much luck and it will not be visible.

    We can imagine using higher frequency light though, right? To resolve an electron, we'd need very high frequency light called gamma rays. This replaces our previous problem with a new one: gamma rays have are powerful enough to significantly increase the energy of the electron we're trying to observe, increasing its momentum. The very act of measuring the electron's position requires that we change its momentum -- we cannot know both at the same time.


    It turns out this is true in general (we cannot simultaneously know the position and momentum of anything), however the effect size is only noticeable for very small things.

    Where this becomes relevant to us, is that the momentum of an electron is typically measured in 'electron volts' or eV. One eV is the energy imparted on an electron by a potential difference of one volt. In our Event Generator, we are using a 10V power supply, so we know the momentum of the electrons should be close to 10eV.

    Since I know that with some level of accuracy, that means I can't know exactly where the electrons in my circuit are. The semiconductor junction in my circuit might be rated for, say... 100V, but it also has a defined width! If it's narrow enough, sometimes the 10V electrons I would expect to be on one side of the junction are actually on the other side! 

    How did they get there? One proposed mechanism is that they 'borrow' energy from the environment via virtual particles, and 'pay it back' once they are on the other side. An even weirder debate is how long it takes to happen -- with several estimates being significantly faster than the speed of light (while I'm skeptical, this isn't prohibited unless it can transmit information, see apparent speed for more information).

    In any case, it happens and we can measure it. The signal is rather unique looking! It's characterized by a sudden change in voltage when the tunneling event occurs, followed by a decay. If you set your scope settings just right, the noise pattern looks really neat!

    The signal does have a pretty big DC offset compared to its amplitude though. So besides providing a suitable junction for electrons to tunnel across, we also filter out this DC offset using a 0.1 uF capacitor.

    Note that I've presented the explanation for tunneling that seems most intuitive to me. There are other ways of thinking about it (e.g. with waveforms). It's a nice Wikipedia rabbit hole if you don't mind your afternoon vanishing.

  • Power Stages

    Legionlabs04/02/2022 at 04:00 0 comments

    This is the simplest, least-exciting stage, so I'll just add a couple of supplementary details.

    The device needs a variable 10-15VDC supply. This is so you can adjust the frequency and amplitude of tunneling events -- too low a voltage and you'll get only a few, weak events. Too high, and the timer on your microcontroller won't run fast enough to easily measure the time between events.


    Overall, the exact semiconductor you use has a bigger effect on tunneling frequency, but it's still nice to be able to tune it a little. Also the first hex inverter responsible for amplification can run a little hot at higher voltages. It's a pretty rugged part though.


    I found around 10VDC worked fine for me -- that put the average time distance between events as a few microseconds (say 4), and I'm running the microcontroller at 4Mhz. However in another similar device, I used a 20Mhz microcontroller and pushed the voltage up to about 15V to improve performance somewhat.

    The 5V linear regulator is just there to power the microcontroller and signal buffer. We buffer the signal with a second hex inverter to give it better defined rising and falling edges, and also so that the signal cannot ever exceed 5V. I chose a linear regulator instead of a switched one because this is not a battery powered device, so the extra power cost is not really relevant, it is cheaper, and it produces less noise.

View all 6 project logs

Enjoy this project?

Share

Discussions

3rdnostril wrote 04/16/2022 at 10:03 point

Thank you so much, for the detailed reply - I truly appreciate it. Ok, so I had a few things right, that’s encouraging. My plan was to build one of those electronic decision maker, as simply as possible, while integrating your idea of electron-tunneling. And here’s how much of an old fart that I am - I have NO clue what an ASM is, and I don’t have/or want an Arduino. So please, don’t go compiling a HEX file [whatever that means] for me. Guess I will have to look up some schematics online, for a simple 2 LED decision making circuit and then find a way, to connect it to the first half of the circuit, that you came up with… Thanks again, you are very kind to help me on my electronic journey. Cheers mate!

  Are you sure? yes | no

3rdnostril wrote 04/15/2022 at 02:07 point

Hello, I’m a curious NOOB so please pardon my ignorance. So, both cd4069s’ are connected to a 10V source which is then run through a lm7805, to bring the voltage down to 5Vs, did I get that right? And the 2n5551 transistor to the left, is it connected to power or not connected [I see NC, beneath it]? Also, I would like to build this circuit, without the processing part, so where would you put the red and green LED on the schematic? As it seems to me like, there is only one output [signal out] from the second cd4069? Please clarify for me. I truly am, trying to learn more about electronics. Thank you kindly

  Are you sure? yes | no

Legionlabs wrote 04/16/2022 at 05:14 point

No worries, here's some more detail for you.

1. I think you understand correctly, but I'll rephrase it back to you to confirm. The 10V input is directly connected to an LM7805. One CD4069 is powered directly by 10V. The other CD4069 is powered by the output of the LM7805.

The reason for this is twofold. First, it means the CD4069 closest to the MCU can never output more than 5v. The circuit is intended to work from 10-15V input, with 10V being the optimal point on that range (determined experimentally, if you rebuild this it could be a little different but probably not much).

The second reason is to clean up the signal a bit more to make it more like a square wave.

The are other ways to do this, including using a zener diode (saving the LM7805 and the second hex inverter), but this was the optimal solution with the scrap I had just lying around! Anyway, the price difference would be like 15 cents so you can just copy my circuit :D

2. Yes, NC is not connected. In this case, the collector (pin 3) of that 2N5551 is left unconnected.

3. If you build this without the processing stage, you will get a square wave (of constantly changing frequency). I've uploaded a new image here to help you visualize it:

https://hackaday.io/project/184643-schrdingers-trigger/log/204547-amplification-and-buffer-stage

 The signal must be processed in some way to 'decide' which LED to light up.

If you don't care too much about the underlying maths, it would be OK to do this with an Arduino and C. An Arduino runs faster the chip I used, so would probably perform reasonably well without needing assembly language (I'm just a million years old and still write in ASM). If you're experiencing difficulties, I may be able to compile a HEX file for you that you can just upload to an Arduino, that uses the optimized assembly code.

4. Hex inverters have 6 inputs and 6 outputs (they are 6 inverter circuits). In the second CD4069, we connect one of the outputs to one of the inputs. In other words, we use two inverters on the chip to invert the signal twice.

So conceptually, I think it's OK to think of the second chip as a system that has one input and one output. It's important to remember that you're inverting a signal two times with that system though!

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates