Tag Archive | "part"

Tutorial – 74HC4067 16-Channel Analog Multiplexer Demultiplexer


Now and again there’s a need to expand the I/O capabilities of your chosen micorocontroller, and instead of upgrading you can often use external parts to help solve the problem. One example of this is the 74HC4067 16-channel analog multiplexer demultiplexer. That’s a mouthful – however in simple form it’s an IC that can direct a flow of current in either direction from one pin  to any one of sixteen pins. Another way to think abou it is that you can consider the 74HC4067 to be a digital replacement to those rotary switches that allow you to select one of sixteen positions.

Here’s an example of the SMD version:


Don’t let that put you off, it’s just what we had in stock at the time. The part itself is available in through-hole and surface mount versions.

Using the 74HC4067

At this point you should download the data sheet, as we refer to it through the course of the article. The first thing to note is that the 74HC4067 can operate on voltages between 2 and 6V DC, which allows use with 3.3V and 5V microcontrollers and boards such as Arduino and Raspberry Pi. If for some reason you have the 74HCT4067 it can only work on 4.5~5.5V DC.  Next – consider the pinout diagram from the data sheet:

74HC4067 pinoutThe power supply for the part is applied to pin 24, and GND to … pin 12. Pin 15 is used to turn the control the current flow through the inputs/outputs – if this is connected to Vcc the IC stops flow, and when connected to GND it allows flow. You can always control this with a digital output pin if required, or just tie it to GND if this doesn’t matter.

Next – pin one. This is where the current either flows in to be sent to one of the sixteen outputs – or where the current flows out from one of the sixteen inputs. The sixteen inputs/outputs are labelled I0~I15. Finally there are the four control pins – labelled S0~S3. By setting these HIGH or LOW (Vcc or GND) you can control which I/O pins the current flow is directed through. So how does that work? Once again – reach for the the data sheet and review the following table:

74HC4067 truth tableNot only does it show what happens when pin 15 is set to HIGH (i.e. nothing) it shows what combination of HIGH and LOW for the control pins are required to select which I/O pin the current will flow through. If you scroll down a bit hopefully you noticed that the combination of S0~S3 is in fact the binary equivalent of the pin number – with the least significant bit first. For example, to select pin 9 (9 in binary is 1001) you set the IC pins S0 and S3 to HIGH, and S1 and S2 to LOW. How you control those control pins is of course up to you – either with some digital logic circuit for your application or as mentioned earlier with a microcontroller.


Apart from the power supply requirements, there are a few limitations to keep in mind. Open you data sheet and consider the “DC Electrical Specifications” table. The first two parameters show what the minimum voltage that can be considered as a HIGH and the maximum for a LOW depending on your supply voltage. The next item of interest is the “ON” resistance – that is the resistance in Ohms (Ω) between one of the sixteen inputs/outputs and the common pin. When a channel is active, and a 5V supply voltage, we measured a resistance of 56Ω without a load through that channel – and the data sheet shows other values depending on the current load and supply voltage. Finally, don’t try and run more than 25 mA of current through a pin.


Now to show an example of both multiplexing and demultiplexing. For demonstration purposes we’re using an Arduino Uno-compatible board with the 74HC4067 running from a 5V supply voltage. Pin 15 of the ‘4067 is set to GND, and control pins S0~S3 are connected to Arduino digital output pins D7~D4 respectively.


This is where we select one input pin of sixteen and allow current to flow through to the common pin (1). In this example we connect the common pin to the board’s analog input pin – so this can be used as a method of reading sixteen analog signals (one at a time) using only one ADC. When doing so – take note of the limitations mentioned earlier – take some resistance measurements in your situation to determine what the maximum value will be from your ADC and calibrate code accordingly.

With both of the examples we’ll use port manipulation to control the digital pins which are connected to the 74HC4067’s control pins. We do this as it reduces the code required and conceptually I feel it’s easier. For example – to select I/O 15 you need to turn on all the control pins – so you just have to set Arduino PORTD to B11110000 (which is binary 15 LSB first) and much neater than using four digitalWrite() functions.

In the following example sketch, you can see how we’ve put the binary values for each control possibility in the array byte controlPins[] – which is then used to set the pins easily in void loop().

This simply sets each input pin in turn, then reads the ADC value into an array – whose values are then sent to the serial monitor:

… and a quick video of the results:


Now for the opposite function – sending current from the common pin to one of sixteen outputs. A fast example of this is by controlling one of sixteen LEDs each connected to an output pin, and with 5V on the 74HC4067 common pin. We don’t need current-limiting resistors for the LEDs due to the internal resistance in the 74HC4067. Here’s the sketch:

… and the LEDs in action:


If you’re considering the 74HC4067 or hadn’t known about it previously, we hope you found this of interest. If you have any questions please leave them below or privately via the contact page. And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.


Posted in 74HC4067, arduino, Demultiplexer, Multiplexer, part review, review, tronixstuff, tutorialComments (13)

Initial review: Hakko FX-888 Soldering Station


During many years of orbiting around the world of electronics and related fields, soldering was not really one of my strong points. After moving more seriously into this field it occurred to me that my choice of soldering weapons played a part in the end results. So a few days ago I pulled the trigger and ordered my first “real” station – the Hakko FX-888.


After waving goodbye to the courier and opening the delivery carton, the following was presented:

Frankly it’s only a box and shouldn’t matter, but you can appreciate the effort involved from a retail perspective. Opening up we find a neatly and safely packaged station with the multilingual instructions on top:

Everything is included to get going without any surprises. The station itself:

This is quite solid and weighty – at 1.3kg, so will not be moved by accident. The colours are quite snazzy and in some markets you can choose different colour schemes. According to Hakko – this is a “High-performance soldering iron that, in the pursuit both “usability” and “appearance”, has evolved beyond being a mere working tool”…

As you can see the temperature can be adjusted between 200 and 480 degrees Celsius. There is a calibration adjustment below the temperature knob, and the tool for calibration (“thermal correction”) is hidden away underneath the station:

You can also see the power switch on the right-hand side of the unit (when positioned normally). A tiny Allen key is included which is used to lock the temperature control to a desired position, however there isn’t a spot to keep it – so for now I have used (once again) some blu-tac to stick it under the base (not shown in photograph). Finally there is one red LED above the Hakko logo which lights when the heater is on – however it turns off once at the required temperature.

Next we have the soldering iron with fixed lead to the station:

This is a very light iron – for me the lightest so far, with a weight of 44 grams excluding the cord. The iron ships with a 0.5mm conical tip (type T18-B) that is fine for normal through-hole work, however there are sixteen different tips available from Hakko. What took me by surprise is the flexibility of the cord bushing, no matter which direction you turned the iron in your hand – there was hardly if any at all resistance from the cord. When changing tips be careful when unscrewing the nut, it is easy to unscrew the handle instead.

Finally we have the iron holder and parts:

The holder is made from metal, although it may not look so in the image. There is space for the included sponge and brass cleaning wire. You can also use the rubber cleaner (the grey/green lip) for cleaning as well. You can fit a large cleaning wire in the holder, however only small amount is presented at any one time, so you will need to rotate it now and again by opening the bottom of the holder which reveals the wire space.


For those who like the numbers, here they are:

  • Station power consumption – 70W
  • Temperature range – 200~480 degrees Celsius
  • Temperature stability – +/- 1 degree Celsius at idle temperature
  • Iron power consumption – 65W at 26V AC
  • Cord length – 1.2m
  • Tip to ground resistance – 2Ω

The system is designed to protect against anti-static discharge, and the handle and other parts are conductors – not insulators. For more details please see the Hakko website.

Other observations

The reheating speed is excellent, the iron can reach any selected temperature in less than sixty seconds. This also helps avoid cold joints by recovering from temperature loss at a rapid rate. Furthermore having such a light iron without the burden of an AC lead at the back allows much more tip control and reduces wrist and muscle fatigue over long sessions.

Finally, the user manual includes exploded diagrams for all parts and the matching part numbers, which tells me Hakko want this station to last and are happy for you to maintain it yourself. Unlike using my older iron, I am sure with extended use the FX-888 will be less of a physical drain and also help improve my confidence in soldering.

Dave Jones from eevblog.com has described a modification to the FX-888 that allows an LED to show when the iron is on, not just heating. (Note that this voids your warranty):


Although the FX-888 is not inexpensive, it is very easy to use and light-years ahead of using a normal hand-held soldering iron. If you are finding yourself doing more soldering than the occasional hobbyist or are looking to work with a wide variety or components and soldering joints then you could do a lot worse than considering the FX-888. At this juncture it was not the cheapest, however I feel it was a solid investment and will last me a long time. And here it is, ready for work:

