Kilcullen Science and Engineering

Sunday, June 07, 2026

Learn How to Solder: A Complete Guide for Beginners

Image by permission Weller Tools

A Basic Skill When Building Electronic Circuits

Soldering is a fundamental skill essential to learn when building electronic circuits or fixing circuit boards. In this tutorial, we'll cover:

  • An explanation of soldering and solder
  • Tools you'll need
  • Description and preparation of a soldering iron before use
  • Soldering wires to tags
  • Through-hole soldering of components onto a circuit board
  • How to desolder
© Eugene Brennan

What Is Soldering?

Soft soldering is a technique used to bond metal components together. The components could be electrical wires, terminals or electronic components. Printed circuit boards (PCBs) used in electronic devices are populated with lots of electronic components, and these components must be attached securely. Solder is like a glue that fixes the components to the PCB. Unlike glue, which physically bonds materials together, solder also ensures that there's a good electrical connection between the component and the PCB.

Soldering is also used in plumbing to join capillary fittings to pipes, in metalwork and in jewelry making. The term soft soldering originates from the fact that soft metal alloys are used, and lower temperatures are required to melt them. Hard soldering or brazing is another soldering technique that uses harder metals such as silver and brass for joining metal items, again typically jewelry and bicycle frames.

Top and underside of a PCB showing the solder joints. Pins of the integrated circuits (ICs) and other components pass through holes in the PCB and are bonded electrically to copper tracks using blobs of solder. Image courtesy Axonite and Magnascan via Pixabay

What Is Solder?

Solder is a fusible metal alloy used for making solder joints. It comes in rolls of varying gauge wire, as a paste and in bars. Originally, solder was an alloy of tin and lead; however, lead is toxic and in the EU, the WEEE and RoHS directive came into effect in 2009, restricting the use of lead in consumer products. Lead-free solder now contains tin, copper, silver and other alloys.

Solder typically has a melting point between 50° C and over 200° C (122° F and 392° F). Solder wire used for electrical/electronic joints is normally flux-cored. Flux, made from a resin that melts when heated, flows over the joint when soldering. It aids flow of solder and also shields the solder and components from oxygen in the air. This prevents an oxidation film from forming, making it more difficult for solder to stick and also potentially cause a "dry joint" or bad electrical connection.

A roll of solder wire. © Eugene Brennan
Typical electric soldering iron on a stand. The blue sponge is used for removing flux residue from the tip of the iron. © Eugene Brennan
Soldering iron bit. © Eugene Brennan

What Tools Are Needed for Soldering?

Solder joints are made with a tool called a soldering iron. This is powered by electricity or gas, but older irons used for metalwork were heated with a blow torch. It consists of a handle with a copper bit at the end, usually coated with a metal such as nickel or iron, to minimise oxidation of the bit and improve thermal conductivity when soldering. An electric element or catalytic converter heated by burning gas heats the bit to about 180° C (356° F) or higher.

Other tools used for soldering are:

  • Side cutters (wire snips) for cutting wire and leads of components.
  • Desoldering pump ("solder sucker"). This sucks up molten solder from a joint, allowing the removal of wires or components.
  • Tip cleaner. During normal use, a moistened sponge is used. However, abrasive tip cleaners that use curled wire are capable of removing harder deposits on the iron's tip.
  • Soldering iron stand for holding the hot iron in between uses. Irons aren't always supplied with stands, but they can be bought separately.

Optional

  • Vice. A small vice is useful for holding connectors or circuit boards while soldering. Usually, these vices have rubber coverings for their jaws to avoid crushing components and sometimes a suction base for sticking to a bench. Some vices clamp onto the edge of a worksurface.
  • Solder wick. This is braided copper wire, used to "soak" up solder when de-soldering.
  • Flux is used when soldering with non-flux cored wire. This is mostly used when soldering plumbing fittings or metalwork joints. Flux is available as a paste or liquid.
De-soldering pump or "solder sucker" for sucking up molten solder when de-soldering components. © Eugene Brennan
Side cutters or wire "snips" for cutting wire. © Eugene Brennan

Choosing a Snips

Side cutters are available for cutting varying gauges of cable. I have used an Xcelite side cutters like the one above for over twenty years and available from Amazon. The high mechanical advantage of long handles and short jaws means that they can easily snip through light to medium gauge wire used in electronics. Jaws are closely spaced when closed, and this is important for cleanly cutting very fine wire.

A small vice like this one is useful for holding components such as connectors when soldering. This vice has a suction base to hold it securely onto a smooth surface like a countertop. © Eugene Brennan

Preparing an Iron for Soldering

If you have a new iron, you need to tin the bit. Then wipe/tin it regularly as it gets covered in burned flux deposits.

Tinning is necessary to improve thermal conductivity between the bit and joint. Basically, it ensures that heat flows quickly and easily to the parts being joined so that the solder wire melts fast and flows over the joint.

  1. Wet the cleaning sponge and squeeze out excess water. It shouldn't be saturated, just moist, or it'll cool the bit during cleaning.
  2. Plug in the iron and wait for a few minutes for it to heat up. Some irons have temperature control, so adjust to about 180° C (356° F) or whatever is recommended for the solder wire. Lead-free solders require a higher temperature, typically over 200° C (392° F).
  3. Clean the tip on the sponge, giving it a brief wipe.
  4. Hold the solder wire in one hand and the iron in the other. Touch the end of the wire off both sides of the tip and allow it to flow. If a blob forms on the end, wipe it off on the sponge.
  5. Solder the joint immediately as described below.
  6. Periodically clean the tip on the sponge while soldering further joints, giving it a brief wipe. Repeat tinning when the solder coating on the tip becomes dull.
