Posts | Comments

Planet Arduino

Archive for the ‘4066’ Category

[Aguilera Dario] likes his Casio fx-82ES calculator. However, it was missing a few functions, including complex numbers. A Casio fx-991ES has more functions but, of course, costs more. A quick Google revealed that if you press the right buttons, though, you can transform an fx-82ES into an fx-991ES.

Because it is apparently a buffer overflow exploit, the hack involves a lot of keys and once you cycle the power you have to do it again. [Aguilera] realized this would be a good candidate for automation and added a microcontroller to push his buttons. You can see a video of a breadboard version below. He also has a PCB version in the works that should be better integrated.

The automation hardware patches into the button matrix through test pads on the back of the calculator’s PCB. [Aguilera] soldered ribbon cable directly to these pads, then snaked it out through a slot cut into the back of the calculator case where it is terminated with a 0.1″ pin socket. An Arduino Mini is used in the prototype, the next revision will use an ATmega328P on a custom board. The uC interfaces with the button connections using the venerable 4066 chip which is able to act as an analog switch.

The board layout for the PCB version is shown on the project page. There is no word on whether this is meant to be a permanent addition to the calculator, or just plugged in for the exploit and stored away for use the next time power is cycled. Either way, it’s neat to learn about this exploit and a cool challenge to automate it!

If you don’t want to hack up an off-the-shelf calculator, grab some nixie tubes and make your own. Or, if you are short on tubes, try this one.


Filed under: Arduino Hacks

Hello readers!

Today we are going to examine the 74HC4066 quad bilateral switch IC. My reason for writing this comes from a comment left by a reader on chapter nine of the Arduino tutorial. They suggested using a 4066 IC to control the cathodes of the LED matrix instead of resistors and NPN transistors. This was a good suggestion, however the 4066 can only switch a current of 10mA per pin. Luckily the 74HC4066 can handle up to 25mA per switch – so we’ll look into this instead.

First of all, let’s say hello:

This is the 14-pin DIP package. It is also available in surface mount, and other newer package styles. Although we are looking at an example from NXP, according to my main component supplier (Farnell/Newark) this IC is also manufactured by Texas Instruments, ON Semi, ST Microelectronics and Fairchild.

So, what is a quad-bilateral switch? Four switches in one IC. Here is a diagram:

Imagine a simple normally-open push button. You press the button, and current can flow through the switch. Using the 74HC4066, when current is applied to the E pin, current can pass through from the matching Y pin to the Z pin. As you can see above, there are four of these switches in the IC. This is where the benefit of the IC comes to mind, normally one might use a 1k ohm resistor and an NPN switching transistor as an electronic switch, and I have done so myself. But when you need a few of them, it can be easier to start using these 74HC4066s as long as the current requirements are met.

With regards to the current the IC can switch, Is, the maximum is 25mA per switch. This is more than enough to run a typical LED, TTL logic gate, etc. The other interesting parameter is the turn-on and turn off times – at 6 volts it can turn on in around 10 nanoseconds and turn off at around 13 nanoseconds (so a rough calculation – say it takes 30 nanoseconds to switch on and then switch off, that’s 33.3 million times per seconds (33.3 MHz). All these parameters and more are available from the data sheet (pdf). Someone correct me if I’m wrong!

That’s enough theory – let’s put it to work now. Our first demonstration is quite simple – just switch on and off some LEDs via a 74HC595 shift register and an Arduino. We send a number (0, 1, 2, 4, 8 ) to the shift register, which stays off, then sets pins Q0, Q1, Q2, Q3 high in order, which in turn activate the switches 1~4 on the 74HC4066. The 74HC4066 sends a current to each LED connected to the switch outputs.

Here is the schematic:

Laid out on the breadboard:

And the ubiquitous video:

And here is the Arduino sketch: demo1.pdf. Well that was interesting. I know these simple demonstrations may be… well a little simple, but after taking the time to build them from scratch you get a better understanding of the part and how they work. Practice makes perfect and all that. Anyhow, let’s have a look at something much more interesting – a very basic (!) digital to analogue converter. Consider the circuit below:

The 74HC4066 switches creates a final voltage through the sum of various currents being switched into the final output. First of all, here is a video of the switches being turned on and off one at a time:

and the corresponding Arduino sketch:demo2.pdf. The next video shows the results of sending decimal numbers 0~15 to the shift register – in effect continually adding the outputs of the pins until all pins are on, then in reverse:

and the corresponding Ardiono sketch:demo3.pdf.

Well I hope you found this part review interesting, and helped you think of something new to make. In conclusion I would consider the 74HC4066 easier and quicker for end user to use in projects (less pins to solder, etc) however using it could cost more depending on the volume required. Furthermore, this would only apply if the current restrictions of the IC are met.

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 new Google Group. High resolution photos are available on flickr.

Otherwise, have fun, be good to each other – and make something! :)

Notes: In writing this post, I used information from NXP, plus information and circuit inspiration from various books by Forrest Mims III.

Thank you!




  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook