Bus Pirate Necktie Clip Case

Last year, I got Bus Pirate kit from Dangerousprototypes as a prize for last year 7400 competition. Thanks again DP. This is now an essential tool in by bench. It is not only BP. It came with a box, LCD back pack, test probe, lots of jumpers,.. a complete kit.



After getting BP, I try to make a case as usual. Mostly, I prefer acrylic style case like my OBLS and PICKit2. DP calls it “Sick of Begie” case. This time, I found out something which was suitable for the Bus Pirate case.

BusPirate_case (1)

Yes, a necktie clip case.

BusPirate_case (2)

GOOD, BP fits inside it.

BusPirate_case (3)

First, make holes for plastic snap-in fasteners.

BusPirate_case (4)

Second, filing the edge for USB cable connector.

BusPirate_case (6)

Then, make a rectangle for probe cable. And fitted the snap-in rivets.

BusPirate_case (7)



Finally, the case for BP was finished. It took about 15 minutes.


DIY Musical Keyboard in Action

Visitor from DP requested the device in action video. Here are these videos. Sorry for poor quality. I don’t have a video camera and I try to use webcam and laptop to capture this. The first video is tuning with Nexus 7 gStrings app and second one is testing.

Matseng from DP forum said that “So many tone generators.. :-)”. yes it is.

Every musical instrument is basically tone generator. At least 12 tones generators are required for 12 pitches, C,C#…A#,B (ie: 12 freqs) for such devices.
pros of this 4060 design are;

  •  required only 12 x 4060 ckts for 84 keys. I only used 48 keys because I have only 48 salvaged keys.
  • easy to tune, I need to tune one tone for each octave

If I use other oscillators (without uC), 84 tone generators will be required for 84 keys.
I have to add more effects and control ckts soon.

Contest entries are awesome.

DIY Musical Keyboard

The idea is to design and construct an electronic musical keyboard with some functions, effects etc,. This is my old school project and I remake and modified it. It is fun.

There are many hobbyist’s musical keyboard circuits around the net.  Most design are based on 555 or some oscillator circuits. The limitation of these design are that this circuit generates only one tone at a time. To play a real chord, several keys  are to be pressed at the same time and generate multiple tones at the same times. Ie,. for 12 tones, there will be 12 frequency generators are required. If a keyboard has 48 keys, 48 tone generators are required.

This can be saved by 4060 CMOS logic chip. The 4060 is 14-stage ripple-carry binary counter/divider and oscillator. The internal function block diagram of 4060 from datasheet is as follows. Output Qn is the nth stage of the counter, representing 2^n, for example Q4 is 2^4 = 16 (1/16 of clock frequency) and Q5 is 2^5 = 32 (1/32 of clock frequency).

4060 IC functional block diagram (from TI data sheet)

The frequency of chromatic scale can be learned here.



There are a relation between the frequencies of octaves scales. The first octave of  C1 (16.3Hz) is half of second octave C2(32.7Hz) and so on. The 4060 IC can divide its clock frequency via Qn outputs. We will need 12 x 4060 tone generators and it will supports 7 octave as maximum (12×7 = 96 tones, bingo).

Thus, the initial design is like that. The design is composed of 12×4060 tone generators, a dsPIC for sound effect and control, an amplifiers.

Musical Keyboard block diagram

The first circuit is 4060 tone generators. The clock frequency can be calculated as f = 1 / (2.3xR2xC1). I plan to use 4 octaves (48 tones) and starting from C3(130Hz) to B6(1975Hz). You can choose what scales are used. For roughly calculation, the adjustable  frequency range of RxC circuit should be covered this selected range. For next expansion,  I prepared for 6 tones outputs in design.

Updated: thanks Rollicks for pointing the right frequency calculation f = 1 / (2.3xR2xC1).

4060 Tone generators circuit

The next circuits are simple 7805 power supply and LM386 audio amplifier. Nothing specials.

7805 5V regulator
LM386 audio amp circuit

The first step is preparing the physical key and PCBs. The keys are salvaging from old toy china made keyboard. Unfortunately  the switches from toy keyboard used matrix keys. So, I made a PCB for switches also.


Prepared switches bar with the original switches dimension.

And next switches assemblies,

And circuits and wiring,

Initial setup is finished.

Tuning the frequency, I used my Nexus 7 and gStrings tuner app :D.  Thanks the developer for such useful applications. Only one octave is required to tune. Once,the C3, C4 or one of any note is tuned and the rest will be in-tune atomically because of frequency divider.

Finally, after some weekends and many coffees, the first phase design is like this.

The next step:

– You may notice the blank space at the moddle of board. Yes, this is for dsPIC sound effects and control

– I have to make a upside cover also.


– The switches are not ease as original keyboard. I have to find more proper solution for final design.

– The LM386 amp is not matched with tones. I notice some distortion in low volume. I will replace with a proper stereo amplifier in next phase. I want the left and right octaves with separated effect and sound output.

For now, it is ready for open 7400 logic competition because it has only discrete logic :).