The Hakko FX-888 Soldering Station is available worldwide. Residing in Australia I purchased mine from element14.

Disclaimer – The items in this review were purchased by myself and reviewed without notifying the manufacturer or retailer. 

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Posted in fx-888, hakko, review, solderingComments (23)

The 555 Precision Timer IC

Learn about the useful and inexpensive 555 timer IC in this detailed tutorial!

Hello readers

Today we revisit one of the most popular integrated circuits ever conceived – the 555 timer IC. “Triple-five”, “five-five-five”, “triple-nickel” … call it what you will, it has been around for thirty-eight years. Considering the pace of change in the electronics industry, the 555 could be the constant in an ever-changing universe. But what is the 555? How does it work? How can we use it? And … why do we still use it? In this introductory article we will try to answer these questions. If you would like to see some examples, visit here.

What is the 555?

The 555 timer is the solution to a problem found by the inventor – Hans Camenzind.  He saw the need through his radio work for a part that could act as an oscillator or a timer [1]; and working as a contractor for Signetics developed the 555. (Signetics was purchased by Philips in 1975, and their semiconductor division was spun off as NXP in 2006). The 555 has to be one of the most used ICs ever invented. It is used for timing, from microseconds to hours; and creating oscillations (which is another form of timing for the pedants out there). It is very flexible with operation voltage, you can throw from 4.5 to 18V at it; you can sink or source 200mA of current through the output; and it is very cheap – down to around nine cents if you order several thousand units. Finally, the 555 can achieve all of this with a minimum of basic components – some resistors and capacitors.

Here are some examples in the common DIP casing:


Furthermore a quick scan of suppliers’ websites show that the 555 is also available in surface-mount packages such as SOIC, MSOP and TSSOP. You can also source a 556 timer IC, which contains two 555 ICs. (What’s 555 + 555? 556…) Furthermore, a 558 was available in the past, but seems rather tricky to source these days.


How does the 555 work?

The 555 contains two major items:

  • A comparator – a device which compares two voltages, and switches its output to indicate which is larger, and
  • A flip-flop – a circuit that has two stable states, and those states can be changed by applying a voltage to one of the flip-flop’s inputs.

Here is the 555 functional diagram from the TI 555 data sheet.pdf:


… and the matching pin-out diagram:

Don’t let the diagrams above put you off. It is easier to explain how the 555 operates within the context of some applications, so we will now explore the three major uses of the 555 timer IC in detail – these being astable,  monostable, and bistable operations, in theory and in practice.

Astable operation

Astable is an on-off-on… type of oscillation – and generates what is known as a square wave, for example:


There are three values to take note of:

  • time (s) – the time for a complete cycle. The number of cycles per second is known as the frequency, which is the reciprocal of time (s);
  • tm (s) – the duration of time for which the voltage (or logic state) is high;
  • ts (s) – the duration of time for which the voltage (or logic state) is low.

With the use of two resistors and one capacitor, you can determine the period durations. Consider the following schematic:


Calculating values for R1, R2 and C1 was quite simple. You can either determine the length of time you need (t) in seconds, or the frequency (Hz) – the number of pulses per second.

t (time) = 0.7 x (R1 + [2 x R2]) x C1

f (frequency) = 1.4 / {(R1 + [2 x R2]) x C1}

Where R1 and R2 are measured in ohms, and C1 is measured in farads. Remember that 1 microfarad = 1.0 × 10-6 farads, so be careful to convert your capacitor values to farads carefully. It is preferable to keep the value of C1 as low as possible for two reasons – one, as capacitor tolerances can be quite large, the larger the capacitor, the greater your margin of error; and two, capacitor values can be affected by temperature.

How the circuit works is relatively simple. At the time power is applied, the voltage at pin 2 (trigger) is less than 1/3Vcc. So the flip-flop is switched to set the 555 output to high. C1 will charge via R1 and R2. After a period of time (Tm from the diagram above) the voltage at pin 6 (threshold) goes above 2/3Vcc. At this point, the flip-flop is switched to set the 555 output to low. Furthermore, this enables the discharge function – so C1 will discharge via R2. After a period of time (Ts from the diagram above) the voltage at pin 2 (trigger) is less than 1/3Vcc. So the flip-flop is switched to set the 555 output to high… and the cycle repeats.

Now, for an example, I want to create a pulse of 1Hz (that is, one cycle per second). It would be good to use a small value capacitor, a 0.1uF. In farads this is 0.0000001 farads. Phew. So our equation is 1=1.4/{(R1 + [2 x R2]) x C1}. Which twists out leaving us R1=8.2Mohm, R2=2.9MOhm and C1 is 0.1uF. I don’t have a 2.9MOhm resistor, so will try a 2.7MOhm value, which will give a time value of around 0.9s. C2 in astable mode is optional, and used if there is a lot of electrical noise in the circuit. Personally, I use one every time, a 0.01uF ceramic capacitor does nicely. Here is our example in operation:

Notice how the LED is on for longer than it is off, that is due to the ‘on’ time being determined by R1+R2, however the ‘off’ time is determined by R2 only. The ‘on’ time can be expressed as a percentage of the total pulse time, and this is called the duty cycle. If you have a 50% duty cycle, the LED would be on and off for equal periods of time. To alter the duty cycle, place a small diode (e.g. a 1N4148) over pins 7 (anode) and 2 (cathode). Then you can calculate the duty cycle as:

Tm = 0.7 x R1 x C1 (the ‘on’ time)

Ts = 0.7 x R2 x C1 (the ‘off’ time)

Furthermore, the 555 can only control around 200mA of current from the output to earth, so if you need to oscillate something with more current, use a switching transistor or a relay between the output on pin 3 and earth. If you are to use a relay, put a 1N4001 diode between pin 3 (anode) and the relay coil (cathode); and a 1N418 in parallel with the relay coil, but with the anode on the earth side. This stops any reverse current from the relay coil when it switches contacts.

Monostable operation

Mono for one – one pulse that is. Monostable use is also known as a “one-shot” timer.  So the output pin (3) stays low until the 555 receives a trigger pulse (drop to low) on pin 2. The length of the resulting pulse is easy to calculate:

T = 1.1 x R1 x C1;

where T is time in seconds, R1 is resistance in ohms, and C1 is capacitance in farads. Once again, due to the tolerances of capacitors, the longest time you should aim for is around ten minutes. Even though your theoretical result for T might be 9 minutes, you could end up with 8 minutes 11 seconds. You might really need those extra 49 seconds to run away…  Though you could always have one 555 trigger another 555… but if you were to do that, you might as well use a circuit built around an ATmega328 with Arduino bootloader.

Now time for an example. Let’s have a pulse output length of (as close as possible to) five seconds. So, using the equation, 5 = 1.1 x R1 x C1… I have a 10 uF capacitor, so C1 will be 0.00001 farads. Therefore R1 will be 454,545 ohms (in theory)… the closest I have is a 470k, so will try that and see what happens. Note that it you don’t want a reset button (to cancel your pulse mid-way), just connect pin 4 to Vs. Here is the schematic for our example:


How the monostable works is quite simple. Nothing happens when power is applied, as R2 is holding the trigger voltage above 1/3Vcc. When button S1 is pushed, the trigger voltage falls below 1/3Vcc, which causes the flip-flop to set the 555’s output to high. Then C1 is charged via R1 until the threshold voltage 2/3Vcc is reached, at which point the flip-flip sets the output low and C1 discharges. Nothing further happens until S1 is pressed again. The presence of the second button S2 is to function as a reset switch. That is, while the output is high the reset button, if pressed, will set the output low and set C1 to discharge.

Below is a video of my example at work. First I let it run the whole way through, then the second and subsequent times I reset it shortly after the trigger. No audio in clip:

Once again, we now have a useful form of a one-shot timer with our 555.

Bistable operation

Bistable operation is where the 555′s output is either high, or low – but not oscillating. If you pulse the trigger, the output becomes and stays high, until you pulse reset. With a bistable 555 you can make a nice soft-touch electronic switch for a project… let’s do that now, it is so simple you don’t need one of my quality schematics. But here you are anyway:


In this example. pressing S1 sets the voltage at pin 2 (trigger) to below 1/3Vcc, thereby setting the output to high – therefore we call S1 our ‘on’ switch. As pin 6 (threshold) is permanently connected to GND, it cannot be used to set the output to low. The only way to set the output back to low is by pressing S2 – the reset button, which we can call the ‘off’ switch. Couldn’t be easier, could it? And that output pin could switch a transistor or a relay on or off, who knows? Your only limit is your imagination. And here’s one more video clip:

