Showing posts with label CD4017. Show all posts
Showing posts with label CD4017. Show all posts

Monday, 9 December 2019

Synthesizer Build part-8: 8 STEP SEQUENCER.

A simple 'Baby 8' type Sequencer made with the CD4017 chip. Easy to build and fun to use. No DIY synth should be without one of these.

EDIT: There is now a new and improved version of this sequencer available on this website. I redid the design and included some extra features like external clock input and a CV Offset control. This makes the sequencer much better to use and it is no more complicated to build than this original design. So please go over to project 49: 8 step sequencer version 2 if you want to build this 8 step sequencer.

This sequencer is one of my earlier projects and of my own design although it's more or less put together from bits of other designs like the 'Baby 8' but it works fine for me and is really easy to make and easy to tune although to build it is quite time consuming and repetitive work because a lot of steps have to be soldered eight times. I found it rather tedious work but very worth while. 

A NOTE FOR BEGINNERS: A sequencer does not actually produce any sound itself. It produces a stepped control voltage that can be routed into the CV input of a Voltage Controlled Oscillator and the VCO then produces the actual notes you hear. In a sequencer you can set each of these eight steps or notes manually (with a potmeter for each step) to any voltage/note you want.

Here's the schematic drawing for this sequencer. The connections of the rotary switch are not correct in the schematic. They must be offset by one step from those of the potmeters. So step 1 is reset by the pulse from step 2 so pin one of the switch goes to output 2 of the CD4017, pin 2 of the switch goes to output 3 of the CD4017 etc, etc.


In the schematic above the on/off switch is placed after the voltage regulator to easily switch the sequencer on or off without causing switching pulses on the voltage rails. The complete on/off switching is done with the switch of the powersupply which controls the power of your whole modular synthesizer.

Here's the stripboard layout I made for the sequencer. In the schematic I drew in switches that you can add to turn individual channels on or off but I didn't include them in my build because I didn't have the space for them on the panel. In this layout I don't use any transistors either. I thought it was nonsense to make this more difficult then it needs to be. It will work fine without them because we hardly draw any current from these outputs. The CV output signal goes straight into a VCO. The layout has an extra 10µF electrolytic capacitor on the output of the voltage regulator that is not on the schematic. It's for extra noise suppression. You can get away with using a 100nF cap or leaving it out completely.
Be careful when you wire this up, note that the jumper (or wire bridge) for output 5 is connected to pin 10 of the chip so the left bunch of jumpers skips a copper trace at output 5. Look carefully at the layout! If you want to include switches to mute individual channels then put them in series with the diode!

(Last revised: 26-Feb.-2020: Minor cosmetic changes.)

NOTE: All potmeters in the layout are shown from the front side!

Use Schottky Diodes on the wipers of the potmeters. They only have a voltage drop of 0.2V instead of the 0.6 to 0.7 Voltage drop over 1N4148 diodes usually found in sequencers like this. This means you can get deeper tones from the VCO you plug it into. Because of the 0.6 to 0.7 Volt voltage drop over the silicone diodes, the first section of the potmeters wouldn't do anything until you get above 0.6 volts. So with a lower voltage drop there's more throw on the potmeter. As an experiment I also installed a 100K potmeter over the output of the Control Voltage and the wiper goes to the CV output jack. That way you can get even lower tones although, of course, this compresses the dynamic range of the sequencer. With the potmeter fully open you get the normal range of 0.2 to 8 Volts. If you close the pot half way, your range becomes 0.1 to 4 Volts so the spacing between notes becomes smaller. You don't need to include that option, I never use it and it is not included in the layout. But anyway, this is an expirimental sequencer and as a whole it works really well, If you build it you will be happy, I guarantee it. :)
A better solution, and one you should consider if you are comfortable with designing simple circuits with opamps, is to add a DC-Offset feature to this sequencer. That way you can get the lowest notes down to 0 volt without influencing the dynamic range of the sequencer. It's easy enough to do. This is not included in the layout or schematic though.

Here's a close-up of the stripboard:



Bill of materials for the layout version. You'll need ten (10) 100K potmeters instead of the 8 mentioned in the B.O.M. below. You need one for speed control and one for offset (if you build version 2 of this sequencer which I strongly advise you to do. Go to project 49) :


Here's a picture of the sequencer:



