Showing posts with label project. Show all posts
Showing posts with label project. Show all posts

Friday, 10 March 2023

Synthesizer Build part-51: SAMPLE & HOLD new version.

A revised version of the earlier 'Yet Another Sample and Hold' (YASH by Rene Schmitz) project.

This is the same core S&H circuit as the earlier one I published. That was one of the first projects I built and that was just over 3 years ago so it was time to update it. The things I added on myself were put together rather clumsily, especially the x1/x0.5 CV range switch that I put in. (The previous version works fine, don't get me wrong.) I have now replaced that range switch with a range potmeter so you can set the range to any level you want. The toggle switch for external or internal input has also been removed and instead I used the internal switch inside the External Clock input socket.
If you built the previous version then it should be quite easy to just replace the stripboard with this new version. You will have to make room for the extra Range potmeter but there will be a hole left over from the range switch so maybe you can drill out that hole to 7mm and use that for the potmeter.

SCHEMATIC:
Below here is the schematic drawing I made in Photoshop of this sample and hold circuit. It has the offset opamps and attenuation I designed added on, connected to the output of the LF398 Sample & Hold chip. The offset potmeter is a 100K linear type. You could use other values but that will alter the range a bit so I'd stick with the 100K. The Attenuation potmeter however must be a 100K one because it determins the gain factor of the opamp. If you put in a 1M for instance it won't only attenuate but also amplify which you absolutely don't want because the CV voltage will get way too high and it'll sound really bad connected to a VCO, if you get sound at all. There's a 470 Ohm resistor in series with the attenuation potmeter to make sure it doesn't go all the way down to zero and you'll always get a little bit of a signal.  (I suppose you could get away with using an other value for the Range potmeter as long as the resistor between pins 2 and 7 is the same value as the potmeter. Then the balance (or ratio) between the two stays the same.)
Now, I know you are not really supposed to use an inverting amplifier with a feedback resistance that is lower than the input resistance. Normally Rf must be bigger than Rinput otherwise the opamp could draw too much current. I have however done some measurements and in this case it is absolutly fine. I used an NE5532 dual opamp in my circuit and the current always stays below 15mA.
The Offset control is included in the circuit so you can transpose the whole CV output up or down by as much as you like. This is handy if some of the notes produced are below the 0V line. In the normal case you would just hear a C0 note for those but if you give the CV an overall higher offset then all those notes will be audible. If you use the S&H to modulate a filter those negative voltages could sound really good so in that case you can dial in the effect you want to achieve with the offset control.
I put a 470pF capacitor over the output opamp because with testing I noticed a lot of little voltage spikes on the signal when I viewed it on the oscilloscope. The capacitor turned out to be a very good solution to suppress those little voltage spikes.
The Sample Rate potmeter needs to be a 1M Ohm linear type. I didn't have one so I used a 500K potmeter and that also works perfectly fine. Don't use any value lower than that though otherwise your frequency range will be very limited.
If you build this project and you find you can hear the pulse train in other modules, coming in over the power rails, then try putting a big electrolytic capacitor over the powerrails of this S&H module. Something like a 470µF or 680µF over the plus and the ground should do the trick. That should be enough but if the problem persists then also put one over the negative rail.
This circuit works equally well on +/-12V as on +/-15V. The current draw of the circuit is about +15mA for the positive rail and 10mA for the negative rail (maximum).


THE SCHEMATIC EXPLAINED:
The Schmitt-Trigger [A] at the bottom left is wired up as a Low Frequency Squarewave Oscillator and produces the clock pulse with the potmeter controlling the frequency. The clock pulse then goes to the switch connection of the external clock input socket. If there's no cable connected, the signal goes through the switch to the base of the transistor. Now when the clockpulse is high, it makes the transistor conduct and so the plus 15 Volt coming in over the LED is now connected to ground. The LED lights up and the voltage at the collector is practically zero (except for the voltage drop over the transistor) so the transistor actually inverts the clock pulse at this point. Then the pulse goes through a Schmitt Trigger inverter to invert it back to normal and then through a 470pF capacitor which changes the pulse (or actually squarewave signal) into a trigger signal. It then goes through two other inverters to cut off the negative part of the trigger pulse (a squarewave always produces a positive and negative trigger pulse, from the rising and falling slope of the squarewave, if it goes through a capacitor) to end up with the same positive phase it had at the beginning. It now goes into pin 8 of the LF398 and triggers it to take a sample of the voltage on pin 3. It presents this sample at pin 5 from where it goes into the two opamps to be buffered and more. At the first opamp we can introduce an offset voltage that will shift the whole pulse train up or down in voltage without changing the voltage difference between the pulses. In other words the offset voltage is just added (when positive) or subtracted (when negative) from the pulse train. Because this offset voltage goes into the inverting pin of the second opamp (summed with the pulse train) the working of this offset voltage is actually inverted but this just means the positive voltage needs to be connected to the counter clockwise side and the negative voltage to the clockwise part of the offset potmeter. The pulse train is inverted back to normal in the second opamp. At the second opamp we have a variable gain potmeter which has a maximum resistance which is the same as the input resistor which means the gain can not increase, only decrease. With this we can set the maximum voltage difference between the highest pulse and the lowest pulse generated. This then determins the range of the pulse train. So the pulses can for instance all be between zero and 1 Volt (one octave) or between zero and 7 Volt (7 octaves) and anything inbetween. This can give the pulses a more musical sound. There's a 470 Ohm resistor in series with the potmeter to make sure the gain can never be zero and we always hear a signal. The 470pF capacitor is there to suppress any voltage spikes on the output CV.
Now I know you're not supposed to use an opamp in this configuration as an attenuator. Rfeedback must always be bigger than Rinput; but I did test this setup and the opamp draws no extra current so it works perfectly fine.

LAYOUTS:
Here are the layouts I made for this project. I used these layouts for my own build so they are verified as always. Make sure you copy them accurately and it'll work first time.
Please keep in mind that the LED is a vital part of the circuit so don't leave it out! It's best to use a normal red, green or yellow LED for this either 3mm or 5mm. 
This is the wiring diagram:


The Offset and Output Range options are of my own design. The Output Range is particularly useful. It determins the range between the lowest and the highest possible notes you will hear. You can set it so all the random CV Voltages (or notes) fall in the same octave or higher, upto a range of over 7 octaves. The inclusion of this option saves you from having to put the S&H output through an external attenuator to achieve this effect.

Here is the stripboard only view:


Here's an overview of the wirebridges and the cuts that need to be made in the stripboard as seen from the COMPONENT SIDE!
As always, mark the cuts on the component side and then stick a pin through the marked holes and mark them again on the copper side and then cut with a sharp, hand held, 6 or 7mm dril bit.


Here's the Bill of Materials:


OSCILLOSCOPE SCREENSHOTS:
Here are some screenshots from the scope:

In the shot below you can see the little voltage spikes I was getting when I first tested this circuit. They are the thin overshoots on the rising and falling edges and they also appeared in between in some cases.


Here's the result after I put in the 470pF capacitor over the output opamp. Nice clean CV output:


With all these images I used a sawtooth wave as 'Signal to be sampled', not noise. You can still get sort of random notes even without using noise on the input if the sample rate differs enough from the frequency of the wave you're using. However the paterns will be repeating, they won't be totally random, which can be good for creating melody or bass lines. 
Here's a sawtooth wave being sampled at a very high rate:


In the picture below you can see that the original wave being sampled was a sawtooth wave. Fast rise and slow decline. The CV voltages all lie in one octave (0 to 1 Volt) because the range potmeter was set almost fully counterclockwise. This picture was also taken before I put in the 470pF capacitor so it shows the voltage spikes too.



PICTURES:
Here are some pictures I took while I was building this project:
The cuts and wirebridges ready:


Below you can see the components mounted except for the IC's. Note the vintage Polystyrene 1nF timing cap I used at the top right. It has a red stripe on it. That doesn't mean it's polarized. The stripe indicates which of the legs is connected to the outer layer of aluminium in the capacitor. That leg should always go to ground (or the lowest voltage potential). That way it acts as shielding to prevent hum. Now, if you have a cap that isn't marked but you want to find out which leg is connected to the outer layer and you have an oscilloscope then connect the probe to the capacitor; ground to one leg and probe tip to the other leg. Set the scope so it's quite sensitive and touch the capacitor body with your fingers. Now you become the signal source just by touching the capacitor body (not the legs). If you get a pronounced waveform on the scope then your probe tip is connected to the outer layer and the ground clip is connected to the inner layer. If you reverse them and touch the capacitor body again, you should get little to no deflection. Now you know the leg that outputs the biggest signal is connected to the outer layer and this leg should go to ground. However it is not necessary to do this procedure. I just wanted to tell you how you can find this out, but the capacitor will work fine which ever way you put it in because it's not polarized and this circuit is not that sensitive to hum.


The finished stripboard. I used the old Sample and Hold faceplate and soldered the new stripboard to the old wiring. This particular faceplate I made is a bit of a weird shape because of how I built my synthesizer. It actually sits in a little wooden plank above the other modules. You could say it's sort of a 1U module but for the Kosmo format :)


VIDEO DEMO:
I made a short video demo of the sample and hold in action. The S&H is connected to a Thomas Henry VCO. The input is white noise from the 5 sorts of noise module. The audio goes through the Steiner Parker filter and boy does it sound good!!



Finally I want to leave you with an excellent video by the 'Monotrail Tech Talk' YouTube channel which explains all the different things you can do with a Sample and Hold and discusses some awesome patches. Subscribe to him while you're there. It's an excellent channel for anyone into modular synthesis.   



That's it for another one. If you have any questions please put them in the comments below of post them on the special Facebook Group for this website.


Monday, 30 October 2017

LED Oscilloscope with 100 LEDs.

Hello everyone,

One word before we start: Don't build this project if you're in need of an oscilloscope for measurements or checking waveforms. This scope has no trigger and therefor no stable waveform unless you exactly match the frequency of the waveform with that of the timebase. Furthermore, 10 by 10 LEDs is way too low a resolution to check waveforms with. If you need an oscilloscope for audio waves you can start with a cheap one from eBay for $20. (Buy one with acrylic case!)
This project is just a fun thing to build with LEDs, Something that actually visualizes audio in a small way. And that's all it is; just a bit of fun.

Okay, with that said, here we go:
Following on from my 81 LED chaser with 2 NE555s I now set out to build a LED oscilloscope using the same type of LED matrix I used in the last project, only this one has 100 LEDs instead of 81.  First of all I'll show you the circuit schematics I used for this project. You can easily find this on Google and it's a very simple design. Actually easier to build than the 81 LED chaser.



I made some changes to the way the NE555 was configured. To test the schematics I build this pulse generator on a breadboard and took some measurements with my oscilloscope and the pulses that came off only had a duty cycle of 6%. Maybe that was meant to be and actually works better, but I changed it to a design that gave a 50% duty cycle. I wanted to be able to extend the range of frequencies by adding the possibility of switching between capacitors on the 555 and I wasn't sure how this short duty cycle worked on the higher frequencies I intended to put in, and I also didn't have a 500K potmeter. I only had a 100K so I needed a design that gave me a good frequency range with a 100K potmeter. Here's what I came up with:


When set to the highest capacitor value (330 nF) this gives a range of 17,5 Hz to 6,2 kHz. Then, by choosing the lowest value capacitor, it goes up to about 650 kHz. That's a nice range for a timeline I thought. The ranges overlap a lot and you only really need the first and last setting but I liked having some choise and it adds yet an other switch to the front panel which always looks cool :)
After I had build this circuit I came to the conclusion that the higher frequencies for the timeline don't look good at all because this scope doesn't have a trigger-mode. So with high speed signals it just looks asif the LEDs are on all the time. So you don't have to bother with the alteration to the NE555 and just keep to the original schematic. I just thought I'd include it in this article in case you had the same idea ;)
Do not forget to put in the 470µF electrolytic capacitor (even if the circuit is fed from a 9 volt battery). This prevents oscillations on the positive voltage rail caused by the NE555. (I had the same problem with the 81 LED chaser. This is a well known issue with the normal NE555 chips but if you use a LM7555 cmos version of the 555, this problem won't occur). The capacitor makes sure you get a nice ripple free supply voltage, which needs to be 9 Volts btw. I also put a Schottky diode in the positive voltage rail to prevent damage from accidental polarity reversals. This circuit draws between 24 and 34 milli-amperes (depending on the frequency of the timeline) so it can easily be fed from a 9 volt battery.

I proceeded to build the LED matrix first and I wanted to make a better job of it than I had done with the LED chaser. So I again had to grind down 100 LEDs on 4 sides to make them fit tight together on the perforated circuitboard. I had to glue on an extra bit of circuitboard because I could only fit 9 rows of LEDs on there and I needed room for ten rows. After I had soldered them all in place I took my Dremel tool and shortened all the negative leads so I could fit the positive rails over the negative rails without them touching and creating a short circuit. Here's a picture of the backside of the LED matrix which came out very well. (You can see the extra strip of circuitboard I glued on at the left side):


After that I proceeded to solder together the rest of the electronics which was quite straight forward really. I did end up with a mess of wires and knobs etc. but that was unavoidable. But it was going to be build into a nice case anyway. Here's the finished product mounted in its case but still very accessible because only the display is glued into place so changes and repairs can easily be made.



Here's a closer look at the switch with the different capacitors on it, to change the frequency range:



And here it is in full working order:


Problem solving:
I did encounter a little problem after I had assembled the scope in its case. I had made a BNC connector on the front panel to attach a probe to but it turned out that the ground wire caused the 3rd column of LEDs to turn off so I cut the ground wire for now. I need to mount the BNC connector in such a way that it is insulated from the case completely.
I also build in the microphone with the little amplifier which you can see in the schematic on the lower right. This works very well and I put in a switch to choose between the microphone or the probe. But I wanted an amplifier that is a bit more powerful and has a volume control button that I can put on the front panel aswel. In the next paragraph I explain how I did that.

The Amplifier:
Like I mentioned above, I wanted to build a more powerful microphone amp with a volume control to put in this scope. Well, recently I did just that. It took me just over an hour to build it and put it in and it works very well. The mike is much more sensitive now and reacts even to random noise it picks up. I build it with a 2N3904 transistor as a pre-amp for the electret microphone and then a LM 386 to amplify the signal. Here's a little sketch of the circuit:


(Last revised: 08-Feb-2020 Changed 10µF cap on pin7 for 100nF.)

Here's a picture of the scope with the new volume control added to the front panel:



Here's a little video of the scope working (with a bit low battery) with the synthesizer I build. There are no knobs on the scope this time because I needed them all for the synthesizer, LOL :)  :



I can really recommend using this design over the microphone amp in the main circuit schematic. This one works much better.

Okay, that's it for this project. I hope you enjoyed this read and if you did please consider supporting me by subscribing to my YouTube channel EdEditz or by following this blog or clicking on the adds.

If anyone has any idea how to incorporate a trigger section into this scope I would love to hear from you!!
If you have any questions or remarks, feel free to post them beneath in the comments or on my YouTube channel. I always love to hear from you!!!