Author Topic: Diy optical pickup for guitar -- is it possible?  (Read 2550 times)

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 858
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Diy optical pickup for guitar -- is it possible?
« Reply #25 on: November 12, 2019, 04:22:16 AM »
For analogue audio work a 20MHz bandwidth 'scope is plenty. You don't need serial format converters or logic analysis functions.

If you are going to blow serious money on a new one, then buy the best most highly featured one you can afford.

If you just want something to debug your pickup then buy something cheap and cheerful , it will always be useful even if you buy something better.

Beware of the youtube reviews, They don't spend their own money and, like Dave's review yesterday, will compare a 70 currency unit ($) device with one costing 12000.

Seek out other purchasers/users of the device on forums and ask their opinions.  BTW that little scope wasn't too bad, but I felt it was still too expensive , at 40 cu it would have been a good buy .(you have to be cautious about the results of any instruments when working near their limits)

If you don't already have one, get yourself a copy of 'the art of electronics' by Horowitz and Hill .  I think it will fill a few gaps in your knowledge.and is always useful as a reference.













Bill

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #26 on: November 12, 2019, 07:06:04 PM »
I tend to take Youtube reviews with a grain of salt.

Before purchasing something bigger, I have a habit to read different forums, as it's possible to get more unbiased, and wider picture, considering the brand(s), and possible problems/solutions involved.

The book you mentioned seems to have more approachable way(at least for me) to explain electronics. When looking at table of contents https://artofelectronics.net/the-book/table-of-contents/, there is some pretty interesting stuff. Thanks for suggestion.



 

Offline WeldingRod

  • Full Member
  • ***
  • Posts: 245
Re: Diy optical pickup for guitar -- is it possible?
« Reply #27 on: November 12, 2019, 07:24:58 PM »
The Art of Electronics is a seriously great book, and I enjoyed reading it, um, many, years ago!

Sent from my SAMSUNG-SM-G891A using Tapatalk


Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #28 on: November 15, 2019, 07:54:32 PM »
I think I found at least one reason, why the previously mentioned zero crossing detector didn't give any output, even when signal from the receiver was amplified.

The signal exists, but it seems to 'float' about 780mV above the zero volt point. Maybe not the most scientific way to measure that, but the result is there:


Could the reason for the signal floating above(or below) zero be something like a voltage offset?

I have a very shady understanding about how logic level output can be treated with pull-up, or pull-down resistor, to bring the 0's and 1's to the acceptable 0 to 5 volt 'window'.

Does that apply to analog signals at all?

But questions aside. The square wave generator, that I used to feed the IR-led, or sender, was again based on the 555-timer -IC(I should probably have a screen shot of it's output too).
After all, the output is square wave, when compared to the receiver's one.

No matter how many different versions I've tried out, all of them suffer 'duty cycle vs frequency' dependencies. When one is changed, other changes also.

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
One might guess already, where this leads. Now, that I have a multimeter with a colour screen, I'm obliged to have a proper function generator .

I have looked for something simple, like Velleman's HPG1MK2, which has 1MHz range. But after looking for it's specs, it doesn't seem to have any kind of duty cycle control for the square waves.

I'm aware, that Ebay offers a lot of 'authentic', old hardware, but I'm not so sure about them.

 




Offline Sea.dog

  • Jr. Member
  • **
  • Posts: 45
  • Country: gb
Re: Diy optical pickup for guitar -- is it possible?
« Reply #29 on: November 16, 2019, 06:43:13 AM »
You may need an additional amplification stage before the signal is applied to the detector.

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2372
  • Country: fi
Re: Diy optical pickup for guitar -- is it possible?
« Reply #30 on: November 16, 2019, 08:20:41 AM »
There is always a little buffereing and level adjustment on analog/digital signals. You may want to search logic level on TTL or mathever logic circuits you have. There are some differerences wetween different logic levels voltages and sourcing or output currents. Usually schmit

I have this very generic function generator and it does pretty much what it says. Cheap, not extremely accurate and not the best quality signal (some noise and such) and pretty close to 100% that I need on general simple signals. Only thing is that the buffer does really output great signal to 50 input at more than 5 MHZ or such. Should not be problem for your use.

https://www.ebay.com/itm/24Mhz-Dual-channel-DDS-Function-Arbitrary-Waveform-Signal-Generator-Sine-Square-/181775301443?hash=item2a52a6fb43:g:RxEAAOSw~ZdVfuQg

It does not have the skleekest user interface, but it is easy to use on all normal waveforms, dutu cycle, offset voltages and such basic functions you need. It is not that great on advanced waveforms, but that a little more advertising gimmic, if I ever need that I would buy completely different "box".

There are cheaper ones for square vave dutu cycle, but they are even harder to use effectively. Least the ones I have tried.

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #31 on: November 17, 2019, 08:15:06 PM »
Pekka yes I've been looking for different ways for analog to digital conversion. Well not exactly that, but more like simply chopping an analog signal wave to 0 to 5 volt square wave.

Thanks for suggesting the function generator. I checked the link, and that one, or similar should fit for the purpose.

Little bit of hands-on testing: I took one pair of sender/receiver out of the guitar, to see, how the signal(~50khz) transfers through them.

Pulsed output from the 555-based square wave generator:


Then it goes from sender to receiver, whose output is fed to an op-amp like this:


Resulting output, although not symmetrical, sits finally around the zero volt point:


Now, that the signal crosses zero point, it is sent to a very simple zero cross detector, which requires only one resistor to be added, that I found from the LM393's(comparator IC) datasheet.
This version didn't work at all:


This one gave at least some kind of output. Perhaps the right direction, but not quite there yet:



I always like to start with minimum part count, as on project like this, the number of parts are eventually multiplied by six(except the possible dual/quad IC's). But it is to be expected, that the zero crossing detector needs more parts to make it more useable.

I'm sure, that using the zero crossing detector is just one option, but as I have comparator IC's at hand, I'll give it a shot to see where it leads.

Plenty of testing ahead, as the visual results so far exclude the effects of actual, vibrating guitar string in the infrared beam.

 


« Last Edit: November 19, 2019, 04:09:30 PM by sorveltaja »

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #32 on: November 19, 2019, 06:41:58 PM »
At first, I'll have to admit, that there was a gross mis-reading by me, of the values showed on scope. That dawned to me, when tracking down the reason, why I can't get that zero cross detector to work, as expected.

After digging on the net for alternative ways to amplify the signal from the receiver, I found out, that photodiodes and 'transimpedance' amplifiers go rather often hand-in-hand.

Without knowing much about it, or even having an actual transimpedance op-amp chip, I looked for the configuration.

Bit of testing with one half of the very basic TL062 op-amp:


Output was fed to one of 'schmitt triggers', which is 1/4 of the 4093 IC, that I have at hand:


The inputs were simply tied together:


Yellow curve is from the op-amp output, while blue one is from the 4093 chip:


If all goes well, there could be a possibility to move on with the project.



« Last Edit: November 19, 2019, 07:48:35 PM by sorveltaja »

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #33 on: November 21, 2019, 06:31:33 PM »
Not much to report, just some testings to confirm the previously noticed thing, that the photodiodes I have, seem to have a very narrow operating range, what comes to the light intensity of the sender(IR-led).

Applying more and more current for the sending ir-led doesn't help, although one could expect, that the receiving photodiode would take all the 'juice' gratefully, burp, and demand more.

But after all, there is at least one solution, that I noticed after testing: by using the transimpedance(ish) configuration:


Replace the 1M resistor with 1M trimmer potentiometer. That way the narrow operating window of the photodiode can be altered to suit the following stage, which is schmitt trigger.


   

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #34 on: November 23, 2019, 06:36:11 PM »
I did some testings to see, how the vibrating string affects the pulsed infrared beam between sender and receiver. Had to use the thickest string on the guitar for that, as the effect is quite subtle, when looked at the scope.

Here the string is plucked, and its vibration appears only at the trailing edge of the pulsed square wave:


The string signal seems to be more audible, than visible. It has some noise also, but not as much, as the earlier used phototransistors had.

I used again laptops mic input as an audio probe. It adds some 'weight' for the signal seen on the scope by altering it. Perhaps it could be better to use them separately, one at a time, to find out the best output ranges, either visibly or audibly.

The ~100kHz 'carrier' frequency should be sifted out at some stage, I guess. Though I'm not sure, what sort of modulation it has with plucked string signal.

After all, this projects' goal is not to produce a sweet, clean guitar tone. More like to squeeze the outputs to a form of a hex fuzz, that could possibly be used for a pitch tracking purposes also.



Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #35 on: November 24, 2019, 08:16:44 PM »
I've been looking for a way to suppress the ~50Khz 'carrier' signal from the string's one, that modulates it. Resistor-capacitor low-pass filter could be one way, as there are calculators for that online.

Another way that comes to mind, could be to somehow extract only the difference between the higher carrier frequency, and again the lower one that modulates it.
But as they are already mixed together, it doesn't look that simple.

Simplified signal chain goes like this, where the red one represents the vibrating/modulating string:


The carrier square wave, when it goes through sender to receiver, has always more arbitrary form, which seems to be very sensitive to any and all kinds of adjustments.





 

Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2372
  • Country: fi
Re: Diy optical pickup for guitar -- is it possible?
« Reply #36 on: November 25, 2019, 07:02:32 AM »
Few random thought....not sure if this is usefull...

1: Signal to noise ratio looks bad. Is it good enough? Any way to improve with electro-optical or mechanical construction.

2: Modulation...I lost the plot somewhere why this modulation is used? I think that if modulation is need ideal would be sine wave, because it has only one frequency. Square wave needs to be really high compared to information signal and still simple low pass filter will strugle.

3: Modulation/demodulation reminds me of AM-stuff I used to read and even experiment a little when I were a kid....like one transistor mixers:
https://www.engineersgarage.com/circuit_design/circuit-design-how-to-demodulate-am-signal/

4: Still on this demodulation. If you want to get rid of the IR-led carrier signal you have several options. Have you tried to add pick up signal and inverted signal to subtract the unwanted carrier signal out (that effectively should be very close to IR modulation signal) Is't it.

I haven't been fiddling with audio devices much, this "information" may not be relevant.

Offline BillTodd

  • Hero Member
  • *****
  • Posts: 858
  • Country: 00
  • Colchester Essex (where the lathes were made)
Re: Diy optical pickup for guitar -- is it possible?
« Reply #37 on: November 25, 2019, 07:25:31 AM »
I'm not sure why you want a square wave o/p (the fundamental frequency only will be a sign wave)  but..

one way is to synchronously sample the o/p with the illuminator's clock i.e. only test the level when the light is on (this should also improve s/n) but , you should really have a sample frequency (anti-alias) filter if you want to remove all sampling artefacts anyway.
Bill

Offline WeldingRod

  • Full Member
  • ***
  • Posts: 245
Re: Diy optical pickup for guitar -- is it possible?
« Reply #38 on: November 25, 2019, 01:47:35 PM »
I think the reason all your variation is on the trailing side is that you are triggering on the leading edge, which fixes that location on the screen.  If your scope will do it, try triggering on the led drive signal.

Electrically subtracting the led drive signal should be easy, and would take out the bulk of your modulation.

Sent from my SAMSUNG-SM-G891A using Tapatalk


Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #39 on: November 25, 2019, 07:53:38 PM »
Pekka,
1: Yes, the noise level is quite high so far, when using the previously mentioned circuits. What comes to electro-optical components, I have a few different types of IR-receivers, which are not yet tested.

And the mechanical construction.. there is always room for improvement, one of the most important being the accurate height adjustment of the sender/receiver pairs. Likely by grub screws.
The current mechanical setup is too narrow for that, but it's just one of the first practising platforms.

2: I got the idea for the modulation from several sources on the net. It seems to be true, that by pulsing the leds, one can get a lot more 'power' out of them, when compared to using plain DC.
At first I thought: "more is better". But when used on a project like this, overly powerful output from the sender IR-led goes way above the receiver's range.

Also, when using something like 50-100KHz square wave for modulation, it attracts all kinds of noises, if not properly shielded. Those noises don't necessarily show on the scope, but they are audible.
As I'm on the testing phase, there are a lot of wires around to act as an antenna.

3: Thanks for the link. I'll check it out.

4: As I've looked info about demodulation, it seems to be a very complex subject. As I see it, to cancel out certain noises/frequencies, one should be able to provide exact, inverted copy of it/them.

Bill, I'm not sure either. When I got the resulting ~50Khz square wave output, the vibrating guitar string was able to modulate it, but with a lot of (audible)noise.

WeldingRod, I'll admit, there is options/settings on the scope, which I'm not familiar yet. I thought about subtracting/cancelling unwanted frequencies, but as mentioned above, it isn't necessarily an easy task to do.

Today, after reading these replies, I decided to test using plain DC for the sender IR-led. I tried it earlier, but it was just too easy to burn out the buggers. One way to see, if they are dead or alive, is to use camera. 

Now, that I'm aware(sort of), that the ultimate brightness is to be avoided, perhaps more delicate approach is justified.

Result: the sending IR-led was fed with mild ~3,5mA DC, and the output was strong, not so much on the scope, but audible. And this time there was no noticeable noise at all.
But it wasn't enough for the schmitt trigger. Needs probably more amplification to produce string's frequencies in a square wave form.

I'm led to believe, that audio measurements on the scope could be very tricky. Don't know why, but that seems to be the case.

For audio probe, instead of laptop, I now use a guitar multieffect device, as I guess it's designed to handle better the incoming signals, without adding strain, or loading them down(impedance?).
The device is used without any effects, so only dry input signal appears at the output.
 

Offline picclock

  • Hero Member
  • *****
  • Posts: 556
  • Country: gb
Re: Diy optical pickup for guitar -- is it possible?
« Reply #40 on: November 26, 2019, 12:33:56 AM »
It seems to me that the signal output you are getting relies on the reduced off axis response of the detector, rather than the deviation of the string.

A possible solution may be to use an aperture in front of a large area detector such that when the string moves the size of the shadow changes. A square or rhombic aperture aligned such that opposing corners are in line with the string, would have minimum light when the string was at rest but it would increase directly in proportion to the deviation.

Just a thought.

Good luck

Best Regards

picclock
Engaged in the art of turning large pieces of useful material into ever smaller pieces of (s)crap. (Ferndown, Dorset)

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #41 on: November 27, 2019, 08:37:05 PM »
Picclock, thanks for the suggestion. I'm not sure, how the string actually changes or modulates the IR-beam. But it produces somewhat responding signal from the receiver's output.

As I've noticed, the axis between sender and receivers should be on the same level with string, to get the most output. But that's just one way that seems to work.
Again, I'm not sure if the string is exactly at the same level with the IR-components axis in that case.

One way to get close to the 'sweet spot', where the output is highest, is to feed strong enough square wave to the sender, so that it can be seen at the receivers output.
Although not necessarily square wave anymore after that, but while adjusting the pickups height up and down, that wave changes also, as the sender/receiver pair passes the string.

What comes to using apertures, I haven't got that far yet. With current mechanical configuration, the space between strings is rather limiting, but we'll see.
-------------------------------------
Newbie alert:

I spent plenty of time today to find out the reason, why the recently working circuits didn't give any output anymore, after a good start.

Solutions:

- try different configurations
- if none of them work, check the continuity of the wires
- blame the non-existent quality of your breadboard
- start pulling hair out of your head
- never suspect the 9V batteries, that you are using on a project, that include current-hogs like IR-leds.

After all that, I tested one of the circuits with regulated PSU, and voila, the output was there again.





     

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #42 on: November 30, 2019, 08:02:58 PM »
After testing different photodiode(as receiver) configurations, the overall output still wasn't at the level, that I expected.

I guess it would need a lot of amplification to get it to the level, which could then be usable for cmos(0-5V) devices. I used single op-amp for that, and the output should have been multiplied hundreds of times, but that didn't happen, so there is much more in it, than just adding input and feedback resistors.

Same goes with zero crossing detector(for converting sine to square wave) circuit, whose sensitivity should have been 10mV pp.

I tend to see the circuits that I've found as universal building blocks. But no, if they work for a certain application, that certainly doesn't make them universal.

So I'm heading back to square one, using again phototransistors as receivers. Although noisier, at least they provide more output as they are, even without amplification.

 













Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #43 on: December 01, 2019, 07:39:36 PM »
Again, I was looking ways to amplify the receivers output. Can't tell, why the op-amps didn't work for that purpose in any way :scratch:.

Anyways, I remember seeing this project, that uses an audio amplifier instead of op-amp: https://makezine.com/projects/infrared-string-bass/

After a bit of testing, the 386-based amplifier actually seems to provide a lot of output. I skipped the datasheet's x50 gain version, and went for the x200 one:


Not the most sophisticated way, but if it works, the project could go ahead, after weeks of stuck in the rut.

 


Offline PekkaNF

  • Hero Member
  • *****
  • Posts: 2372
  • Country: fi
Re: Diy optical pickup for guitar -- is it possible?
« Reply #44 on: December 02, 2019, 03:06:09 AM »
I haven't been experimenting with photo receiver diodes in ages, therefore my memory is sketchy. You probably said which diode you used and read the data sheet. In my youth the photo diodes (as a component, maybe nowadays they have integral circuitry) were actually very unlinear current sources. To make any use of their output you had to treat them as a unlinear current source. I always resorted to datasheet and application notes basic circuits and tested them.

Phototransistor and specially pair mounted on same housing was my favorite, usually they were manufactured for automotive or industrial use and their application notes were made very easy to follow.

None of the photocomponents are very linear and stable, but you are not making here very linear system and your aim is just to get good signal and ennough head-room for the signal to keep circuit reliable.

Most of the times operational amplifiers can be treated as a building blocks - as long as you keep in mind offsets, biases and output loading, for me they were whole lot to easier to use than transistors on linear region. At the begining I was drawing capacitors between every stage to isolate DC-path (we are talking here audio signal) but that wasn't completely problem free either....sometimes signal riding on DC-offset is a good thing, just need to keep it in check and zero it before feeding it out of the jack. Pretty soon I lost interest on audio circuits and went different way.

With signal generator and scope you can figure out fast what works and where the problem is.

Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #45 on: December 02, 2019, 08:30:32 PM »
Pekka, yes the optical components seem to have a 'life of their own', or at least the very few ones that I have tested. Not really a one weekend project.

Optoswitches could be one option also. Although they are mostly too big to fit between the strings, it would be interesting to extract the actual, tiny optocomponents out of them.
I have a couple of optoswitches from disassembled printer, but haven't had a chance to look for them yet.

As long as the string modulated ir-light between sender and receiver creates usable output, it should be a good starting point.

The function generator, that I ordered, should arrive in two weeks.

In the meantime, testing goes on, and looks kind of promising so far.

Current setup on breadboard:


Circuits involved:


At first, I tested with thickest string, and the output was good, but when testing with thinnest string with same settings, there wasn't output at all. I changed the voltage to the sender, and by decreasing it, the output was there.

So all of the senders need to be tuned separately, to suit the string thickness. As they are fed with dc, for that purpose, multiturn trimpots could be a safer option to avoid accidentally burning out the sending ir-leds.

To get rid of the jungle of breadboard wires, maybe the circuits above are worth of perfboarding.


Offline russ57

  • Full Member
  • ***
  • Posts: 157
Re: Diy optical pickup for guitar -- is it possible?
« Reply #46 on: December 03, 2019, 09:04:15 PM »
This is a bowed instrument not picked, but

Shows how a string vibrates.

I'm thinking that unless you have a very small aperture, you will have great difficulty in detecting reliably different amplitudes.
You may need an array of detectors rather than a single one.

(and if the detector is a current source, thanks pekka, then you may need a load resistor across the op amp input. Start with say 10k....)

Russ


Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #47 on: December 04, 2019, 08:15:34 PM »
Russ, thanks for posting the video. Never seen acoustic bass that big. I'll bet the windows, if there were any in same room, could have hard time to stay unbroken.

Yes, it's easier to see the string vibrations of the bass, as there is a lot more weight or mass in them, than the guitar strings have. But the pattern is always same, be it guitar, bass, violin or mandolin.

The nature of the optocomponents that I've used so far, for detecting string vibrations, is still mystery to me. From what I've been reading on the net/forums, they shouldn't be able to capture any changes in string.

But somehow in practice, they do. A lot of it has to do with mechanical and electrical setup. With only one sender/receiver pair for a string, it is possible to get the output from skinny 0,010" string.

As Russ suggested, array of detectors could make the string signal stronger. Haven't got that far yet, but all additional output is welcome, to squeeze the string signal into square wave.

Besides of that, there is also possibility to get a 'clean', undistorted output of the strings using photodiodes as receivers. Haven't explored too much of that, just an observation, while testing things.

The detector(phototransistor), being a current source with op-amp, I couldn't find working solution.

That's why I moved to an audio amplifier. If one doesn't provide, the next probably will.


   



Offline WeldingRod

  • Full Member
  • ***
  • Posts: 245
Re: Diy optical pickup for guitar -- is it possible?
« Reply #48 on: December 07, 2019, 07:36:44 PM »
I used an ir led detector pair decades ago to build a system to detect oscillations in a levitated water droplet.  I used linear amplification.  The gap between the two was a couple inches, and the droplets were 1-4 mm range.

If you added a lens to focus the beam near the string, and possibly a lens to collect the light into the detector you.could increase your signal.  However, that will add focus/position stuff too.

Sent from my SAMSUNG-SM-G891A using Tapatalk


Offline sorveltaja

  • Sr. Member
  • ****
  • Posts: 345
Re: Diy optical pickup for guitar -- is it possible?
« Reply #49 on: December 08, 2019, 05:24:41 PM »
WeldingRod, thanks for suggestion. When thinking about using an op-amp for amplifying the receiver(photodiode/-transistor) signal, there seems to be a whole lot of different ones.

The ones that I have, are TL062, 072 and 082s. Maybe they aren't suitable for the purpose, or the configurations weren't right. But that isn't an excuse to blame all the op-amps.

To get bit of a break from electronics stuff, I did draw some sketches of the possible next mechanical setup:


Same with an idea for height adjustment for the individual sender/redeiver pairs, using M2 screws:
 

Contacting elements could be made of the header on the left:


It has room for ~3mm height adjustment, which I'm not sure is enough, though. The screw operated height adjustment seems to be plausible, as I have tested it with a few printed pieces.

To get ahead of myself, here is one possible newcomer. Left one is 3mm optotransistor for comparison:


The one on the right side was carefully removed from the optoswitch housing, which unfortunately doesn't have any model number in it.

While in one piece, I tested it in the breadboard, and the output wasn't strictly on-off type. Even a hair caused deviations in the output waveform.

Those components (sender/receiver) seem to be identical in size. Being that small, when compared to 3mm ones, there should be a lot more room for placing them between the strings.