The sequencer is build up around the CD4017 decade counter chip, using a CD40106 to create the clock pulses which also serve as the 'Gate' pulses.
The CD40106 hex inverter is used as a low frequency oscillator giving off squarewave pulses who's frequency can be controlled by the 100K potmeter. I used a 15µF electrolythic Capacitor although a 10µF will do just as well. But a little higher value will give you slower speeds so you could even try a 22µF cap. The clock pulses can be interrupted by switch S-2 to give you a chance to tune that particular channel. Sometimes it can happen that after using the 'Stop/Run' switch that the sequencer jumps to channel one. If that happens try using a different CD40106 chip. You might have a fake one and they can be quircky in their behaviour.
With S-2 closed the clock pulses go into pin 14 of the CD4017 and with every pulse the chip will output a high signal on a different pin. The order by which the different pins go high is a bit random. Here is the right order: 3,2,4,7,10,1,5,6,9,11. Because of this confusing order, the outputs are set in the right order by the wire bridges to the copper traces underneath the CD4017. From there the pulses can be accessed in the right order to avoid confusion. Following the schematic drawing, the pulses go straight into the base of the 2N2222 transistors which are used here as switches. The Base-Emitter voltage is way more than needed to saturate the transistor and fully open it up. I chose the 2N2222 transistor because it can handle a reasonably large current and there's no need to use any resistors to connect them (although using a resistor in series with the base connection wouldn't be a bad thing because we're using the 2N2222 at near the limit of the operational specs.) From this base connection we also feed the eight LED's which indicate which channel is on at each moment in time. The LED's are connected with 3K resistors to reduce current flow and still provide a bright light.
All the collectors of the transistors are connected straight to the 8 Volt power rail and the emitters are all connected to ground.
It's better to just follow the stripboard layout and skip the whole transistor setup and connect the output of the CD4017 straight to the potmeters. I'm using transistors as a sort of buffer and to make this sequencer future proof for other experiments so I can draw some current from the outputs should that be necessary. But you can just leave them out it you want to. Makes it so much easier.
By setting the different potmeters, you can create the different tonal paterns the sequencer produces.
Because the potmeters are simply used as voltage deviders, it doesn't really matter which value they are as long as it's 50K or over so that they don't draw too much current and as long as you use the same value on all 8 channels.
You can tap the 'Gate' pulses straight from pin 3 of the Speed Control potmeter to the Gate output jack mounted in the panel. The pulses are really clean looking 8 Volt squarewave pulses with a 50% duty cycle so if you use the gate output into the ADSR, it will sound as if a key is pressed every time the sequencer switches to an other note.

A ten step switch is used to select the length of the sequence. It can be anything from 1 to 8. Btw, you can easily make this a ten step sequencer by connecting the last two pins from the CD4017. I made it an 8 step because I didn't have enough space to mount everything horizontally and because 8 steps is more natural for music than 10 steps because you normally have 4 notes in a beat. So multiples of 4 are better. The potmeters on my panel are mounted vertically and I could only fit eight of them below eachother anyway.
Connect the wiper part of the switch to pin 15 of the CD4017 and the wires from 1 to 8 to their relative position on the switch. Connect pins 9 and 10 of the switch together and connect the ninth output from the CD4017 to that. The pulse going into pin 15 of the 4017 will reset the chip and the counter will start over again.
Don't forget to connect pin 13 of the CD4017 to ground.

It is best with this build to make the panel first and connect all the components and do the essential wiring while you have access. Then make the circuitboard and connect the wires to the panel. Solder the resistors straight to the LED's and the diodes to the wipers of the potmeters. Connect the cathodes together and solder a wire from there to the CV output jack.
I used 5mm LED's and I made the holes in the panel by using a drill rather than a hole enlarger bit which I normally use to enlarge the pilot holes I drilled. The drill is usually a little bit less then 5mm and therefor the LED's will sit very tight and don't even need to be glued in place (although it is best to hot-glue them in place anyway).

Do not forget to solder a big 470µF capacitor on the input of the 7808 voltage regulator. Otherwise pulses will bleed through onto the power supply rails and you'll hear the tone sequence even if the sequencer isn't connected to the CV input of the VCO. I also included an ON/OFF switch (S-1) on the panel just to have the option to shut it down. It's the only panel in my synth build to have an ON/OFF switch.

TUNING THE SEQUENCER:
To tune the sequencer, simply set it to the lowest speed and use switch S-2 to interrupt the clock pulses and stop at each channel. Then you can tune that particular channel using a tuner or simply by ear, by turning the potmeter and then you turn switch S-2 back on. The sequencer flips to the next channel, you turn it off again with S-2 and tune that note, then you flip the switch again and jump to the next channel, etc, etc. It's very simple and very effective. :)
A note for beginners. You must connect the CV OUT of the sequencer to the 1V/Oct input of a Voltage Controlled Oscillator (VCO) and the oscillator makes the actual sound. The sequencer only produces a sequence of stepped voltages that the VCO turns into notes so for tuning the sequencer you must have it connected to a VCO.
Because the sequencer can produce any voltage between 1 and 8 Volt it's difficult to set it accurately to a specific note without using a tuner. That's why most professional sequencers have a built in Quantizer which automates this proces. A Quantizer reads an incoming voltage and turns it into the nearest 1/12th of a volt, that way making sure it's a pure note. 
Because most synthesizers use the 1 volt per Octave system and there are 12 notes in an Octave, each note is produced by a multiple of 1/12th of a volt. For instance note C1 = 1.000V, note D1 = 1.083V (1 + 1/12th volt), note F3 = 3.333V (3 + 4/12th volt). So the notes progress upwards in steps of 1/12 of a volt. This sequencer does not have a quantizer and because they are quite difficult to build I don't have a quantizer project on my website. You can however buy them for Eurorack systems. In my Eurorack system I have the Doepfer A-156 QNT which costs about €119 and contains 2 quantizers.
If you are good at working with Arduino's you can easily make a quantizer with that. You can program it to turn any incoming voltage into a multiple of 1/12th of a volt.

Momentary switch:
There is a good way to include a momentary switch mentioned in the comments below by 'tamasgal'. The suggestion is to put a resistor and switch in series connected between V+ and ground and then run a resistor and capacitor from the high potential side of the switch to ground and also connect it to one of the left over schmitt-triggers of the CD40106. Then connect the output to pin 15 of the CD4017. That should take care of any bounce in the momentary switch.
In fact, I have implemented this in version 2 of this sequencer (project 49) and it works really well.

That's all there is to say about this. It's one of the most fun panels for the synthesizer but one of the most tedious to build. It cost me 6 hours straight to design and build it but luckily it worked straight away.

Here's a little demo of the sequencer. This was filmed before I put in switch S-2 so I had no option to tune the sequencer at the time of filming. I might make a new video soon:


Okay, that's another one done. I hope you enjoyed it. If you have any questions about this build then  please leave them in the comment section below or in the Facebook Group.

Monday, 18 September 2017

81 LED Chaser circuit using 2 NE555's!

Hi everyone!

This last week I've been busy making a little LED chaser circuit. I found a schematic online that used one NE555 to drive two CD4017 decade counter chips that drive the LED's. I thought I could improve on that by adding a second NE555 and it worked beautifully.
BTW, AliExpress now sell a kit of this design, only it has 9 x 9 LEDS, for about $5,-

I started out by building the LED display on a separate perforated circuitboard. I wanted to have the LEDs very close together to get a nice dense row of lights and the board I used was exactly the right size to fit a 9 by 9 LED matrix. I used 5mm LEDs because I have about a thousand of those in my junk box, salvaged from an old display unit. They had short leads but long enough to still use. I used a green perforated circuit board but to fit them on next to eachother I had to trim each LED on 4 sides with a Dremel tool because these LEDs have a broad rim at the bottom. Anyway, I managed to fit them all on the board in a 9x9 matrix. Then I soldered all the Cathodes together, row by row. Then the same for the Anodes, to give me an X and Y axis to work with.
You can use other types of LEDs if you want and choose a resistor value for the collectors of the transistors that works best with your preferred LEDs. Test the LED/Resistor combination on a breadboard and choose a value that makes the LED shine at normal brightness.

After that I started soldering the actual circuit.
Now, the original schematic, that you can find on the internet, only uses one NE555 to drive the movement of the LED lights and so you can really only change the speed of the X-axis of the display, or the Y-axis according to the schematic below, but I soldered the display in such a way that the initial movement was horizontal. So I thought why not add an extra NE555 and make the Y-axis adjustable aswell so you can get much more variation in the patterns displayed. So that's what I did. I made a new schematic and here it is: (Btw, the collectors of the vertical row of transisitors are all connected to the + of the power rail, just like the top transistor. It's not shown in the schematic because that would make the drawing very messy.)
(Click on the images to see them in full scale and right click to download them.)