Clean the tip on the wet sponge. © Eugene Brennan
Tin the tip all round. © Eugene Brennan

Steps to Soldering Joints and Components

First, we'll make a joint from some stranded wire to a tag on a loudspeaker. Remember to tin the iron before soldering.

How to Solder Wires to a Tag

  1. Strip about 6 mm (1/4") from the end of the wire.
  2. If the wire is multi-stranded, twist the strands together
  3. Feed the wire through the hole in the tag
  4. It helps to double over the end of a wire after pushing it through the tag or wrap it around the tag to stop it from detaching during soldering. However, this makes it more difficult to remove if the joint needs to be desoldered in the future.
  5. Press the iron's tip against the tag and touch the solder wire against the tag, not the iron. Allow the solder to melt and flow all over the tag and through the strands of wire.
  6. If you have several more connections to make, wipe the iron after soldering every few connections to remove burned flux.
  7. Tin the iron's tip every so often with solder and wipe. The solder coating on the iron helps to improve thermal conductivity with the components being soldered so that they heat up quicker and solder melts.
Twist together the strands of multi-stranded wire. © Eugene Brennan
This loudspeaker has tags for connecting wire. © Eugene Brennan
Push the wire through the tag and double over to stop it falling out. © Eugene Brennan
Tin the iron tip and hold it against the tag. After a couple of seconds the tag will be hot enough to melt the solder. Touch the solder wire off the tag, not the iron. © Eugene Brennan
Completed solder joint. © Eugene Brennan

How to Solder Components Into Circuit Boards

Many components will have pins or leads short enough so that they can be soldered directly to a circuit board; however, other discrete components need to have their leads shortened. This is called through-hole soldering.

  1. Trim the leads of the component so that they project about 3 mm (1/8") from the underside of the circuit board. It helps to bend the leads slightly so that the component doesn't fall out when soldering.
  2. Leads are normally made of copper and coated with tin to stop them from tarnishing. A tarnished lead can be difficult to solder, and the joint may be poor. Bare copper wire or component leads can be cleaned with wire wool.
  3. Hold the tinned tip of the soldering against the lead and board.
  4. Again it's better to touch the wire against the lead and track on the board, rather than the iron's tip. This is so that flux melts and flows over these parts, shielding them from oxygen rather than burning on the tip.
  5. After a couple of seconds, the solder will melt and flow. Allow it to form a mound around the lead. Remove the iron and wire.
  6. Take care not to get solder on adjacent components or tracks (like I did in the video!). Usually, tracks on PCBs are covered with a solder mask layer (this is what makes the board green). However, it's easy to bridge the gap between solder pads on a densely packed PCB.
  7. If leads project excessively from joints after soldering, nip them off with side cutters.
Discrete 1/4 watt resistor. This is about 5 mm or nearly 1/4" long. © Eugene Brennan
Usually leads are coated with tin, but older component leads or bare copper wire may be tarnished. Cleaning with wire wool improves solderability and gives a more reliable connection. © Eugene Brennan

Insert the Component Into the Board

Cut the leads to a few mm in length. I cut the right hand lead a bit too long. Bending the leads slightly stops the component falling out when soldering.

© Eugene Brennan
© Eugene Brennan

Soldering the Inserted Component

Again, remember to heat the component leads and melt solder onto board and lead, rather than melting solder onto the iron's tip and letting it flow onto the board.

Hold the tip of the iron against component and board. © Eugene Brennan
Completed joints. Trim any excess lead extending from the joint with a snips. © Eugene Brennan

How to Desolder

Desoldering is the reverse process to soldering, melting the solder on the joint so that wires or components can be removed. Melted solder is sucked up using a desoldering pump or "solder sucker". The pump is primed by pushing down a spring-loaded plunger which has a piston attached. When the trigger button is pressed, the plunger and piston spring back up, sucking molten solder through the nozzle.

  1. Wipe and tin the soldering iron
  2. Push down the plunger of the desoldering pump until it locks into place
  3. Hold the tip of the iron in contact with the joint as well as the nozzle of the pump
  4. Once the solder melts, press the release button on the desoldering pump
  5. Press down the plunger off the pump to expel solder from the nozzle
  6. Remove the component

You may have to repeat this process several times if solder remains and still holds the component. On larger joints with a lot of solder this is usually the case.

Eventually solder can accumulate in the piston of the pump, just above the screw on nozzle. Unscrew the nozzle to remove this. Although nozzles are made from plastic that is heat resistant, they do deform and wear over time, but can be replaced.

Press the release button on the desoldering pump once solder melts. © Eugene Brennan

Lead or Lead-Free Solders?

Lead solder is an alloy of lead and tin, typically with a 60/40 lead/tin composition. It is definitely easier to work with because of its lower melting point and tendency of lead to flow better than tin on its own. Lead is toxic however and lead free solders are mostly tin with addition of other metals such as solver and copper. They do however take a bit of practice getting used to if you haven't soldered before.

Buying a Soldering Iron

weller soldering iron
Image courtesy Amazon.

If you want a soldering iron that'll last, you can't go wrong with Weller. Like all tools, if you buy a professional model, you can get parts when they wear out. Spare parts such as various sizes and styles of tips, handles, elements, thermostats, etc are all available for these irons.

Note that this Weller WE1010 model, available from Amazon is a 120 volt, 70W soldering iron station. If you only want a soldering iron for occasional, hobbyist use, you can search for cheaper options.

This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.

© 2020 Eugene Brennan

Saturday, June 06, 2026

Kippure TV Mast Visible From Kilcullen

Landscpe photo of mountains
Kippure in the Wicklow Mountains, photographed from Kilcullen. © Eugene Brennan

I took this with my 10-year-old Nikon D5300 SLR from St. Brigid's Well on Saturday evening. The second photo below is a crop of the 6000-pixel-wide image. If you have good eyesight, you can see the 127-metre-tall television transmission mast on Kippure on a clear day. It's approximately 7 m taller than the Spire in O'Connell Street in Dublin and located 17.5 miles away from Kilcullen as the crow flies. (I can just about make it out with the naked eye). At night of course it's very noticeable, and the beacons on the mast can be seen flashing in the distance. They used to be red, but they changed them to white at some stage. I've seen the flashing from as far away as Kilmeague.
I haven't figured out why this camera always takes such dull photos. I reckon smartphones must boost the colour saturation, highlights and contrast in images to make them more vivid. I have the setting for this (can't remember what it's called) set as "neutral" in the camera so that images aren't altered. I can always change the settings later during post processing.
Edit: An FB photography group I'm a member of confirms that this is the case and images are flat if neutral photo style is selected. Saving photos as JPGs compresses images and reduces filesize, so I'm going to retake the photo and save as raw to see whether it makes much of a difference as regards detail and artefacts.
A TV mast on a mountain
The TV mast on Kippure (a crop from the image above) © Eugene Brennan

 

Thursday, June 04, 2026

Why Is Most of an Iceberg Under Water? And How Much?

Icebergs floating in the sea
Original uncaptioned image Lurens, public domain image via Pixabay.com

Ninety Percent of an Iceberg Is Below the Waterline

Icebergs can be massive, but did you know that you're only seeing literally the tip of them above the water? Yes, up to 90% of an iceberg's volume can be under water. But why does that amount sink and not just float above sea level like the rest of it? In this article we explore why.

The Archimedean Principle

A body wholly or partially immersed in a fluid experiences an upthrust or buoyant force, equal to the weight of the displaced fluid.

In a previous science tutorial called Archimedes' Principle, Buoyancy Experiments and Flotation Force, we discovered how objects placed in a liquid experience a force called buoyancy.

The Archimedean Principle or Principle of Archimedes simply states that when you put something into a fluid (a fluid can be a liquid like water or gas like air), the force acting upwards on the object equals the weight of fluid that was displaced. Imagine a container full to the brim with water. If something is put into the water in the container, it sinks a bit and floats, totally submerges and floats, or completely sinks to the bottom. The amount of water that flows over the brim is what is displaced. If that water is weighed, it equals the buoyant force pushing up on the object in the water.

Graphic explaining Archimedes' principle
The principle of Archimedes. Buoyant force equals the weight of the displaced liquid. The weight measured by the scales is 6kg less 2 kg = 4 kg. © Eugene Brennan

Working Out the Volume of an Iceberg That's Under the Water

In the image below, we have an iceberg with a lot of its volume under the water. To do the calculations, first let's assign some variables so that we can work out the equations.

V is the total volume of the iceberg

ρi is the density of fresh water ice

ρs is the density of seawater

k is the fraction of the berg that is underwater

g is the acceleration due to gravity

m is the mass of the displaced water

Wd is the weight of displaced water

Wi is the weight of the iceberg

Defining the proportion of an iceberg under the water

Calculations

The total volume of the iceberg is V.

The variable k represents the proportion of the berg that is below the water. k has to be greater than or equal to 0 and less than or equal to 1. In other words, between none and all of the berg lies below the water line. We don't know what k is and it's this variable that we need to work out an equation for.

Calculation of mass of displaced water

The volume of the berg below water = kV
and since the ice displaces its own volume, the volume of displaced water is also kV

The Archimedes Principle tells us that the upthrust or buoyancy force = weight of the displaced water. We need to work out the weight of this water.

We defined a variable ρs as the density of sea water

The volume of the displaced water = the volume of the berg below water = kV

We know that density = mass / volume, so mass = density x volume

So mass of the displaced water m = density of sea water x volume of water displaced.

m = ρskV .......................Eqn (1)

Calculation of weight of displaced water

Now since Archimedes Principle specifies weight, we convert mass to weight by multiplying by the acceleration due to gravity

So weight = mg and substituting for m from Eqn (1), the weight of displaced water

Wd = ρskVg .....................Eqn (2)

Calculation of weight of iceberg

Ice sheets are made from snow that gets packed over long periods of time and converted into ice. Bits of ice eventually break off from the sheets and form floating icebergs. Since icebergs came from snow that originated as water that evaporated off land and sea, they're made of fresh water, not sea water. Pure fresh water has a density of 1 g/cm3. Ice is less dense than water however, because when water freezes, its volume increases. Since density = mass / volume and mass stays the same, but volume increases, density decreases. The density of ice ranges from 0.9167 to 0.9168 g/cm3

Assuming the berg is made of fresh water and its volume is V and the density of fresh water ice is ρi, then the weight Wi of the berg is

Wi = ρiVg .............................Eqn (3)

Forces acting on an iceberg
© Eugene Brennan

Working out k, the proportion of the iceberg under water

Now put Eqn (2) and Eqn (3) together. Since the berg is floating, its weight acting downwards (A in the diagram above) is exactly balanced by the upthrust (force B), which according to the principle of Archimedes equals the weight of the displaced water)

So upthrust = weight of displaced water = Wd 

and 

weight of the iceberg is Wi

So 

Wd = Wi

Substituting for the values of Wd and Wi from Eqn (2) and Eqn (3) gives:

ρskVg = ρiVg

Simplifying by dividing both sides of the equation by Vg gives us

ρsk = ρi

or k = ρi / ρs

So now two things become apparent:

  • The proportion k of the berg below water is independent of the size of the berg.
  • k doesn't depend on the shape of the iceberg.

The proportion of an iceberg below sea level is simply the ratio of the density of fresh water ice to the density of sea water. If the density of ice is 0.9167 g/cm3 and the density of sea water is on average 1.025 g/cm3 . then

k = 0.9167 / 1.025 = 0.89.

So approximately nine tenths or 90% of an iceberg is under water.

How Much of an Iceberg Is Under Water?

Approximately 90% of an iceberg is under water

Why Is Most of an Iceberg Below Water?

We worked out the numbers mathematically above, but intuitively what is the reason? It's simply because the density of freshwater ice is so close to the density of seawater. So a lot of the iceberg has to sink below the surface to create enough displacement to generate the buoyancy force to balance the weight of the berg to keep it afloat.

If the density of ice equalled that of seawater, the berg would have to submerge completely to generate a buoyancy force to keep itself afloat. If the density was higher again (e.g., if it had lots of rock or gravel embedded inside), the weight of the displaced water would be less than the weight of the berg, even if fully submerged, and it would sink. If an object is made of styrofoam (expanded polystyrene), it only has to displace a little water in proportion to its volume to keep itself afloat and most of its bulk will be above water.

What is a Hydrometer?

A hydrometer is a measuring instrument used to measure the density of a liquid. By measuring density, information can be ascertained about the state of a process. For instance, hydrometers are sometimes used to check the concentration of sulphuric acid in a lead acid battery under charge. If the concentration isn't up to a certain level after several hours, it's an indication that the battery has aged and is no longer performing well. Hydrometers are also used in home brewing and wine making to measure alcohol content of the mix.

How Does a Hydrometer Work?

We established that the proportion of an iceberg under water is simply the ratio of the density of the ice in the iceberg to the density of seawater. The formula for proportion applies to all scenarios when an object is placed in another medium, be it liquid or gas. The formula is for volume, but by making a hydrometer cylindrical, the depth the hydrometer sinks to can be made to represent the density of the liquid. A scale on the side of the hydrometer allows density to be read directly.

Disclaimer 

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional.

© 2022 Eugene Brennan

What's the Difference Between Analogue and Digital?

Abstract image showing a screen with waveforem and ones and zeroes
© Eugene Brennan

Analogue vs. Digital

We often hear about analogue and digital in the context of communications, sound recording, cameras, TV, radio, and electronic devices. But what exactly is the difference, and is digital better than analogue? Why has digital replaced analogue in audio, digital imaging, and electronic communication?

In this article, I hope to shed light on the mystery.

How Are Analogue and Digital Displays Used?

Although it has nothing to do with the real distinction between analogue and digital, these terms are often used to refer to the type of displays on clocks, measuring devices, and electronic instruments.

An analogue display usually involves some form of pointer which indicates a value depending on its position or angle on a scale. Examples of analogue displays are traditional watches and clocks, weighing scales, speedometers, and old-style moving coil or moving iron voltmeters and ammeters. See the photos below for examples.

A digital display indicates the value of a parameter directly by actually showing a number. This number can be produced on an LED, LCD, fluorescent, or Nixie tube (cold cathode) display. Even the displays on old-fashioned electromechanical cash registers could be thought of as digital, but the term is usually reserved for electronic devices.

Note: the US English spelling of analogue is "analog".

Examples of Analogue Displays

On an analogue display, the value is indicated by a line or pointer. See the examples of analogue displays in the photos below.

An analogue display
Analogue display alarm clock. Mohylek, public domain via Wikimedia Commons
An analogue display
An analogue speedometer Pexels, public domain image via Pixabay.com
An analogue display
Analogue voltmeter. © Eugene Brennan

Example of a Digital Display

On a digital display, a value is displayed as a series of 1 or more numerical or alphanumerical digits. See the examples of digital displays in the photos below.

A digital display
My vintage 1977 calculator. This has a miniature vacuum fluorescent display. © Eugene Brennan

Analogue and Digital Quantities

Another distinction between analogue and digital is in the field of electronics and signals. In the real world, many varying parameters can be considered analogue. So, for instance, the variation of temperature in a room over time is an analogue quantity, as is the voltage of a battery as it discharges.

The characteristic of an analogue parameter or quantity is that its value varies continuously within a range. So the temperature in a room could vary anywhere between 10 and 20 degrees C.

The state of a light switch is either on or off. This is an example of a digital quantity. The switch doesn't exist in an in-between state; it is either on or off. Digital technology is fundamentally based on this idea of on and off states of "switches".

What Is a Signal?

The function of a signal is to convey information about the behavior of some phenomenon. An example is the output of a temperature sensor which provides information about the temperature in a room.

The fluctuations in light level which travel down fiber optic cables are signals (signals don't have to be electrical). The information could be a telephone conversation, internet data, or a TV program. The state of the switch in the example above, measured over time, can be thought of as a digital signal.

Graphs of analogue and digital signals
Analogue and digital signals. The analogue signal varies continuously over time, the digital single is either "high" or "low". © Eugene Brennan

What Is a Sensor?

A sensor converts a real-world parameter such as temperature, pressure, or light level into a signal. This signal may then get amplified and/or processed before being used for some other purpose. Some examples:

  • In instrumentation, the signal from a sensor could drive a display indicating the value being measured, e.g., speedometer in a vehicle, temperature gauge, or voltmeter
  • In communications, sound or pictures from microphones or cameras are converted to an electrical signal which eventually gets transmitted as radio waves.

How Do Digital Signals Work?

A digital signal has two states or levels, high and low. The signals in a digital computer or instrumentation such as a digital voltmeter are two-state. A computer doesn't understand analogue signal levels and just works on high and low states, effectively ones and zeros.

For a more thorough explanation of this and an explanation of the binary number system, see my article "Why is Binary Used in Computers?"

What Does Sampling Mean?

Sampling is a process that converts a real-world signal to a digital format which can then be processed by a computer, instrumentation, or other digital electronics technology.

Some examples:

  • A digital multimeter (DMM) samples a voltage, converts it to digital, and the digital signals are used to drive a display.
  • An image projected by the lens of a digital camera falls on the CCD (Charged Coupled Device) at the back of the camera. The image is converted to numbers and stored in the camera's flash memory.
  • A scanner scans a document. The resultant image is stored in memory.
  • A sound recording is made. The audio signal is converted to digital and saved on a hard disk or printed onto a CD.

Analogue to Digital Conversion

As digital electronics and computers were developed, applications arose for reading signals from the real world. The process to do this is called sampling, whereby an analogue signal is converted to a binary number understandable by a computer.

A device that does this is called an analogue-to-digital converter (ADC). An ADC measures the level of the analogue signal at regular intervals, known as the sampling frequency. The voltage range over which the ADC works (e.g., 0 to 5V or 0 to 10V) is broken up into equally spaced ranges and a binary number is assigned to each of these ranges.

Each time the ADC samples the signal, it outputs a binary number, representative of the level at the instant of sampling. These numbers can then be stored, used to drive a display, transmitted along a communication line, etc.

For a 3 bit converter (see diagram below), there are 23 = 8 possible binary numbers. In reality, ADC converters have 6, 12, 16, or even 24-bit resolution (16 bit at 44kHz sampling rate is used for CD recordings). Obviously, this means that there are lots more levels, and the converter can resolve more detail in the signal.

A graphic showing the concept of sampling
Sampling an analogue signal. There are 8 possible levels; the converter outputs a 3 bit number depending on the level of the analogue signal. © Eugene Brennan

A to D Converter Resolution

As I mentioned before, A to D converters typically have resolutions of 6 to 16 bits, although 24-bit converters are available.

The number of levels which a converter can resolve is equal to 2n , where n is the number of bits of the converter. So for a 6-bit converter, there are 64 levels and for a 16-bit converter, there are 216 = 65,536 levels.

A converter has an input range over which it works, e.g., 0 to 5 volts, and it is this range that is split up into equal ranges. So to get the most amount of "detail" out of a signal, the signal should span as much of this range as possible.

What analog to digital converter chips look like
An ADC is often an IC (chip) like the ones above. Left image Jon Sullivan, right image Kimmo Palosaari - Images public domain via Wikimedia Commons
Schematic of an ADC integrated circuit
Block diagram of a typical ADC. A start conversion signal initiates a conversion. The ADC generates an end of conversion signal on completion. An 8 bit converter can resolve 2 to the power of 8 = 256 different levels. © Eugene Brennan

Minimum Sampling Frequency of a Waveform: The Nyquist–Shannon Sampling Theorem

The maths behind this theorem is a bit complicated, but basically, it says that the sampling rate of a signal must be at least twice the highest frequency content of the signal.

This is intuitively correct, so, for instance, the slowly changing signal from a temperature sensor in a room would need to be sampled much less frequently than an audio signal from a microphone or video signal from a camera in order to preserve the rapid changes in the signal.

Reproducing a Signal: Digital to Analogue Converter (DAC)

Once a signal has been sampled, several things can be done with it. In the case of instrumentation, e.g., a digital multimeter, data may not need to be stored. Instead, the digital output signal of the ADC drives the display on the instrument (through intermediate driver electronics).

Alternatively, data can be stored in a computer as a set of numbers: in random access memory (RAM ), on a hard drive, or on a CD or DVD. Sometimes a signal which has been sampled and stored must be reproduced. An example of this is an audio recording on a CD. A device called a digital-to-analogue converter (DAC) is used to reproduce the original signal.

The DAC does the same job as the ADC in reverse. Each binary number that was stored during the original recording is input to the DAC at a playback rate equal to the original sampling frequency. The output of the DAC is an analogue voltage level. The signal is then filtered to remove the "staircase" effect due to sampling.

Graphic showing the limitation of low-res sampling
Sampled signal is stored as a set of numbers. When this signal is reconverted back to analogue, filtering must be used to remove the "staircase" effect. © Eugene Brennan

Digital Electronics

Some electronic devices are almost purely digital and don't need to sample analogue signals. An example is a digital watch or clock which makes use of a quartz oscillator. An oscillator is a system that does something at regular intervals, e.g., a swinging pendulum or a flashing light.

The frequency of a quartz oscillator is very stable and has a relatively low sensitivity to temperature, unlike the components of a mechanical clock. The output of the oscillator is a square wave voltage, usually at 32,768 Hz, i.e., a digital signal.

This frequency is a power of 2 and is chosen so that it can be successively divided by 2 by a digital counter to produce a 1-second pulse. Other counters then generate minute and hour outputs every 60 and 3600 seconds for driving the digital display. (Digital quartz watches can also have analogue displays)

Increasing the Signal to Noise Ratio

The process of storing and transmitting data in digital format is, in effect, increasing the signal-to-noise ratio (SNR or S/N). There are no low-level signals, just highs and lows. Digital electronics "decide" whether a bit is high or low depending on whether it is within a high or low band of voltages.

What Are the Advantages of Digital Data?

Once a signal is sampled and the data is converted to a series of numbers in memory, lots of things can be done with it.

  • Data can be stored and copied indefinitely without degradation. This is because numbers in memory or on digital media are stored in binary format as ones and zeros. In memory, electronic switches are either on or off, representing the storage of 1 or 0. This single piece of information is known as a bit.

    On a CD, either a 1 or 0 can be represented by a pit on the surface of the disk. Contrast this with an analogue recording on tape (which could be audio or video). Low-level signals get swamped by noise over time, and noise also gets introduced during the copying process. This also applies to image recording on photographic media, such as a traditional negative.

  • Clearer audio communication. Because digital increases the SNR, radio and telephone communication and radio broadcasts are clearer without the introduction of noise. Increasing the SNR is somewhat similar to the idea of how the phonetic alphabet can be used during radio communication or a telephone call to improve intelligibility. Each letter of a message is represented by a word - (e.g., "Car" as "Charlie - Alpha - Romeo") so that a transmission can be understood.
  • Data can be compressed Since data is stored as numbers, fancy algorithms can be used to compress the data. This is advantageous because data files can be made smaller and require less storage space (think JPEG and MP3 which are formats for storing and compressing images and sound). Digital TV and digital radio also make use of these compression techniques (MPEG 4 compression for TV).

    The radio frequency spectrum is limited, and only so many channels can be squeezed onto the spectrum. Compressing TV signals narrows the required bandwidth for a channel so more channels can be squeezed into a frequency band ( which may be a good or bad idea! It reminds me of Bruce Springsteen's song, "57 Channels and Nothin' On).

What Are the Disadvantages of Digital Data?

  • A decoding device is required. Data that is stored on media is usually compressed, encoded, and formatted in some way. Equipment to read and decode the archived data may not be available in the future. For instance, if you have any 5 1/4 inch floppy disks with data on them, do you still have a computer that can read these disks?

    Yet it is even possible to read the information from books written hundreds of years ago and view the illustrations or view photographs from the mid-nineteenth century. It would also be relatively easy to build a machine that could play early wax cylinder phonographic recordings. This is obviously an issue for archivists of important information.

  • Digital data is not necessarily durable. While digital data on media is theoretically rugged and less likely to be degraded than an analogue recording, in practice, if the media is damaged, it may not be possible to read data (e.g., a seriously scratched CD). However, an analogue tape recording could probably be pieced together and played.

    Similarly, a photograph (a traditional non-digital type, which is, in effect, a two-dimensional, analogue, optical recording) can still be viewed if stained or damaged in some other way. The moral of the story is to always back up your digital data (and back up the backup!)

What Are TTL and CMOS?

TTL (Transistor-Transistor Logic) and CMOS (Complementary Metal Oxide Silicon) are two technologies used to implement switches in the integrated circuits of digital electronic devices. CMOS has the advantage that it is low power which, of course, is important for battery-powered devices.

Digital ICs have input and output pins, and the voltages on these pins are within designed tolerance bands. For instance, if a high output of a TTL chip is connected to the input of another TTL chip, the output voltage must be between 2.7 and 5 volts. Inputs between 2 and 5 volts are interpreted as high.

Similarly, a low output must be between 0 and 0.5 volts, even though anything between 0 and 0.8 is interpreted as low. This means that up to 0.3 volts of noise can be added to a signal without it being misinterpreted.

TTL threshold levels
TTL(Transistor Transistor Logic) is a type of technology used in digital electronics. Output signal levels of TTL ICs must be within the acceptable range of voltages shown above. © Eugene Brennan
High-magnification image of the bumps on a CD
Electron microscope image of a CD. Data is stored as "pits" on the CD. Pits are approximately 100nm deep, 500 nm wide and 850nm to 3.5 microns long. Freiermensch, Creative Commons Attribution 3.0 Unported via Wikimedia Commons

Disclaimer 

This article is accurate and true to the best of the author’s knowledge. Content is for informational or entertainment purposes only and does not substitute for personal counsel or professional advice in business, financial, legal, or technical matters.

© 2014 Eugene Brennan

Comments From Readers 

Tutu on October 03, 2017:

Wow

Beautiful article

It is so helpful

Ronald E Franklin from Mechanicsburg, PA on August 26, 2015:

As a former electrical engineer, the info you cover in this hub was once my everyday bread and butter. Congrats on a good overview.

Eugene Brennan (author) from Ireland on August 27, 2015:

Thanks Ron! Hopefully it should shed some light on the mystery. Often words like "analog", "digital", "RAM", "JPEG" etc are used as buzz words but without any understanding of what they mean.

Writer Fox from the wadi near the little river on February 02, 2014:

Very comprehensive explanation! You are a real expert in this topic and you have explained the differences so well. I think many people will find this article useful, especially students. Enjoyed and voted up!

Eugene Brennan (author) from Ireland on February 02, 2014:

Thanks, glad you liked it and it made sense! As with any of these types of topics, in reality, things can get quite complex because of all the communication protocols, storage formats etc which are involved. The basic concept of analogue and digital however is quite simple.

Tim Anthony on January 30, 2014:

A very nice and informative hub. Consider detailing the digital data transmission over wireless networks like wi-fi and bluetooth. The emerging trends, versions and technologies too.

John MacNab from the banks of the St. Lawrence on January 30, 2014:

Brilliant eugbug. I had just finished asking my electronically knowledgeable wife what the difference was and I didn't understand her answer. Your hub explains it perfectly. Voted up+

Eugene Brennan (author) from Ireland on January 30, 2014:

Thanks John and Tim!

I'll add more info to this hub later, but probably deal with bluetooth, comms and wi-fi in a separate article.

Vodafone Internet Service Down After Thunderstorm

 

Screenshot of an Internet speed test
The Internet was dropping intermittently since the thunderstorm the other night. A Vodafone technician replaced the modem yesterday afternoon, but still no go. Then the service disappeared completely when the technician was still working on it. The issue was raised to a higher level and I spotted an Eir van this morning in Conroy Park, but couldn't see the technician, so I could have a chat and discover what the problem was. I suspect water in junction boxes or electronics fried by a surge due to a lightning strike. Unfortunately Eir won't give any information and Vodafone know nothing. Anyway service is back, but I would have liked to know the cause of the fault. Maybe everyone's on fibre now (which is insensitive to lightning spikes), so I was the only one affected, still using copper to the cabinet. The Vodafone Gigabit Broadband speed of 1,000 Mbps or 1Gbps is unnecessary for most people, despite their hype and marketing, and sales agents trying to push it. A 100 Mbps is service is perfectly adequate unless there are lots of people in a house doing loads of high-throughput, Internet activity. The other issue is when a premises is distant from a cabinet, which reduces the max bitrate sustainable.
I'm getting 96 Mbps now and sometimes the full 100 Mbps service.
You can check whether your ISP is giving you what you pay for using the website Fast.com or other similar sites.

Tuesday, June 02, 2026

Why Is Binary Used in Electronics and Computers?

Abstract image with magnifying glass and series of ones and zeroes, representing binary

Why is binary used in electronics? Geralt via Pixabay.com

Why Do Computers Use Binary?

The binary numbering system is the basis for the storage, transfer and manipulation of data in computer systems and digital electronic devices. This system uses base 2 rather than base 10, which is what we are familiar with for counting in everyday life. By the end of this easy-to-understand article, you'll have a grasp of why binary is used in computers and electronics.

What Is Decimal and Why Do We Use It?

Before we learn about binary, let's start with decimal.

The decimal, base 10 or denary numbering system is what we are familiar with in everyday life. It uses 10 symbols or numerals. To count, we go:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ...

... But there's no numeral for the next number, the integer value we interpret as "ten". Ten is therefore represented by two digits: the numeral 1 followed by 0, so ten is represented as "10", which really means "one ten and no units". Similarly, one hundred is represented by three digits: 1, 0 and 0; i.e., one hundred, no tens and no units".

Basically, numbers are represented by a series of numerals in the units, tens, hundreds, thousands place etc. For instance, 134 means one hundred, three tens and four units. The decimal system probably arose because we have 10 fingers on our hands, which could be used for counting.

Abstract image with a series of ones and zeroes, representing binary
Public domain image via Pixabay

What Is Binary and How Does It Work?

The binary system used by computers is based on two numerals: 0 and 1. So you count:

0, 1

... But there's no numeral for 2. So 2 is represented by 10 or "one 2 and no units". In the same way that there is a units, tens, hundreds, and thousands place in the decimal system, in the binary system, there is a units, twos, fours, eights, sixteens place etc. in the binary system. So the binary and decimal equivalents are as below:

  • 00000000 = 0
  • 00000001 = 1
  • 00000010 = 2
  • 00000011 = 3
  • 00000100 = 4
  • 00000101 = 5
  • 00000110 = 6
  • 00000111 = 7 (and so on)
Animated image showing a counter counting in binary

Counting in binary from 0 to 11111 = 31 decimal. Ephert, CC by SA 4.0 via Wikimedia Commons

Digital chips on a printed circuit board

A printed circuit board (PCB) with digital integrated circuits (ICs or "chips"). Olafpictures, public domain image via Pixabay.com

Why Do Computers Use Binary?

"A single switch can be on or off, enabling the storage of 1 bit of information. Switches can be grouped together to store larger numbers. This is the key reason why binary is used in digital systems."

How Is Binary Used in Digital Computers and Electronic Devices?

Numbers can be encoded in binary format and stored using switches. The digital technology which uses this system could be a computer, calculator, digital TV decoder box, cell phone, burglar alarm, watch etc. Values are stored in binary format in memory, which is basically a bunch of electronic on/off switches.

Imagine if you had a bank of 8 rocker switches, just like in the image below. Each switch could represent 1 or 0, depending on whether it is turned on or off. So you think of a number and set the switches on or off to "store" the binary value of this number. If someone else then looked at the switches, they could "read" the number.

A bank of eight rocker switches illustrating concept of binary
8 bit “memory” made from a gang of rocker switches. Conceptual idea of how the state of a bank of eight switches allows the "storage" of 2 to the power of 8 = 256 possible numbers. © Eugene Brennan

How Does a Computer Implement Switches

So how does a computer store binary numbers? Obviously, banks of rocker switches would be ridiculously impractical (although a similar technique was used in early computers when programming) In a computer, switches are implemented using microminiature transistors.

The smallest memory configuration is the bit, which can be implemented with one switch. If 8 switches are added together, you get a byte. The digital hardware is able to set the switches on and off (i.e. write data to a byte) and also read the state of the switches. In the conceptual image of rocker switches we saw above, there are 8 switches and 28 = 256 permutations or arrangements depending on whether a switch is on or off. If on represents 1 and off represents 0 for each switch, the group of switches can represent any of the following values.

  • 00000000 0 decimal
  • 00000001 1 decimal
  • 00000010 2 decimal
  • 00000011 3 decimal
  • 00000100 4 decimal
  • ...
  • 11111110 254 decimal
  • 11111111 255 decimal

In an electronic device or computer, because of micro-miniaturisation, billions of switches can be incorporated into integrated circuits (IC), potentially allowing the storage and manipulation of huge amounts of information.

Binary and Decimal Equivalents

Binary and Decimal Equivalents
BinaryDecimal
00
11
102
113
1004
1015
1106
1117
10008
10019
101010
101111
110012
110113
111014
111115
1000016

Representing Non-Integer Values in Computer Systems

Integers can be stored and processed directly as their binary equivalents in computer systems; however, this isn't the case with other data. A machine such as a computer, digital camera, scanner etc., cannot directly store decimals, non-numerical (text, image, video) or analogue measurement data from the real world directly. This type of data could be:

  • Person's name or address
  • Temperature measured in a room
  • Image from a digital camera or scanner.
  • Audio
  • Video
  • Decimal number

Representing Data in Floating Point Format

Decimal numbers are represented in computer systems using a system known as floating point. A decimal number can be represented approximately, to a certain level of accuracy by an integer significand multiplied by a base, raised to the power of an integer exponent.

Processing and Storage of Analogue Data

A voltage level from a temperature sensor is an analogue signal and has to be converted to a binary number by a device called an analogue-to-digital converter (ADC). These devices can have various resolutions, and for a 16 bit converter, the signal level is represented by a number from 0 to 216 = 65535. ADCs are also used in image scanners and digital cameras—electronic equipment used to record sound and video and basically any digital device that takes input from a sensor. An ADC converts a real-world analogue signal into data that can be stored in memory. Images created in a CAD drawing package are also broken down into individual pixels, and a byte of data is used for the red, green and blue intensity levels of each pixel.

Graphs showing analog and digital signals
Digital signals in electronic circuitry are either high or low, representing a "1" or "0". © Eugene Brennan

Encoding Text Data as ASCII

Names, addresses or other text entered into a computer can't be stored directly in computer memory. Instead the text is broken down into individual letters, numerals and other non alphanumeric characters (e.g., &*£$# etc) and a coding system called ASCII represents each character by a number from 0 to 127. This data is then stored in binary format as one or more bytes in memory, each byte being made up of individual bits, and each bit implemented using transistors.

ASCII Table Hex, Binary and Decimal Values

Table showing ASCII characters with their hexadecimal, binary and decimal values. Hexadecimal or "hex" is a convenient way of representing a byte or word of data. Two characters can represent 1 byte of data.

A table showing ASCII characters and their values in decimal, binary and hexadecimal
ASCII code table. ASCII assigns a number from 0 to 127 to letters, numbers, non alphanumeric characters and control codes. Public domain image via Wikimedia Commons

What Is Machine Code and Assembly Language?

Not only are values or data stored in memory, but also the instructions which tell the microprocessor what to do. These instructions are called machine code. When a software program is written in a high level language such as BASIC, Java or "C", another program called a compiler breaks the program down into a set of basic instructions called machine code. Each machine code number has a unique function which is understood by the microprocessor. At this low level, instructions are basic arithmetic functions such as add, subtract and multiply involving the contents of memory locations and registers (a cell which can have arithmetic operations carried out on it). A programmer can also write code in assembly language. This is a low level language comprising instructions known as mnemonics which are used to move data between registers and memory and perform arithmetic operations.

How to Convert Decimal to Binary and Binary to Decimal

This tutorial explains how to convert decimal to binary and binary to decimal.

George Boole and Boolean Algebra

Boolean algebra, developed by the British mathematician George Boole in the 19th century, is a branch of mathematics which deals with variables which can only have one of two states, true or false. In the 1930s, Boole's work was discovered by the mathematician and engineer Claude Shannon, who realised it could be used to simplify the design of telephone switching circuits. These circuits originally used relays which could be either on or off, and the desired output state of the system, depending on the combination of states of the inputs, could be described by a Boolean algebraic expression. Boolean algebra rules could then be used to simplify the expression, resulting in a reduction of the number of relays required to implement a switching circuit. Eventually Boolean algebra was applied to the design of digital electronic circuitry as we will see below.

Digital Logic Gates: AND, OR and NOT

A digital state, ie high/low or 1/0 can be stored in a one-bit cell in memory, but what if that data has to be processed? The most basic processing element in a digital electronic circuit or computer is a gate. A gate takes one or more digital signals and generates an output. There are three types of gates: AND, OR and NOT (INVERT). In their simplest form, small groups of gates are available on a single IC. However, a complex combinational logical function can be implemented using a Programmable Logic Array (PLA) and more sophisticated devices such as microprocessors are composed of millions of gates and memory storage cells.

  • For an AND gate, the output is true or high only when both inputs are true.
  • For an OR gate, the output is high if either or both inputs are true.
  • For a NOT gate or inverter, the output is the opposite state to the input.

Boolean algebraic expressions can be used to express what the output signal of a circuit should be, depending on the combination of inputs. The main operations in Boolean algebra are and, or and not. During a design process, the required value of an output for all the various permutations of input states can be tabulated in a truth table. The value '1' in the truth table means an input/output is true or high. The value '0' means the input/output is false or low. Once a truth table is created, a Boolean expression can be written for the output, simplified and implemented using a collection of logic gates.

So a typical Boolean expression with three independent variables A, B and C and one dependent variable D would be:

Y = A.B + C

This is read as "Y = (A and B) or C"

Diagram showing Digital AND, OR and NOT gates and a truth table
Logic gates, AND, OR and NOT and their truth tables. © Eugene Brennan
A simple digital schematic, with its truth table
Truth table for a simple digital circuit. Y = A.B + C © Eugene Brennan

Disclaimer

This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualised advice from a qualified professional.

© 2012 Eugene Brennan

×

Posts by Category