Getting Started With The STM32

So this post is part tutorial, and part reminder to myself in the future when I come back to trying to do the same thing again. It describes the process of programming a SM32 L1 discovery board, specifically (for me) an STM32 L100C discovery board, but it should work with most STM32 devices with some changes. This was a free board that a friend got in a goody bag from an ARM conference. Essentially its how to create a project, how to run it in debug mode, and make a couple of LEDs flash. The basic process it the same for most STM32 boards/chips, using the STLink/V2 which most discovery boards have.

The STM32L100C-discovery board used in this tutorial

To start make sure you have the following downloaded and installed:

STM32CubeMX

Go ahead and open STM32CubeMX, and wait for it to load. Once you get to the home screen, go to File->New Project, and a new window will pop up. Now is the time to find the MCU that you are using. In the MCU/MPU Selector tab, use the series/search options to find the MCU that you are using. As I am using the STM32L100C-discovery board, I have to find and select the STM32L100RCT. When you have selected the right part, click on the start project button in the top right.

Page searching for the STM32 MCU you are using

When the project then loads up it should look like this in the pinout view.

The pinout screen when using STM32CubeMX

At this point it is a good idea to save it under File->Save Project. Save it somewhere you will remember. I have a folder specifically for STM32 projects like this.

At this point it is a good idea to get the schematic up of the board you have. If you have chosen the part view the board choice menu instead of the MCU menu, then it should fill in all the pins for you, but this tutorial should show how to assign the pins manually. For this board it has two LEDs and a button that I need to assign to pins. Remember your board may be slightly different. Schematics are often available somewhere for these discovery boards by ST, they are just difficult to find sometimes.

  • USER button: PA0
  • Green LED (LED 3): PA9
  • Blue LED (LED 4): PA8

Firstly, on the left, under System Core, select the SYS configuration, and a widow should pop out. Make sure that the drop down next to debug is set to Serial Wire. Then you can close this window using the little arrows. some of the pins in the chip diagram should have changed to green now which means they have been set.

Next we want to assign what each pin needs to do. This is done by left clicking on the pin in question and choosing its mode. So for me I need to click on PA0 and set it as GPIO_Input (as its a button) and setting PA8 and PA9 as GPIO_Output (as they are LEDs). When they are selected, they should go green.

One thing that may make life easier is naming the pins differently. If you right click on an assigned pin you can “assign user label” which will allow you to assign a label. I have assigned names like LED 3 and User button to make life easier.

An example of what the pin out should look like when you have set the pins

You probably now see how this is very useful for very complex projects where almost all the pins are going to be taken up by being connected to different inputs and outputs. You can also do things like set different clock speeds, set up ADC’s and other peripherals such as USB’s.

Now in the Project manager section, I have made sure the toolchain/IDE is set to STM32CubeIDE, and make sure the rest looks like the locations you have set and the names as well.

Now click the “Generate Code” button at the top.

STM32CubeIDE

It will generate the code and open the STM32CubeIDE. I use the recommended workspace when it prompts for it. Then the window should open. On the left hand side, go to your project name->Src->main.c and double click on main.c.

If you have a look in this main.c it will look like a lot to start with, but we just need to find the while(1) loop, for me it is line 98. The rest of the file is doing useful things for us, like setting up the pins we designated before in MX, and also setting up all the required HAL libraries.

For this next part we are going to use the HAL libraries to toggle the GPIO pins for the LED’s, and lighting them up. in the while loop between the comments USER CODE BEGIN WHILE and USER CODE END WHILE I have put:

HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_8);
HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_9);
HAL_Delay(100);

which will toggle each pin on and off every 100ms.

What my code looks like

To upload this to the board, first we build it by going to Project->Build project, and wait for the build, hopefully there should be no errors. Then, making sure the board you are uploading to is connected, go to Run->Debug. It may ask you to save the file, and go ahead and do so. Also it may ask you to switch to a new view, go ahead. Go to Run->Resume, and the LED’s on board should then flash fast!

When you wish to stop, go to Run->Stop and you should return to main.c to do some more editing.

Well done on getting this far, and if you didn’t through some parts then remember Google is your friend, but also the comments section below is open to ask questions. Equally get in touch on Twitter and share this if you found it useful. I may even be able to do more like this, for instance more on the HAL libraries.

Why You Should Care About Quantum Key Distribution

We live in an ever changing world, and on the horizon is the era of quantum. We all hear about quantum computers, and how some may or may not have hit quantum supremacy, but one of the lesser known impacts of the advent of quantum computing is the impact it will have on encryption. In this day and age, encryption is used everywhere, and it is highly important. From protecting the messages to your friends on WhatsApp to keeping your credit car details safe when buying online, encryption keeps data safe by cleverly encoding it using secret keys that only the sender and receiver can decode… Or at lease that is the current working assumption.

For a moment think about how much data is out there. We are far away from the days where websites had a single static page and an email address. The internet of things is creating sensors that monitor our every moment, companies like Amazon are amassing our buying habits over generations, and almost all banking in the modern world is conducted online. Data is everywhere, and it is worth money, hence the need for solid encryption technologies. There are many working on what those technologies will one day look like, and to many, quantum key distribution (QKD) could be the answer to all of our problems.

Why is Current Encryption Tech Not Good Enough?

Encryption is split into two types, symmetric and asymmetric.

Starting with the simpler one, symmetric key encryption uses the same “secret” key for encryption and decryption. So you encrypt the data using your “secret” key, and give the encrypted data and the key to the person you want to read it. This is good if you are happy to literally take the data to person by hand on a memory stick, but how do you send the “secret” key secretly over the internet? It also has the problem that you are giving away your key, so your next message to a different person will need a different key. With a large user base, this becomes very difficult to manage. Asymmetric or “public” key encryption uses a different key for encryption and decryption. Every user in the network will have a “public” key and a “private” key associated with them. If you want to know more about the modern form of encryption, look into RSA.

This “public” key system is the bedrock to modern encryption algorithms. This is then added with the complexity of dealing with factors of very large prime numbers. When you multiply two large numbers together, you get a very large number that you can use for your key. The only reasons that computers struggle to beat the system is that modern computers cannot deal with these huge prime numbers effectively, and the process is too slow to be useful for malicious intent. The problem comes when we bring in quantum computing. There is a famous algorithm known as Shor’s algorithm that was developed in 1994, but would need a functioning quantum computer to be able to complete. If it ever works then it could in theory crack any encrypted data that uses these prime numbers as keys. So our banking data, all our messages and everything we currently use could be seen by anyone with a quantum computer. What all this means to us is that we need a fundamentally different way of encrypting data, or at least the way we generate and share keys.

Researchers at the National University of Singapore work on a QKD light source for a satellite (Source: NUS)

Why is QKD any better?

Quantum physics is basically the way we describe the way matter and energy interact at the sub-atomic level. This is a follow on to classical physics which describes things like why the apple hit Newton on the head, and we we don’t sink in a swimming pool.

I could go into detail at this point about all the different nuances about the differences between quantum and classical physics, but most of it doesn’t really impact on QKD, as all we really care about are photons, the carrier of light. All we need to know about photons are that the have a direction, and a polarisation. The direction bit is fairly self explanatory, but polarisation needs a quick explanation. Photons oscillate (go up and down like a wave) at a certain frequency depending on the energy, for this we don’t really care about the frequency, but imagine what that looks like if it was going slowly. It only oscillates in one plane, so if it was to go through a slit, it would have to be at the same angle as the direction the light was oscillating in to actually pass through it. This is actually how sun glasses work, it only lets through light of a certain polarisation, so only some of it is let through.

The creepy thing about this polarised light is what quantum physics tell us about the polarisation. You can only know what polarisation it is by measuring it, which might seem like a stupid thing to say, but its a key part of quantum physics. Until that photon is measured it has an unknown state, so it can be seen as having every state. This is the part of the QKD technology that makes it work. Imagine if you sent a series of photons with binary bits encoded in the polarisation of the photons, so each photon is at a different angle depending on the bit it represents. The person reading the photons would measure the polarisation, which means that they now have a known state, i.e it has been chosen. The key is that if somebody tried to intercept the photon, and then resend what they read, the photon that was resent cannot be exactly the same so there will be a mismatch between the data sent by the sender, and received by the receiver. If they compared a small portion of the data over insecure channels, they would realise that the data sent is corrupted and start again.

Now imagine if that was a “secret” key. It would mean that there is a way to guarantee that the key you have sent was not corrupted or intercepted by anyone, and it was safe between the people communicating. On top of that, you don’t have the problem with prime numbers and quantum computers defeating it. In fact it may be a way that quantum computers (especially the optical ones) communicate within themselves, and with others, as they utilise this phenomenon as well to function.

That is QKD in a nutshell, and why it could the thing that changes encryption, something we all rely on every day, for the better. For further reading, look up the first ever QKD protocol, named BB84, it explains how QKD started to be implemented in the real world.

What is an Atom Chip

Atom chip by RAL Space
Cold atom chip as a source for atom interferometer​. Credit: RAL Space, STFC, UKRI

If you follow physics or science news, you will know that a huge part of current physics research is in the field of particle physics. Scientists aim to understand and harness the power of atoms. In laboratories across the world, scientists have been using silicon circuitry to sense the effects of their experiments, with huge silicon detectors being commonplace. You will also find silicon circuitry in the driving circuits of things like magnets and lasers, but these instruments are usually large, as it only needs to fit in a lab. There is no need to minimise. There is also an upcoming exciting area of physics that uses all of these techniques to truly harness the power of the atom known as Cold Atoms. The world of cold atoms uses the concept of trapping small amounts of atoms in a very small area, and super cooling them very close to absolute zero. At this temperature the quantum effects of the atom take over, and can be observed and maybe even harnessed.

 Atom Chip
A close up of an atom chip by The Atom Chip Lab at Ben-Gurion University

This is where Atom chips come in. They are not the only way to practice cold atoms by any means, but it is becoming a popular method to practice the art. The popularity is down to how small the overall circuit is, and the lower amounts of instrumentation needed to drive it. That being said, they are also more temperamental, and much more sensitive to things like noise. The way to trap atoms in an area is to use electric, magnetic and optical fields, all these things have control of the location and activity of the atoms. Atom chips use these three fields to confine, control and manipulate the cold atoms. If you imagine a normal Integrated Circuit (IC), the electrons move through the surface, through things like transistors, capacitors and resistors. In Atom chips the atoms are trapped above the surface, and using forces that we can control, we manipulate their motion, and internal state. The electric, magnetic and optical fields come from small structures on the chip, sometimes protruding out.

Atom chip at Vienna University of Technology
Another example of an atom chip at TU Wien. Credit: Vienna University of Technology

The area that the atoms are held in is often around 1 micrometer squared, and the amount of atoms is around 10,000. This is a surprisingly small amount when you think about it, that’s the amount of students you would find at most universities. The atoms are held at a few hundred nano Kelvin, and due to their design are often well isolated from the warm solid state environment around it. This allows their quantum state to remain undisturbed for tens or even hundreds of seconds. This is partly the basis of modern Atomic clocks. In fact the atoms used are usually the same, strontium or cesium. When you see images of modern atomic clocks, there usually is some sort of atom chip controlling the cold atom cloud directly. This is down to the ease of both reducing the size and complexity of the clocks without impacting the resolution of the clock circuit itself.

Cold Atoms Lab ISS
An artists impression of the Cold Atoms Lab on the International Space Station. Using techniques similar to the ones mentioned here. Credit: NASA/JPL-Caltech

The basis of the trapping part of the circuit uses something known as a magnetic trap (sometimes known as a micro trap). Imagine a wire, for the moment we will imagine it it straight. When a current is induced through it a magnetic field is created around it, a bit like a tube moving round the wire at a certain distance. This is the red line on the diagram below. As you learnt in physics class, the intensity of that magnetic field is directly proportional to the current running through the wire. Control the current then we control the magnetic field. In a magnetic trap there is also another magnetic field induced across the entire experiment, that we can assume is constant and uniform. This is represented by the green line, and is called B. Although there is only one green line, The magnetic field ie everywhere, but the green line is the bit we really care about. Now it took me a while to visualise this, but these two magnetic fields interact, and add up. So if the wire magnetic field is travelling the same way as the field B at any point then the magnetic field gets stronger, if the magnetic field oppose then the field will get weaker at that point. This means there is a magnetic gradient across the entire experiment.

The point we care about is where the magnetic field is zero, meaning the wires magnetic field is equal to, and opposing the field B. As the magnetic field from the wire gets less as it gets further away from the wire, there is a point at a certain radius (R on the diagram) away from the wire where this is the case. The atoms used want to be in the lowest energy state, and are trying to get away from the magnetic field, so it will “seek out” the point with the minimum magnetic field. in this case, the point R distance away from the wire. The wire now has a single line of trapped atoms R distance away from it. Now imagine that wire is bent into a circle with a radius of R. All those atoms are no longer trapped in a line, but now at a single point in the center of the wire. In practice to get the required magnetic field strength it will be a coil rather than a single wire, but the concept is the same. You now have a collection of atoms trapped in a small area defined by you, to do an experiment. Most of the time the atoms are then super cooled with lasers, or trapped and compressed further. This allows experiments with Bose Einstein Condensates, and potential to make quantum “qbits” for quantum computers, but that is a post for another day.

Thank you for reading, take a look at my other posts if you are interested in space, electronics, physics or military history. If you are interested, follow me on Twitter to get updates on projects I am currently working on.

Follow @TheIndieG
Tweet to @TheIndieG

LM3909 – An IC Just to Flash an LED

So during my placement year I was getting really into old electronics, and old IC’s, especially those no longer in production. We were also on a project where we were trying to design a circuit that would flash an LED for a short period of time from the charge on a small super capacitor. The big issue we had was how to minimise current flow, and power an LED at really low voltages, less than 2V. This on the face of it seems like a simple problem, until you start to think about it.

Million Mile Light
Products like the Million Mile Light, a flashing low powered, high brightness LED indicator need to flash for long periods of time on very little charge, much like the problem I faced. Credit: Million Mile Light

There are two go to ways that most engineers would go with to make a flashing LED with a constant flash rate. First is to use a small microcontroller, such as an ATTiny, or a Pic12F series, and use software to flash the LED. This seems good on the surface (and it is what we used in the end product) but it has a big drawback, it can only output a voltage less than the power rail. some versions of the PIC12LF’s can function down to 1.8V, perfect for our power supply needs, but LED’s need upwards of 2.7V (usually) before they start to light, so although our micro will work the LED wont. The second go to way to make an LED flash would be to use the classic 555 timer, one of the most manufactured chips of all time. There is a good reason it is famous, it is extremely versatile. You can decide the frequency based purely on the capacitor and resistor choices. We still have a similar drawback though, a 555 timer needs at least 4.5v as a power supply. So with our potential sub 2V power supply, neither the IC or the LED will turn on. That is one way to conserve energy!

schematic
A cut out from the datasheet, with a basic view of the circuit inside the IC, which I will go through in another post, and a pinout diagram, very useful for prototyping. Credit: National Semiconductor.

This is where the LM3909 came in to play. You have to remember that this chip was developed prior to 1995 (so it is older than me) when the electronics market was very different. Battery technology was not the same, and nowhere near as cheap. It was much more common for people to want to use off the shelf single use batteries such as AA, C and D batteries, or even coin cells in most projects. If you wanted something with a little flashing light on it there were plenty of applications for it. There are buoys in the ocean, store signs and displays, and Christmas lights, all of which would benefit from minimising weight of batteries, but lasting for serious amounts of time. Just as a reference, you could get to 4.5V (to power a 555) by using 3 AA batteries, but the voltage across them would soon dip below this, so you would need at least 4 in most applications. 4 AA batteries take up a lot of space, and weight, not great for many of these applications. Plus most of the chips we have discussed use a fair amount of power, the 555 uses at least 3mA while running, not including the dissipation in the resistors, and all of the power charging the capacitor wasted.

1.5v schematic
A snippet of the datasheet, showing the simplest connection diagram, and a graph of typical current consumption with relation to the battery voltage. It also has a great table describing how long standard batteries tend to last in this configuration, up to 2 years! Credit: National Semiconductor.

So how does the LM3909 solve these issues? well it makes use of a clever concept similar to the 555 of charging up a capacitor. The difference is that the 3909 uses that charge in the capacitor to flash the LED. Although it is slightly more complex than the below schematic, you can think of it as there being a switch inside that oscillates between two states. We will go through how it actually works in a future post. To start with the capacitor is in series with the battery, and in parallel with the LED. The LED wont light, but the capacitor charges up to near the power supply voltage. Once charged, the switch inside flips, and now the power supply, charged capacitor, and LED are in series with each other. To the LED it now sees the capacitor (charged to 1.5V) plus the 1.5V power supply, equivilent to 3V, more than the forward voltage it needs to turn on. As there is a very small resistance, the LED will be on as long as the capacitor has some charge, which isn’t very long as it will discharge fairly quickly. This is the “flash”, as once the cap is discharged the LED will turn off, and the switch will flip back. The capacitor starts charging again, and the whole process restarts. This goes on for as long as the battery has power to give.

Rob Paisley
A great description of the basic principle of how the LM3909 works, charging the capacitor up, and then releasing all that energy through the LED, with increased voltage. Credit: Rob Paisley.

A couple of points to note, the timing and the brightness of the flashing is based upon the capacitor you use, which is quite clever. There are two settings, depending in the pin you put the capacitor in will also double (or halve) the time the cap will take to charge. This means slower flashing, but longer lifetime. Having a smaller capacitor will mean faster, but less bright flashing, and a bigger cap will therefore be slower and much brighter flashing. The design of the chip also means that only two external components are needed for it to work, a capacitor and the LED, compared to the many resistors and extra cap needed on things like a 555 timer. The fact it can use less than 1.5V power source means we can use a single AA battery to power this device, and according to the data sheet it can last up to 6 months on one battery! I have one on my desk that has lasted longer than this.

my LM3909 circuit
My version of this circuit fit into a AA battery box, with it being powered by a single AA battery. It has a switch meaning I can turn it on and off. Poundland LED lights are a good source of these!

All in all I can see why National Semiconductor decided to make this chip, it filled a gap, and was used widely for a long time. Developments in battery technology, and more complex designs needed for the applications this was for has meant that they no longer make the LM3909, but they are still available on Ebay and some Chinese manufactures make them. There is also a design out there to make a discrete version of the LM3909, and I may try that for a future post, as it looks interesting.

Thank you for reading, take a look at my other posts if you are interested in space, electronics, or military history. If you are interested, follow me on Twitter to get updates on projects I am currently working on.

Follow @TheIndieG
Tweet to @TheIndieG

The Genius of Bob Widlar

National Semiconductor Ad
A famous National Semiconductor ad based on the Widlar Salute and methedology

If you are at all interested in early IC design, especially that in the start of silicon valley, it’s likely that you will have come across the name Bob Widlar. If you have not heard of him then this post may shed some light on an early pioneer of the semiconductor industry. Not just a great hardware engineer, arguably a legendary one. Shaping integrated circuit designs for over a decade he created circuits still in use today, and some of the most famous chips ever. Including the uA702, the first linear IC operational amplifier and the LM109, the first high power voltage regulator. Although a great engineer he was famous for his pranks, and odd office habits. He definitely would not like the current state of corporations, with a bohemian look on life Bob Widlar can definitely be described as eccentric.

Bob widlar salute
Bob Widlar showing the official Widlar salute.

In the late 1960’s and 70’s the semiconductor industry was like something out of a scene in a wild west film. The bars around Silicon Valley were packed day and night with engineers creating innovative circuits and designs left and right, and Bob was right there in the middle of it all. I think a key point to note is that he was partial to his alcohol, for better or worse there are accounts that he wouldn’t make a speech until the had his allotment of scotch or wine. This wasn’t uncommon for the time though, everyone around him was likely the same. The History of Semiconductor Engineering (a very expensive book) describes, “Bob was a fiercely independent individual, very happy to be by himself, and he did everything in a stunning way, which was absolutely natural to him, but completely weird to so-called ‘normal people’.” Basically he didn’t care what other people thought about him. If you want to change an entire industry you have to upset a few people on your way, so this mindset might be best.

Bob Widlar disliked digital circuitry
It could be said that Bob widlar was not a fan of digital circuitry.

There isn’t much known about his early life, and reportedly rarely spoke about it. We do know thought that electronics played a huge role in his early life as his dad was a self taught radio engineer. His father worked at a local radio station so Bob had access to ultra-high frequency transmitters. At 15 he was featured in his local newspaper as an electronics designer who could fix radio and TV sets. Allegedly he also played pranks on the local police using radios, but there is no known details. The passion for electronics continued on when he joined the United States Air Force in 1958. He was responsible for teaching fellow recruits in the use of electronic equipment such as radios. During this time he actually wrote a book, his first, Introduction to Semiconductor Devices. This seems to be a slightly different person to the famous side of Bob Widlar. Some say that his “liberal mind” wasn’t a good fit for the military environment, but his early performance reviews suggest otherwise. His superiors noted his superior electronics and communications skills, they also noted that he had an above average ability to use clear concise words to express himself, and always strived for perfection. In areas of improvement he was recommended to stop dramatising his frustrations at inefficiencies that exist”. This might be closer to the famous widlar. He then left the service in 1961 for unknown reasons, and joined the Ball Brother Research Corporation in Boulder, Colorado. There he helped develop analog and digital equipment for NASA. He was simultaneously studying for a degree with the University of Colorado and graduated in the summer of 1963.

His work at Ball Brothers brought him in contact with Jean Heorni and Sheldon Roberts (who invented radiation hardened transistors), some of the founders of Fairchild Semiconductor. They breached professional ethics by hiring him, a key employee of their customer. He apparently arrived at the interview intoxicated and told the R&D manager what he thought of Fairchild’s analog circuits, saying”what they are doing is bullshit”. He had a second interview and was hired even with the objections by the initial interviewers. His first task at Fairchild was to target IC reliability by improving the fabrication process. He managed to reduce the price of the planar process, and showed he could improve his own bosses designs and squeezed him out of the company. At this point Fairchild only had a lineup of three analog IC’s, all designed for the military, all amplifiers. They were all built inefficiently, like a conventional circuit with discrete devices, creating a sort of hybrid IC. The famous Gordon Moore (of Moore’s Law fame) wanted the company to favour digital IC’s as they were cheaper, easier to design and allowed high volume. Widlar opposed the strategy and held digital electronics in low esteem, famously saying “every idiot can count to one”. Along with the process engineer David Talbert, they rushed through Widlars designs for new and improved analog IC’s, changing the industry as they did so. He managed to remove the need for big resistors and capacitors in IC’s, and truly grasped the planar process. This is when he created the μA702, the first true linear integrated circuit, and the first monolithic operational amplifier.

Bob and a group of engineers at National Semiconductor.

He also created the μA709, another legendary chip. This moved Fairchild to become the leader in the field of linear IC’s. Their circuits were sold out for two years. Some say that at one point Widlar designed and Talbert made 80% of the linear circuits in the world. The problem was that Fairchild never shared the massive profits with them. So he took up a job with National Semiconductor in 1965, taking a huge amount of stock as part of the deal. He refused to do the exit interview at Fairchild and wrote one line to them “I want to be RICH!”. Oddly, Fairchild continued to pay his salary until 1966, Widlar said “Maybe they did not believe that I was actually leaving. Some people are really a little slow.” By 1966 they had set up the epitaxial process at Santa Clara, and created the industry’s first linear regulator. The LM100, a revolutionary new circuit became a flagship product, soon followed up in 1967 with the LM101, an op amp with highly improved performance due to a simple yet robust design. He followed it up with many more improvements to amplifiers, with higher bandwidth, voltage and gain. As well as the famous Widlar current source, he also managed to harness the bandgap phenomenon and built the bandgap voltage reference. This allowed the design of the LM109, a voltage regulator with a power transistor and precise voltage source on one die, something never seen before. By this time Fairchild had gone into a massive decline while National Semiconductor had rocketed up the food chain. In December 1970 he resigned from National Semiconductor and cashed in his stock for $1 million, apparently due to payment issues. He retired to Puerto Rico at the age of 33. The next four years he spent as a consultant.

Widlar current source. Original drawing from the 1967 U.S. patent.

He did come back to National Semiconductor in 1974 as a consultant. During the short stints he spent there he developed the LM12 power amplifier and and the LM10 ultra-low voltage amplifier. These have stayed in production until the 21st century, with the LM10 not even having a reasonable clone for the next decade. in 1981 he spent three years starting Linear Technologies, but this relationship eventually fell apart three years later over patent rights, and his shares were forcibly bought. For the remainder of his life he worked at National semiconductor until 1991 when he died of a heart attack at the age of 53. He had apparently taken up running late in his life and was much healthier. One of his fellow engineers Bob Pease said the damage was done in the first 20 years.

Bob Widlar standing over artwork of the LM10 power amplifier

On top of his famously eccentric nature, fighting in bars and unceremoniously leaving companies he was a well known prankster. The most famous one was the day he brought a sheep to work. The reason was to save money for the company by using it as a lawn mower. He brought it in the back of his Mercedes-Benz convertible for the day. The management not particularly pleased refused to comment. Widlar even invited some young photojournalists to document the event. After the day he left the sheep in a local bar and it was “mysteriously stolen”. On another note he apparently disliked people coming into his office and being excessively loud. He therefore built what is now known as a Hassler circuit which emits a high pitched sound whenever it hears something too loud. In the same vein he also blew up a public address speaker he found annoying with firecrackers! As an analog engineer and highly skilled with high frequency transmitters he once traced one of his problems to interference from the control tower of San Jose airport. In the Widlar way he called up the airport and demanded that they shut down the transmitter. He did have a thing about faulty components and problems, as any electronic engineer can appreciate. If he had spent a day trying to fix a fault just to find a simple component was the cause he would take it out to the workshop an pulverize it with a hammer. The practice now known as Widlarizing usually uses a sledgehammer and requires the component to be smashed so small you don’t even need to sweep it up off the floor. This was so the component couldn’t cause anyone else more problems.

Bob Widlar with the famous sheep, trying to get it to mow the lawn for him. The Mercedes is in the background, badly parked.

Thank you for reading, take a look at my other posts if you are interested in space, electronics, or general history. If you are interested, follow me on Twitter to get updates on projects I am currently working on. Most of all, thank you for taking the time to read my posts.

Follow @TheIndieG
Tweet to @TheIndieG

Locating Where a Sound is Coming From

For my masters year, half the marks came from one module, the masters project. Being a team effort, we were in a group of three. Putting our heads together, and taking ideas from lecturers, we made a list of potential projects. We knew for one that I wanted to be making hardware, and the other two wanted to use/learn machine learning and maybe FPGA’s. After much deliberation we decided to make a project that listened for a sound, and using time difference of arrival worked out where the sound came from. This post is mostly about the hardware and circuitry designed for the project.

The final board for our masters project. Contains four amplifier sections for the microphones and a micro controller with USB interface.

With a world with a big focus on safety in public places, we thought it would be a good product for the security industry, potentially with links to smart cities. Imagine a shopping center, somewhere with lots of security already. They tend to have lots of security cameras, alarm systems and a dedicated guard. This isn’t uncommon in big public places/attractions, especially in the UK. Sports stadiums, train stations and museums are always looking for new ways to protect themselves and isolate problems. The example that inspired us was the horrendous shooting in Las Vegas at a concert in October 2017, just as we were picking projects. The main problem was that the security services did not know where the shooter was, meaning it took longer to get to him. If they had a system like we envisaged, the microphones would pick up the sound and triangulate it. The location could then be sent to relevant authorities to use.

The front page of the New York times just days after the Las Vegas shooting

To start with we needed microphones. We didn’t need to reinvent the wheel, and microphones can be easily bought off the shelf. For ease we used standard stage microphones, that had 3-pin XLR outputs. Although we had been warned that they would not work they had a good omnidirectional pattern, and had lots of good documentation. One issue with them is the output is balanced, which means it needs to go through a pre-amp. To get an idea of what a balanced signal is, imagine a ground connection and two signals. The two signals are the same, but one is inverted. This means when it travels down the cable it is much less susceptible to interference. This is part of the reason we liked using stage rated equipment, as sound engineers have already worked out issues with transporting sound signals long distances through noisy situations. We concluded from research that the signals could reach over 100m, which was the number we were aiming for.

One of the pre-amplifier sections used on the board, using four operational amplifiers.

Once the signal got to the box it needed to be converted to a signal that could be read by an ADC. To do this we used an INA217, a pre-amp designed for basically this purpose. An instrument amplifier, it measures the difference between the signals and amplifies them, outputting a voltage with reference to ground. The signal from the microphone is tiny, in the tens of milivolts range, so it needed some dramatic amplification to get it near the 5V ADC. The INA217 did a good job but we put a second stage amplifier to give it the extra push, as very large gains can sometimes be bad for a number of reasons. We used an OP07D but if we were to do it again we would get a rail-to-rail to get better results. This amp had a pot as one of the gain resistors so that we could easily trim the gain depending on test. Finally, the signal at this point sat between -2.5V and +2.5V so we needed to shift it up so it was between 0 and 5V. This was done with a simple shift circuit and an amplifier. We used another OP07D to make buying easier.

Me manufacturing the PCB, at this point I was inspecting to see how well it had been soldered.

From here the signal gets read by the 12 bit ADC in an STM32 microcontroller. It then streams the data via the USB to a PC where MATLAB picks it up. This is where my knowledge is a bit lacking as I did not make it. In essence MATLAB uses a machine learning algorithm that had listened to over 1000 gunshots, screams and explosions. It has categorized them, and used a number of features to notice the difference. Then when playing a new sound of one of these things (not heard by it before) it categorizes it and outputs it to the user. It also used a selection of sounds from the background to know when there is not one of these events happening, else there will false negatives.

One of our set ups to get a useful output and test the amplifiers were working properly.

All in all the project did actually work. It detected gunshots and screams being played into the microphone, and the triangulation algorithm worked, just not in real time. We managed to win the best masters project, mainly because we had good quality hardware, a partially working system and a good business case behind it. There is a lot of scope of where this project could go, and many things that could be improved, but we were happy with how it came out. I may be able to use some of the circuitry on other projects, who knows. If you are interested in more of the project, maybe some more detail about the hardware or manufacture, comment or message on Twitter. Thanks for reading.

A good example of how much difference there is between the microphones when a big sound was made. Minute distances made a big time difference.

Considerations When Making a Current Shunt Sensor

For battery powered projects, current consumption is a really important consideration when designing the circuitry. While designing my final year project I spent a huge amount of time researching how to put together a simple current sensor. Considering most applications for me are DC, fairly low current and low voltage, the most obvious design is to make a current shunt. The basic idea of a current shunt is that you put a very low value resistor between the circuit you want to measure and ground, and measure the voltage across it. When one side is of the shunt resitor is ground it is low side, there are also high side versions but are mlre complex. As the resistor has a small resistance, there will be a low voltage drop (usually mV) across it meaning it shouldn’t affect the load circuitry. The voltage will also be proportional to the current running through it, meaning if you measure it, and do the right maths you can get a consistent and reliable current reading. This post is about how to get that tiny voltage into 1’s and 0’s, while thinking about the considerations that have to be made about the design to make it accurate and reliable in the environments you want.

Final Year Project
My final year project needed current sensors on the motors as well as monitoring the drain on the battery.

The first thing that needs to be decided is the shunt resistor itself. A shunt resistor is basically a low value resistor, with very tight and known tolerance usually with a fairly high power rating. It can be used in AC and DC circuitry, with the concept behind it being that as a current flows  though it, a voltage is induced across it. The voltage can then be measured and using a simple calculation (based on ohms law) converted into a value for current. The value of the resistor depends on what it is measuring and what is measuring it. Start with what is measuring it. If you are like me, it is likely that it will be read by an ADC, probably on a 5V or 3V3 microcontroller. The voltage across the resistor is going to be amplified between 10 and 100 times (we will get to why in a moment) so pick a maximum voltage within that range. I tend to go with 100mV maximum voltage drop, which for a 5V ADC would require an amplification of 50. Then, take the maximum value of current you want to be able to measure. You can then use ohms law to figure the resistance you need. For example if I wanted to measure 1A, the resistor would be 100mV/1A = 100 mohm. Now we know the resistor value, use the power equation to work out the power eating we want. For this example we would need P = I V = 1 x 0.1 = 100mW. This is the minimum power rating you need, I personally would get a 250mW or even a 500mW just to keep the temperature of the circuit down.

The simple equation to work out what sizesunt resistor to use. Credit: Texas Instruments 

Now we have a voltage that will be somewhere between 0 and 100mV with reference to ground. We want this value to be scaled up to 0 to 5V. To do this we are going to use an operational amplifier. There are plenty out there, and most people have their favourites and I’m not here to convince you otherwise. I tend to use an op amp that I am using somewhere else in the circuit to make life easier. There are a few things you do need from an op amp in this circuit though, it needs to be rail to rail, and have a low input offset voltage. Offset voltage in an op amp is the voltage difference on the inputs, and even though they are tiny differences they can have a big effect because we are amplifying small voltages, and any noise or offset will be amplified too. The op amp needs to be in a simple non inverting configuration. The equations needed to design this are in most first year textbooks and there are plenty of calculators online. I have set a gain of 50 in my calculation, which is in the fairly common range. The output of the amplifier can then go straight straight into an ADC to be measured.

The basic layout of a current shunt sensor showing where the shunt resistors and gain resistors go in the circuit. Credit: Texas Instruments 
The first version of my current sense test circuit, using an OP170 made by TI.

Now let’s look at a few places where errors can come into a design like this. There are two types of errors that occur in a circuit like this, gain error and offset error. A gain error is one where the output error gets further away from the ideal output as the current gets higher. An offset error is one that has the same amount of error whatever the input, just like an offset. The only common source of offset error in a circuit like this is from the offset error in the op amp discussed previously, solved with an improved choice of amplifier. The gain errors are usually due to a difference in resistance from the ideal. Many things can cause this, one is the tolerance of the resistor used, we want to use a precision resistor of 1% or less tolerance. Another cause could be temperature changes in the resistor itself, it may be next to a large MOSFET or other hot component, or could have too low of a power rating making it heat up, wither way a change in temperature means change in resistance. Layout can also be an issue, if tracks are too thin or too long they can add extra unwanted resistance.

Great graphs showing the difference between gain an offset error. Credit: Texas Instruments.

If you want to add a bit of fancyness into the project, or really need to measure down to low currents, you need to tackle the zero-current error. The problem is that when using an op amp, even a rail to rail one, it never quite reaches the power rails. Even the best ones can only get within 100mV or so of the power rails, this is known as saturation. Solving this involves moving the power rails slightly so the saturation point is less than ground. If you have a negative voltage rail you can use that but home projects tend to be single supply, so we need another power source. This can be made using a voltage inverter (a type of charge pump). Usually only needing an external capacitor to work, they are cheap and easy to integrate into a project. I used a LTC1983, which creates a negative 5V rail, but there are plenty of others such as the LM7705. Research what fits your circuit and cost point, and just attach the negative output to the negative supply rail of the op amp.

 A great graph showing how the zero current error occurs, and what it would look like if you tested it. Credit: Texas Instruments.

Most issues with error can be fixed during the hardware design phase. You can pick better op amps, such as ones designed to combat offset voltage. Some amplifiers have internal calibration procedures, and some such as chopper stabilizers are specifically designed to correct these problems. You can also use a potentiometer instead of a power resistor, but they are more susceptible to temperature and can be knocked. Another way is to fix issues in software by creating a calibration procedure. Using a calibrated precision current source and a multimeter, measure the reading of the ADC and compare the value to the reading from the instruments. You should get an offset and gain value that can then be used to calibrate the sensor.

A simple set up that I used to calibrate an early sensor, with a big power resistor as the load and a variable power supply to change the current. Marked down to put into calibration.

I would suggest trying out a few of these sensors in future projects, they don’t cost too much, and can be a valuable addition to a design. Especially for power sensitive devices, or smart sensors, this could be a better solution than an off the shelf or breakout board solution. If you want to hear more about my current sensor designs, and how well the testing and calibration went then comment or tweet at me. I already have some documentation that I may release at some point.

Follow @TheIndieG
Tweet to @TheIndieG

Getting Ugly, Dead Bugs, and Manhattan Style

If you are anything like me, you love to build small circuits. I like to try and get my head around how things work by making it in front of me. This is usually in the form of breadboarding, but sometimes that doesn’t cut it, and soldering is needed. Veroboard tends to be my go to for building a simple circuit as something a bit more permanent, but it doesn’t always lend itself to certain designs. Take a design with lots of grounding points in the design, like an RF circuit, it can be difficult to have lots of ground strips everywhere, and the extra capacitance can mess with those high frequency signals. Also, designs with lots of different separate signal traces going round the board can make for a real pain. lots of slicing the traces, which tend to lead to mistakes. With my constant desire for order and straight lines, and pretty layouts this can get annoying quickly. Recently I have found a few new and simpler ways to throw together simple circuitry. For any budding electronic engineer, they are good skills to add to an arsenal.

A veroboard design of a hybrid microphone amplifier and level shifter I made for a recent project, prototyped on veroboard, many mistakes were made.

Ugly Circuits

As the name suggests, ugly circuits are not always the prettiest of designs. There are a few different definitions of what makes an ugly circuit, but my favourite is any circuit where the components are not completely mechanically connected to the substrate. The substrate usually being a copper clad board, but not always. This method can be a tricky one to master, as it is literally a balancing act. The prefered method that I see this being used is having a single copper clad board as a giant unobstructed ground plane. Two wire passives are usually the easiest to start with (standard resistors/capacitors), soldering one side to ground, then soldering the other side to another component in the air. This means any point that is not grounded is usually floating physically in the air (but depending on how good you are it could have floating voltage too). This can be a big benefit to RF circuitry or circuits that need good solid grounding. The unobstructed copper clad board means anything connected to it has a great connection to ground. It is fairly easy to build simple passive filters, but gets very fiddly and fragile if you aren’t careful.

A very “haywire” circuit constructed in the ugly style by Rick Anderson – KE3IJ in 2006. An experimental stage of his AGC-80 Regan receiver.
Not sure on the origin of this one, but it is more chaotic rather than ugly. It is definitely in the ugly style.

Technically ugly circuits don’t have to have a substrate at all, although it makes life easier. There are plenty of examples out there of ugly circuitry that just connects pins to pins via small wires. As said before, it can be very fiddly to make a circuit like this, but it is much cheaper to make singles as there is no need for expensive copper clad board. Plus after plenty of practice one can get very good at doing it. The wires connecting the parts together can be part of the structure of the unit, and if designed correctly could be very strong. The construction method can be useful in certain circumstances, and as long as you have the components, it can be build easily with just a soldering iron and solder. Although there are some amazing looking circuits made from this method, the majority do earn the name of an ugly circuit. If you can make a pretty one I would love to see.

Nathanxl at the Electro music forums creates some amazing almost artistic music project using the ugly style, but they look incredibly hard to make.
An Arduino Uno made without any substrate, just wires and components. Made by Kimo Kosaka, it is not an ugly, but it uses an ugly style of construction.

Dead Bugs

No, this method does not actually use dead insects as a manufacturing material, but it may look like it. The idea is to take an IC, traditionally in a DIP package, and place it upside down on the substrate. Usually glueing, but not always, with the pins facing upwards, so it has the look of a dead bug. The pins can be bent to attach to the substrate if required, but they tend to be facing up. Taking many methods from ugly, the pins are usually directly connected to passives or wires to other chips. This means the mechanical connections are usually in the air. The benefit to this method is that you don’t have to waste time drilling holes in in the substrate, and can integrate IC’s into an ugly design fairly easily. If trying to use this method, just be weary that all the pins on the chip will be the wrong way round as it gets flipped when placed upside down. I recommend making your own diagram to go from to make life easier.

As you can see in this use of dead bug mixed with ugly construction made by JCHaywire is the chip flipped over and the pins moved about with all the connections floating in the air

Although not really dead bugs, the concept can be seen in many modifications of PCB’s. It is easy to order the wrong package or get sections of pins wrong when designing and ordering PCB’s, especially if you have manually made the part. So it is not uncommon to find upside down IC’s on prototype PCBs or even sometimes on short runs. That being said, anything smaller than a DIP or SOIC package can get very fiddly, and is difficult to hand solder, and will need some extra magnification. Don’t be deterred though, there are many examples of even QFN and even BGA devices being hand soldered in the dead bug form, with very thin gauge jumper wires. With plenty of practice and spares, it can be a useful method of saving money without having a new run of PCB’s.

A bodge on a PCB before the real chip arrives, a 6650 is being used in dead bug style to get the circuit working by Dave Curran.

Manhattan Style

This one is my favourite styles of circuit design on the cheap and quick, and if done right can be very pretty and efficient. The big issue with the ugly method is that it is difficult to create, and often difficult to follow, and horrible to document. Manhattan is an upgrade, using cut out sections of copper board as small islands, much like manhattan. This method means there are no connections floating in the air, as all points on a component are mechanically connected to copper clad in some way, even if it is only a small bit. This leads to generally a much nicer laid out board, that can easily be followed and replicated. It also allows for use of SMD components, which is possible with ugly, but very difficult. The small pads don’t have to be separate, they can simply be cut outlines on the same backplane, making the process cheaper, but get it wrong and it can get messy. I much prefer manhattan as a quick construction method, due to its neat look and ease of use. Another reason for the name Manhattan is the fact the capacitors and resistors tend to line up and are perpendicular to the substrate, looking a bit like tower blocks and skyscrapers like Manhattan itself.

A great example of Manhattan style soldering by Dave Richards. Solid copper substrate with QRPme pads to attach components together. 
Another impressive circuit in the Manhattan style by Dave Richards, this one is a high performance regen receiver, with a full write up on his blog.
An example by VE7SL – Steve of making his own pads for his amateur radio transmitters and receivers, using an Ebay punch to make the pads.

One step on from Manhattan style, and the final step before fully fledged PCB’s is a little known style called Pittsburg, much like the steak. I have also seen it be called muppet style, and I am sure there are many other names for it. It is very similar to an actual PCB, usually etched, a layout is carved into the board, with traces and pads. The difference from a PCB is the fact there are no holes anywhere to be seen. Meaning you get the benefit of being able to etch a nice looking layout at home, and the benefit of not needing expensive routers/drills that quickly break. To allow for the pads to be soldered to as the main mechanical connection they are much bigger to allow for more solder on a bigger surface area. These pads would be overkill for a thru hole project, but also allows for easy use of SMD components. You can sometimes see specialist pads like Pittsburg to use SMD chips on a Manhattan style board. It is a matter of taste and confidence. These methods are obviously not suitable for all prototypes, but could come in useful for your next project. 

A Pittsburgh style PCB at one point sold by Joe Porter, unsure if they are still sold.

A good source of the small pads used in Manhattan can be found here. Reasonable price, and if you are doing lots of prototyping you can even buy the tools to make it yourself!

Thank you for reading, take a look at my other posts if you are interested in space, electronics, or military history. If you are interested, follow me on Twitter to get updates on projects I am currently working on.


How the Type G Gate Worked

apollo 3 input NOR gate
An image of the silicon die inside the Type G 3 input NOR gate used to power the Apollo Guidance computer.

Previously I went through the three input NOR gate that ran the Apollo Guidance Computer and how the circuit works. Previous to that I also told the story of how this chip partially funded Silicon Valley as we know it today. This post builds on that and goes through how the silicon works, and the simplicity of the circuit. Quite a famous image of the chip, fairly detailed image of the silicon inside the device spurred on this post, and taught me lots about silicon that I want to pass on.

apollo 3 input NOR gate schem annotated
The schematic of the 3 input NOR gate. From the schematic of the Apollo Guidance Computer. Annotated with my own designators for reference.

The above schematic of the 3 input NOR gate is also shown in previous posts. It is from the NASA Apollo Guidance Computer schematic, but I have annotated it so that I can reference to specific parts. It is a handy schematic considering it was right at the start of the development of semiconductors. The first image in the post is the best image of the silicon, but is not very big. The biggest image I can find is not quite as sharp, but is much better to annotate, it is the same chip. The first annotation shows the pinout of the device, and how those pins actually connect to the pins.

apollo 3 input NOR pin out
The silicon of the 3 input NOR gate with annotations to show which pin is connected. The pin numbers are from the schematic.

Showing how pins are connected
An image showing how the pins coming off of the silicon are connected into pins of the flat pack.

The noted parts of the above images are pins 5 and 10, and are the starting points to deciphering the layout. If you look at pin 5 and 10 on the schematic, they correspond to GND and power respectively. They are the only pins that are shared between both NOR gates. Apart from that the two sides look remarkably similar, and are basically a mirrored version. To figure which is ground and which is power, the resistors need to be taken into account.

apollo 3 input NOR gate resistors
The resistors on the silicon of the device. Shown above as brown lines they are P doped silicon that act like a resistor.

The above image shows the resistors found on the device. They tend to just be a thin section of P doped silicon, and above connect two sections of aluminum to form a resistor. It is also noted that there is big section of brown surrounding the whole circuit. Although it functions like a resistor and is made in the same way, it is puterly for ESD purposes, protecting the circuit. This big ring also is a big hint that it is connected to ground (pin 5). the second hint is that GND has no resistors attached to it on the schematic, but power has two. They are R1 and R2, connecting to pin 9 and 1 respectively, and are pull up resistors. Pin R3 to R8 are simply the base resistors for the transistors. They are all roughly the same size, and are there are 6 of them. The transistors are also fairly obvious in the centre of the silicon.

apollo NOR gate transistors
The centre silicon from the Apollo 3 input NOR gate. The transistors have been shown, and the collector, base and emitter also shown,

The above image is showing the heart of the device. the 6 transistors that make it resistor-transistor logic. As you can see in the above image, all the collectors are connected together, connected to pins 1 and 9. If you look closely, the base and emitter of each transistor sit inside a brown section like the resistors. This is P doped silicon and forms the base-emitter junction. This allows the base and emitter to sit anywhere within that P doped silicon detection to work. This means that the transistors do not conform to the standard Collector-base-emitter topology. All of the emitters are also connected together via the aluminium placed on the top, but the P doped sections of each device are seperate. As all the transistors of each device have common emitters, it doesn’t matter that they are all connected together, by design, only one of the transistors needs to be on for it to function.

Ken Shirriff transistor side view
A great image showing how the transistor works from a side view by Ken Shirriff.

The above image found on Ken Shirriff’s blog shows how the transistor works with the emitter and base in the P doped silicon. I may do some more posts about it, but his blog is a great place to find more information on silicon reverse engineering.

Electronics world 1963
A cutout from electronics world in 1963 showing the new process of planar technology. This method was used to make the NOR gate.

The above image is an interesting one I found while researching this chip. A section in electronics world 1963 showing how micrologic is made. The type G chip was part of the second batch of micrologic circuits. This section was useful to see how silicon was actually manufactured, and in some ways, still is today.

The NOR Gate That Got Us To The Moon

Type G micrologic
The Fairchild Type ‘G’ Micrologic gate for the Apollo Guidance Computer – this is the flat pack verison

In a previous post I talked about how the going to the moon kick started the silicon age. If you haven’t read it, it is short but really interesting story about how NASA made Integrated circuits cheap, and partially funded what we now know as Silicon Valley. In this post I am going to take a slightly closer look at the circuit that ran the famous type “G” Micrologic gate that ran the Apollo Guidance Computer.

apollo 3 input NOR gate
The official NASA schematic of the Type G micrologic gate found in the Apollo Guidance Computer

As you can see in the above image, the circuit was not particularly complicated. You have to remember that this is very early logic, before CMOS or NMOS or any other fancy IC technologies. This is basically two 3 input NOR gates, they both run off the same power, with pin 10 at the top, and the negative which was likely ground being shared on pin 5. The output for the left NOR gate is pin 1, and the output for the right is pin 9. The three inputs for the left are pins 4, 2 and 3, with the right having pins 6, 7, and 8 as inputs. Simply put, the output is “pulled” high to power when all the inputs are OFF. The resistor between pin 10 and pin 1 (or 10 and 9) are a simple pull up resistor as you would find in most electronic circuits. As expected with a NOR gate, the output will be only be ON when all the inputs are OFF. When any of the inputs are ON the output of that gate will be pulled to ground. One two, or all the inputs can be on, but it just needs one to turn OFF the output. The resistors going into the base of the transistor are just to limit the current.

3 input NOR
My breadboarded version of the 3 input NOR gate, it is made with BC547 transistors and a DIP switch. the output has been inverted with the LED.

I made a simple recreation of this circuit using BC547 NPN transistors, but most NPN transistors would work, these were ones I found in my parts box. As you can see in the image above, I have made it on a breadboard, with the inputs being a DIP switch attached to the power (5V in this case). The base resistors for the transistors are 1K and the pull-up to 5V is a 10K. I recommend making up this circuit if you want to learn a bit more about logic, and is a cheaper method than going out to buy 74 series logic chips! As you can see in the images there are a number of states that I showed the circuit in, and notice that if any of the switches are on, the circuit turns on, this is slightly against what I mentioned earlier, but thats due to the output LED using the transistor as a current sink, not a source, so the output is inverted. Basically, when the output is 0 the LED turns on. The only time the LED is off (output high) is when no switches are on, meaning all the transistors are off.

apollo 3 input NOR gate
An image of the silicon die inside the Type G 3 input NOR gate. We will be going through how the layout works in a future post.

The final point for this post is why the circuit is actually quite inefficient. Modern logic is amazingly low power compared to this. One of the biggest issues is that it is always taking power in some way. When the inputs are off, there is still some leakage through the pull up resistor, when an input is on, then there is current going through the resistor to ground. Also, by the nature of the transistors there is always parasitic leakages, and inefficiencies in the process. They are only small numbers, but the AGC used over 3000 of these circuits, so the small leakages soon add up to draw some hefty power needs, especially for battery powered operations.

If you enjoyed this post, take a look at the rest of my blog, there is lots about space, electronics and random history. I am always open to ideas and feedback, and where is best to post links to my posts.