Btw, instead of using the BC547 transistors you could also use the 2N3904 but in that case you need to change the 220 Ohm resistors for 100 Ohm resistors, but my advise would be to test the LED/resistor combination on a breadboard and see which resistor value works best and makes the LED shine at a normal brightness. You could also try 2N2222 transistors). The 10K's at the Base of the transistors should always be the same to protect the Base input.

OSCILLATION PROBLEMS (solved ^__^):
After having soldered on the first NE555 squarewave generator, I tested the output signal with my oscilloscope and I found that there were bursts of pulses with a frequency of about 60kHz on the output squarewave. This is a common problem of the NE555 which does not occur with the CMOS version ICM7555.
Here's a screenshot of the Squarewave from the NE555 with the pulses on top:


I added a big electrolytic capacitor of 470 µF to the output of the voltage regulator and that solved the problem. I proceeded to solder in the rest of the components. The 10K resistors for the base of the transistors I stuck into the same hole as the base, to save space. I had a bunch of cheap resistors from China which had very thin leads so they just fitted into the hole together with the base of the BC547s. That way I only needed 4 holes per transistor resistor combination.
I tested the circuit a few times during assembly to make sure everything worked because once it was all put together it would be very difficult to trouble shoot this thing with all the wires going everywhere. Luckily it all worked as I had imagined, especially the second NE555. It worked just as I thought it would do. I had a problem though with the two 100K potmeters. The ones I used were old ones from a valve radio and they turned out not to be up to the job. I didn't have more 100K pots but luckily I did have two 50K stereo potmeters, so I soldered the wires on, in such a way that the double 50K was in series and formed one 100K potentiometer and that worked very well. It's important that the potmeter goes all the way down to zero Ohm to get the fast movement of the LEDs and the ones I used did that very well.
Btw, if you decide to build this and want the display to appear as I have it in my video, with the lights going from left to right working their way down, you'll need to experiment with how you solder the wires from the transistors to the display. The way it's drawn in the schematic the light would go from top to bottom instead of left to right down the rows. Beware of that.

I made a video about this circuit which shows how it works with a little animation sequence, which you can watch here:



TESTING:
I did some measurements of the pulses and they are pretty messy to look at but they work just fine to trigger the CD4017s. I was surprised at the fast rise-time of the output pulses from the 4017s. They rise in about 12 nano seconds! Here are some screenshots from the scope:

This is the X-axis pulse going to the LEDs:



This is the Y-axis pulse going to the LEDs:




Here's a closeup of the rising edge of the output pulses showing how fast they rise. You could build a Time Domain Reflectometer with pulses this fast:



So now that I had it all working, I decided to round off this project by building the whole thing into a nice case. I found an old sewing tin which had just the right size. I spray painted it black and with a Dremel tool I made holes for the display and the knobs. Then using hot glue I glued in the display board. I left the board with the actual electronics on it floating. I didn't glue it down. All the wires connecting it to the display were enough to keep it in place and I needed the lid to be removable to make it possible to exchange the battery. I used a 9 volt battery which I kept in place with a strip of copper, bent to fit around the battery and glued to the bottom of the case. I lined the inside of the case with gaffer tape to prevent accidental short circuits should the print touch the case. I had just received a batch of knobs from China that looked a lot like the knobs on a Mini-Moog synthesizer and I put those on the potmeters.
After it was all assembled it looked like this:


This is the inside of the case:

(The hot glue underneath was meant to protect the wiring when I was testing the circuit.)

Doesn't it look cool?? Of course it doesn't do anything useful, but it's so much fun to play around with and also to build. Actually, you could use it as a game: try and make a diagonal line appear that doesn't move across the screen. It's possible but requires a very delicate touch on the controls. Perfect to while away those busy office hours, lol! And you could use it as a prop for a movie. Say like an artificial scanner of some sort, for tracking down ghosts  ^___^

Okay that concludes this blog post. I hope you enjoyed it and if you did please leave a comment, either here on on the YouTube video. If you want to support my channel you can do so by subscribing. That would really help me out and it costs you nothing :) Win/win situation!  :) But please leave a comment. I always love to hear from you!!
I've also recently opened a Patreon Page through which you can support my work. I don't have any rewards set up as of yet but I will in the very near future. Here's the link:
https://www.patreon.com/EdEditz