p.6: Device Monitors Home Air-Quality and CO2: The IntlAir Project, By Andrei Florian
 https://visualstudio.microsoft.com/  https://docs.microsoft.com/en-us/azure-sphere/install/install-sdk
p.16: Breathalyzer Links to Car’s Ignition System: Using an NXP LPC802 MCU, By Julia Paglia
Source Code: https://github.com/jpaglia/ignition-interlock
Datasheets and User Manuals:
The following are links to the PDF files for the LPC802 user manual as well as the datasheets for the LPC802, the MQ-3 gas sensor, and the HD44780 LCD screen.
These are resources used for the deriving the conversion formula from the MQ-3 analog output signal into a meaningful BAC percentage.
Additional Background References:
Below are references to background details about Ontario’s Ignition Interlock Program.
p.22: True Random Number Generation: Using Comparators, By Wolfgang Matthes
Note: An extensive Addendum is provided to the article. To view the Addendum, scroll down to the end of this page.
Reference designs and application notes:
Analog designers usually strife to avoid oscillations. The most common method is to provide for hysteresis, that is, to modify the reference voltage if the comparator’s output level has changed.
This is to avoid that the differential voltage at the inputs remains in the linear region for some time. As soon as the output switches, the reference voltage is changed so that a larger input voltage swing in the opposite direction is required to switch back again. If the output signal switches on, the reference voltage is reduced, if it switches off, it is increased again. So small variations of the input voltage cannot cause the output switching back, thus avoiding oscillations.
These papers and articles discuss the causes of the oscillations and how to prevent them. When reading with the converse intention, perhaps we could get some ideas on how to incite them
1. Kay, Art; Claycomb, Timothy: Comparator with Hysteresis Reference Design. TIDU020A. Texas Instruments Incorporated, 2013–2014.
2. Guide to Adding Extra Hysteresis to Comparators. Application Note 3616. Maxim Integrated Products, 2005.
3. Application Note 74. LM139/LM239/LM339 A Quad of Independently Functioning Comparators. Application Report SNOA654A. Texas Instruments, Incorporated, 2004–2013.
4. Grohe, Paul: Application Design Guidelines for LM339, LM393, TL331Family Comparators Including the New B-versions. Application Report SNOAA35A. Texas Instruments, Incorporated, 2019–2020.
Some data sheets:
5. LM339, LM239, LM139, LM2901 Quad Differential Comparators. Data Sheet SLCS006U. Texas Instruments, Incorporated, 1979–2018.
6. TLV4011 Precision Comparator with Integrated Reference. Data Sheet SLVSFL9. Texas Instruments, Incorporated, 2020.
7. LMV727x Single and Dual, 1.8-V Low Power Comparators With Rail-to-Rail Input. Data Sheet SNOSA56I. Texas Instruments, Incorporated, 2003–2015.
8. MAX40002–MAX40005/ MAX40012–MAX40015 nanoPower 4-Bump Comparator in Ultra-Tiny 0.73mm x 0.73mm WLP/SOT23 Packages. Data Sheet 19-8574. Maxim Integrated Products, Inc., 2020.
9. LTC1841/LTC1842/LTC1843 Ultralow Power Dual Comparators with Reference. Data Sheet 1284123f. Linear Technology Corporation, 1998 / Analog Devices, Inc., 2020.
We need comparators without built-in hysteresis. This obvious requirement could comparators in microcontrollers or FPGAs render not suitable. To be reasonable fast, the random number generator requires some or even many comparators. So especially tiny comparators are of particular interest.
10. Matthes, Wolfgang: Microcontroller Modules for the Ambitious. Circuit Cellar, Issue 312, July 2016
p.31: Understanding the Ultra96 Board (Part 1): The Hardware, By Nishant Mittal
 Product page: https://www.96boards.org/product/ultra96
 Schematic: https://www.96boards.org/documentation/consumer/ultra96/ultra96-v2/hardware-docs/files/ultra96-v2-schematics.PDF
96Boards.org | www.96boards.org
Avent | www. www.avnet.com
Infineon Technologies | www.infineon.com
Micron Technology | www.micron.com
ON Semiconductor | www.onsemi.com
PYNQ | www.pynq.io
Renesas Electronics | www.renesas.com
Xilinx | www.xilinx.com
p.36: Build a Line Follower Robot: With Arduino and PID Control, By Alexandru Dumitrache
Adafruit | www.adafruit.com
EasyEDA | www.easyeda.com
FTDI Chip | www.ftdichip.com
Microchip Technology | www.microchip.com
Pololu | www.pololu.com
SketchUp | www.sketchup.com
Solarbotics | www.solarbotics.com
SparkFun | www.sparkfun.com
p.42: IC and Software Solutions Enable Machine Learning: FPGAs, MCUs and Software, By Jeff Child
Achronix | www.achronix.com
AMD | www.amd.com
Eta Compute | www.etacompute.com
Flex Logix Technologies | www.flex-logix.com
Microchip Technology | www.microchip.com
Qualcomm Technologies | www.qualcomm.com
Quicklogic | www.quicklogic.com
SensiML | www.sensiml.com
STMicroelectronics | www.st.com
Renesas Electronics | www.renesas.com
Xilinx | www.xilinx.com
p.50: App-Specific Trend Drives Test and Measurement Gear: Market Mindset, By Jeff Child
Keysight Technologies | www.keysight.com
Measurement Computing | www.mccdaq.com
Pico Technology | www.picotech.com
Rohde & Schwarz | www.rohde-schwarz.com
Siglent | www.siglentna.com
Tektronix | www.tek.com
Teledyne LeCroy | www.teledynelecroy.com
p.55: DATASHEET: DC-DC Converters: Technology Charging Ahead, By Jeff Child
MINMAX Technology www.minmax.com.tw/en/download/files/2500/MCW04_Datasheet.pdf
Murata Power Solutions www.murata.com/products/productdata/8807040516126/uwe-q12.pdf
TDK-Lambda Americas https://product.tdk.com/info/en/catalog/datasheets/pxd-m_e.pdf
p.58: EMBEDDED IN THIN SLICES: FreeRTOS (Part 1): Intro to Real Time Operating Systems, By Bob Japenga
 https://www.innovationhartford.com/hal-taylors-innovative-work-with-utc-and-nasa/ This article provides some background about the LM AGS.
 https://www.hq.nasa.gov/alsj/a11/a11.1201-pa.html For more details about the 1201 and 1202 alarms
 Wikipedia provides some useful definitions and examples of “bare metal” systems https://en.wikipedia.org/wiki/Bare_machine
 https://en.wikipedia.org/wiki/Operating_system August 24th, 2020
 https://en.wikipedia.org/wiki/Ventricular_assist_device for a good definition
 “FreeRTOS is a real-time kernel (or real-time scheduler) on top of which embedded applications can be built to meet their hard real-time requirements.” from https://www.freertos.org/wp-content/uploads/2018/07/161204_Mastering_the_FreeRTOS_Real_Time_Kernel-A_Hands-On_Tutorial_Guide.pdf
 Wikipedia gives a good general summary of each of the scheduling algorithms https://en.wikipedia.org/wiki/Real-time_operating_system#Algorithms
 See Circuit Cellar articles – Issue 271 February 2013 Concurrency in Embedded Systems and Issue 273 April 2013 Introducing Linux Concurrency
FreeRTOS | www.freertos.org
p.62: FROM THE BENCH: Automated TV Antenna Positioning System: Zeroing in on HDTV, By Jeff Bachiochi
 Image source: Antennas on rooftops: https://www.everthenomad.com
 Free TV content in your area: http://www.fcc.gov/media/engineering/dtvmaps
 BNO055 datasheet: http://www.adafruit.com/datasheets/BST_BNO055_DS000_12.pdf
 Winegard RFL-332 SensarPro TV signal strength meter
 The Tablo: https://www.tablotv.com
Adafruit | www.adafruit.com
Espressif Systems | www.espressif.com
Honeywell | www.honeywell.com
Winegard | www.winegard.com
p.68: THE DARKER SIDE: Voltage-Level Translation Techniques: Managing Mixed-Voltages, By Robert Lacoste
References: Logic Guide
 SN74AC00 quadruple 2-input positive-NAND gate
 MT-098 Tutorial: Low Voltage Logic Interfacing
Analog Devices Inc
 Voltage level translators search engine
 SN74LV1T34 Single Power Supply BUFFER Logic Level Shifter
 74LVC245A Octal bus transceiver; 3-state
 MAX3370 – 1µA, 2Mbps, Low-Voltage Level Translators in SC70 and µDFN
 ADG3301 – Low Voltage 1.15 V to 5.5 V, Single-Channel Bidirectional Logic Level Translator
7400-series integrated circuits
4000-series integrated circuits
Voltage Translation Buying Guide
p.79: The Future of Chiplets: Specialized Chiplets Revive Moore’s Law, By Syed Alam
Accenture | www.accenture.com
ADDENDUM TO: True Random Number Generation: Using Comparators, By Wolfgang Matthes
Comparators behave nastily when the difference voltage between the two inputs remains some time within the magnitude of the offset voltage (in other words, within the linear region). Without countermeasures (e.g., hysteresis), a typical comparator will oscillate. The idea was, to employ these oscillations to generate random numbers. An experimental setup was built to verify the principle. However, it was not that easy to generate true random bit patterns that could pass appropriate certification tests. In the end, principles have been found that may lead to acceptable true random numbers (TRNs). I have filed two patent applications (in Germany), covering the principles of operation. To develop fully-fledged devices, to get them certified, manufactured, and marketed, however, requires a considerable amount of work and money. It has shown impossible to raise adequate funding. So I have decided to make the principles freely available in the realm of open sources.
German patent applications:
1. Verfahren und Vorrichtung zum Erzeugen von Zufallszahlen
DE file number: 10 2015 010 518.3
Application date: August 13, 2015
2. Verfahren und Vorrichtung zum Erzeugen von Zufallszahlen durch Auswertung des Schwingungsverhaltens von Komparatoren
DE file number: 10 2016 005 082.9
Application date: April 27, 2016
Both patents have lapsed.
The technical solutions communicated here can be used freely (open-source hardware / open-source software). The terms of the CERN Open Hardware License Version 2 – Permissive apply. Functionality, suitability for any purpose, and freedom from other property rights cannot be guaranteed. The license terms – together with more detailed explanations – can be found at the following Internet addresses:
What has been built and programmed is essentially an experimental setup as a proof of feasibility. It consists of a microcontroller with attached comparator-based circuitry, a program running in the microcontroller, generating random bit patterns, programs running on a personal computer to set up and control the microcontroller program and to capture and evaluate the random bit patterns.
Figure A1. A look at the workplace. The arrow points to an adapter injecting collaring pulses from the signal generator behind. To the left a venerable Tektronix 5441 storage oscilloscope.
Figure A2. A look at the experimental setup. The human interface module has been described in “Microcontroller Modules for the Ambitious” Circuit Cellar, Issue 312, July 2016, the microcontroller module is a more advanced version, carrying an Xmega microcontroller.
Figure A3. The prototyping board carries four comparators, the counters, and the auxiliary circuitry. U1 is a Xilinx 9536 CPLD, U2 an LM339 quad comparator. The crystal oscillator U3 is a clock source used to capture the width of the oscillation pulses (by counting) and to generate collaring pulses.
Figure A4. An example of a display on the human interface module. All numbers are in hex (remember, it’s about tinkering, and the microcontroller is programmed in assembler …).
Oscilloscopes used: Tektronix 5441, Agilent 6014A, and Agilent/Keysight 3024A.
Figure A5. Here the comparator behaves like described in the textbooks. The sinusoidal input voltage is converted into a pulse. The slow rise of the leading edge is the consequence of the open-collector output.
Figure A6. A slowly changing input voltage (here: the yellow traces) causes oscillations.
Figure A7. This is a snapshot of our random number generation. The input voltage is increased in small steps.
Figure A8. Experimenting with feedback via a capacitor. In the left picture, it is connected to the positive input, in the right picture to the negative. For comparison, see Figures 13 and 14 in the printed article.
Figure A9. Normal operation without additional feedback. For comparison see Figure 15.
Figure A10. Here the additional capacitor is connected to the positive input. For comparison, see Figure 16.
Figure A11. Here the additional capacitor is connected to the negative input. The green trace shows the input voltage. For comparison, see Figure 17.
Some details of the principles of operation
Figure A12. A comparator-counter circuit, comprising an 8-bit counter and an auxiliary 2-bit counter. The 8-bit counter ceases counting when 255 oscillations have been counted. This limit resulted from observing the comparator’s behavior on the oscilloscope. Only a few oscillations would evidently deliver insufficient entropy, counting 200 or more oscillations would not improve entropy but consume too much time. The auxiliary counter contributes the two least significant bits independent of the number of oscillations.
Figure A13. The experimental setup consists of four comparator-counter circuits. The counter contents are read out via an 8-bit data bus.
Figure A14. Each comparator has, depending on its reference voltage, a region of the input voltage in which oscillations will occur if traversed not too fast. This portion of the linear region, called the VIN window, is defined by a lower and an upper VIN limit. It is reached and traversed in steps. In the 1st loop, the microcontroller emits coarse steps until the counter outputs begin to change (1). Then, the region is traversed in fine steps until the counter ceases to count (2). The VIN values at the points (1) and (2) are stored as the lower and the upper VIN limit, thus defining the VIN window.
Figure A15. The basic parameters are to be found experimentally, above all the slew rate or, in other words, the dwell time in the VIN window. To secure sufficient entropy, a somewhat larger number of oscillations should be counted. On the other hand, it should not take too long to obtain a random bit. It was an intuitive decision to provide an 8-bit counter. The CNT_MIN and CNT_MAX values are parameters to be entered. As a starting point, we may begin, for example, to stipulate more than 32 oscillations, but no more than 128.
Figure A16. This hierarchy diagram depicts the components of the software running in the platform’s microcontroller.
Figure A17. The main window of a control program. Communication between the personal computer and the microcontroller is via a serial (RS-232) link. Commands are entered as hex numbers or by clicking the corresponding button. The communications protocol appears in the window to the left. To the microcontroller, 12 parameters are sent, whose meaning depends on the experiment to be executed. Analog voltages are set via the sliders.
Figure A18. Here an experiment has been run. The generated random bit pattern is shown. 333 774 bits have been produced, among them 167 309 zeros and 166 459 ones. Six passes of the bit generation loop were not successful. The difference between zeros and ones yields a bias of 850 or 0,255%.
Figure A19. This program evaluates bit patterns and converts them to files. It has been written with deliberate neglect of comfort (e.g., no file handling dialogues). The logout relates to the test pattern shown in the File Content window.
Figure A20. To generate a random bit, the linear region is to be traversed. In a first loop, the software begins to emit somewhat coarse input voltage steps. In each step, the content of the counter is read. When its value has been changed, the linear region has been reached where the oscillations begin. Then the second loop will traverse the linear region in fine steps. The count values are collared. The second loop ends when the counter content changes no more.
Figure A21. This example shows how the outcome depends on the distance of the collaring pulses.
Figure A22. This flowchart illustrates the algorithm to evaluate the collared values. This is preceded by the algorithm depicted in Figure 9 in the printed article, supplemented by a subroutine or interrupt handler that stores (collars) counter values occasionally.
Figure A23. This block diagram illustrates the same algorithm. It is, however, implemented in hardware. The collared values, however, are not brought into a RAM but evaluated on the fly. This way some or even many comparators could be operated in parallel.
They may be found on the author’s homepages (see below). It is not expedient to repeat the first experiments, conducted in 2015 and 2016. The descriptions and sources, however, may find their good use as a starting point for experiments and further development. For example, one could begin with one of the ubiquitous small microcontroller modules and, at first, find out whether some of the built-in peripherals, especially counters and comparators, may be of use or not. Random number generation and evaluation could be written in a convenient high-level language and executed on the microcontroller without needing a PC. I recommend, however, to write the innermost bit generation loop in assembler. Thus the program cycles generating the random bits will not depend on the intricacies of a compiler. (Please consider that an eventual certification may become invalid if the innermost algorithm is modified, even by minute deviations that may be caused by re-compiling.) CPLD or FPGA design, if necessary, could be done not by drawing schematics but by describing the desired behavior, e.g., through a language like Verilog or VHDL.
The author’s project homepages:
Datasheets, application notes, reference designs, tutorials and so on:
(Author’s note: I prefer to look first into the technical documentation manufacturers of real hardware provide, not into academic textbooks.)
Circuit Cellar's editorial team comprises professional engineers, technical editors, and digital media specialists. You can reach the Editorial Department at email@example.com, @circuitcellar, and facebook.com/circuitcellar