And there you have it – three ways in which we can use our 555 timer ICs. But in the year 2011, why do we still use a 555? Price, simplicity, an old habit, or the fact that there are so many existing designs out there ready to use. There will be many arguments for and against continued use of the 555 – but as long as people keep learning about electronics, the 555 may still have a long and varied future ahead of it.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.


[1] “The 555 Timer IC – An interview with Hans Camenzind” (Jack Ward – semiconductormuseum.com)

Various diagrams and images from the Texas Instruments NE555 data sheet.

Posted in 555, clocks, COM-09273, electronics, LCD, lesson, tronixstuff, tutorial, xbeeComments (16)

Part review – Linear Technology LTC6991 “Timerblox” low frequency oscillator

Hello Readers

Time for a new component review – the Linear Technology LTC6991 low frequency oscillator. This is part of Linear‘s Timerblox series of tiny timing devices. The full range is described on their web site. It is available in DFN or SOT-23 (below)  packaging. Our example for today:

The graph paper in the image is 5mm square, so the IC itself is tiny yet worthwhile challenge. Although reading the data sheet may convince you it is a difficult part to use, it is actually quite simple. This article will give you the “simple way”. Once again I have lashed out and will hand-solder an SMD onto a SOT-23 board:

Messy, but it works. Moving along…

My reason for examining the LTC6991 was as a lower-power substitute to using a 555 timer to create a square wave at various frequencies. Normally I wouldn’t give two hoots about the current draw, as everything on my bench is powered from a lab supply.

However when designing things for external use, they are usually powered by a battery of some sort or solar – so the less current drawn the better. The bog-standard TI NE555 has a current draw (with output high) of between two and five milliamps (at 5V). Which doesn’t sound like much – but our 6991 is around 100 to 170 microamps at 5V. These figures are for the respective timers without an output load. You can source up to 20mA from the output of the 6991, and when doing so will naturally increase the current load – but still it will be less than our triple-nickel.

The LTC6991 offers a period range of 1 millisecond to 9.5 hours; which translates to a frequency range of 29.1 microhertz to 977 Hz, with a maximum frequency error or <1.5%. Only one to three external resistors are required to setup your timing requirements. For a more detailed explanation, please see the data sheet.pdf. The duty cycle defaults to 50% however this can be altered by using the IC in voltage-controlled period mode.

Linear have made using the IC very easy by providing an Excel spreadsheet you can use to make your required calculations, available from this page. For example, to create a 1 Hz oscillator, we enter our figures in as such:

and the macro returns the following details:


Very convenient – a schematic, the required resistors, and example timing diagram. I recreated this example, however not having the exact values in stock caused a slight increase in frequency – with Rset at 750k,  Rdiv1 at 910k and Rdiv2 at 180k my frequency was 3.1 Hz. Therefore to match the accuracy of the LTC6991 you need to ensure a your external components are close to spec and a very low tolerance. It produces a good square-wave:


If you cannot use the exact resistor values recommended, use resistors in series or parallel to achieve the desired values. Don’t forget to measure them in real life if possible to ensure your accuracy does not suffer.

Pin one (RST) can be left floating for nomal oscillation, when high it resets the IC and forces output (pin six) low. As you can see, it is very simple to use especially with the provided spreadsheet. The required formulae are also provided in the data sheet if you wish to do your own calculations. Pulse width can be controlled with a fourth resistor Rpw, and is explained on page sixteen of the data sheet.

Although physically it may be difficult to use as it is SMD, the power requirements and the ability to generate such a wide range of oscillations with so few external parts makes the LTC6991 an attractive proposition.

The LTC6991 and the Timerblox series are new to market and should be available from the usual suppliers in the very near future such as RS and element-14.

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our Google Group.

[Note – The LTC6991was a personally-ordered sample unit from Linear and reviewed without notification]

Posted in education, LTC6991, part review, tutorialComments (4)

Subscribe via email

Receive notifications of new posts by email.

The Arduino Book

Arduino Workshop

Für unsere deutschen Freunde

Dla naszych polskich przyjaciół ...

Australian Electronics!

Buy and support Silicon Chip - Australia's only Electronics Magazine.

Use of our content…

%d bloggers like this: