DIYstompboxes.com

DIY Stompboxes => Building your own stompbox => Topic started by: .Mike on June 28, 2009, 05:28:58 AM

Title: Project: PIC-based LFO Tremolo
Post by: .Mike on June 28, 2009, 05:28:58 AM
I didn't know what forum to put this in, so please move it if there is a more appropriate place. Here goes...

Alright, so, here is the first project I've ever "designed." I didn't really design anything, but merged two designs, info gathered from datasheets, and what I've learned around here... heh. I took the audio section of the Tremulus Lune, and merged it with a microprocessor-based LFO that is normally used for synthesizers. I've given it the uninspired name of the PICulus Trem.

(http://img196.imageshack.us/img196/7017/schematicpiculustrem10.th.jpg) (http://img196.imageshack.us/my.php?image=schematicpiculustrem10.jpg) (http://img44.imageshack.us/img44/2328/componentoverlay.th.jpg) (http://img44.imageshack.us/my.php?image=componentoverlay.jpg)

Here are the main features:

As laid out, it should fit into a BB box in landscape orientation. Since the pots are mounted on the board, the knobs would be on the top of the enclosure, but I believe you could use right-angle pots and have the knobs on the face.

I'm still a relative beginner, so there were a lot of firsts for me in this project: First time drawing a schematic, first time designing/etching/drilling/filling a PCB, first time using a PIC, first time using an LED/LDR combo, and probably a few more. There were some errors in the design when I first built it, and I fixed them during the debugging process. They have been corrected in all of the project files, so my images will be slightly different than how it would look if you built your own version of this. I've also renumbered a few of the resistors.

Here are some photos.

Here is my blank board:

(http://img196.imageshack.us/img196/5578/boardbottom.th.jpg) (http://img196.imageshack.us/my.php?image=boardbottom.jpg) (http://img200.imageshack.us/img200/2207/boardtop.th.jpg) (http://img200.imageshack.us/my.php?image=boardtop.jpg)

Here is the finished board:

(http://img141.imageshack.us/img141/4332/boardfilledperspective.th.jpg) (http://img141.imageshack.us/my.php?image=boardfilledperspective.jpg) (http://img189.imageshack.us/img189/4766/boardfilledtop.th.jpg) (http://img189.imageshack.us/my.php?image=boardfilledtop.jpg)

For the LED/LDR combo, I used the cheapest, lowest-value Futurlec photocell (#PHOTOCELL1) and a diffused red LED from Mouser (# 593-VAOL-5LAE2), but I've spaced the board so that a Vactrol should fit. I put the LED in one end of a piece of a straw and the LDR in the other, and used two layers of heatshrink to hold them together and block out light. I packed the ends with black foam and a drop of clear nailpolish to fully seal them.

Even though the photocells are supposed to have an ON resistance of 5K-ohms, I found that all of mine measured under 200R when the LED was running at 20mA. This is good, because turning on two LEDs at 20mA each was causing a huge audible pop. I ended up reducing the current way down to under 2mA, and I still get an ON resistance of about 500R. This allowed me to use a 1K pot for the gain, and get a mild boost when the pot is maxed out.

If you build your own, you will probably have to experiment with the LED resistors and gain pot in order to come up with the best match for your particular LDR/LED combo. I recommend keeping the LED current as low as possible to avoid clicking in the audio.

The LFO is controlled by a microprocessor, so you will have to write the HEX code, available at the site referenced above, to the chip. There are a lot of resources on how to do this online. Truth be told, I had a friend make one for me, so I'm not going to be much help.

You might notice that the LFO is capable of producing a Noise waveform. I thought it would act like a random waveform. Unfortunately, it doesn't work that way, so I have eliminated that waveshape.


Here is noise fed through each wave shape.

(http://img44.imageshack.us/img44/4972/waveformshapesnoise.th.jpg) (http://img44.imageshack.us/my.php?image=waveformshapesnoise.jpg)

Here is what the Wave Distort knob does to a couple of the LFOs.

(http://img199.imageshack.us/img199/1135/wavedistortnoise.th.jpg) (http://img199.imageshack.us/my.php?image=wavedistortnoise.jpg)

Here are some audio samples. Ibanez GAX-70 -> Modified Valve Junior -> Isobox w/ 12" speaker, SM57-equivalent -> Yamaha Mixer -> M-Audio Delta 66. Sorry that it's a bit out of tune... my Strat is just too noisy for demo-ing (it was the noise source for the tests above!). I haven't touched this guitar in over a year. I tuned it, but it went out of tune faster than I could record the demos.

Cycling through each waveform. Bypass -> Ramp Up -> Ramp Down -> Square -> Triangle -> Sine -> Sweep -> Spike: Link (http://mikesblog.americasdebate.com/uploads/pictrem/Waveshapes.mp3)

Sine wave, maximum speed to minimum speed: Link (http://mikesblog.americasdebate.com/uploads/pictrem/Speed.mp3)

Wave Distort demo, Square wave, Full counter-clockwise to full clockwise: Link (http://mikesblog.americasdebate.com/uploads/pictrem/WaveDistort.mp3)

Here is the zip file that contains all of my project files, ready to go: Link (http://mikesblog.americasdebate.com/uploads/pictrem/Package.zip)

And finally, thanks to Tom Wiltshire from ElectricDruid.net (http://www.electricdruid.net) for the VCLFO and for his help with a bug I couldn't figure out. And of course, thanks to everyone here for all of the shared knowledge.

So there you have it. Questions? Comments? Suggestions?

:)

Mike
Title: Re: Project: PIC-based LFO Tremolo
Post by: frequencycentral on June 28, 2009, 05:44:33 AM
Hey Mike, that's a very well thought out project, and quite a major accomplishment. PIC is beyond my skill right now, but that LFO looks and sounds so sexy.............I can think of lots of uses for it as well as tremolo. I see the main challenge with PIC as the programming (not having a clue myself), so how do us mortals program one of those things? Well done, you should be suitably proud of yourself. This be in the main forum though, to get the coverage it deserves
Title: Re: Project: PIC-based LFO Tremolo
Post by: .Mike on June 28, 2009, 05:49:16 AM
Quote from: frequencycentral on June 28, 2009, 05:44:33 AM
Hey Mike, that's a very well thought out project, and quite a major accomplishment. PIC is beyond my skill right now, but that LFO looks and sounds so sexy.............I can think of lots of uses for it as well as tremolo. I see the main challenge with PIC as the programming (not having a clue myself), so how do us mortals program on of those things? Well done, you should be suitably proud of yourself. This be in the main forum though, to get the coverage it deserves

Heh... Thanks, Rick.

I did absolutely zero programming, honest. Tom provides the HEX code at his site, and apparently all you need is a programmer (hardware) and a compiler (software). There are even DIY projects for the programmer out there that look pretty simple.

I might have told you this already in a PM, but I hooked the LFO up to a Rebote 2.5., and it worked great. I plan on putting together a 4-knob LFO-only board based on this. It should be pretty simple.

:)

Mike
Title: Re: Project: PIC-based LFO Tremolo
Post by: timotet on June 28, 2009, 02:03:23 PM
great job
awesome layout!! :)
Title: Re: Project: PIC-based LFO Tremolo
Post by: ElectricDruid on June 28, 2009, 02:16:51 PM
Hi Mike,

Glad to see you got it all finished off. The final board looks great. I think you might have started something good here with simple DIY PIC-based effects.

I'd better get my backside in gear and finish off the tap-tempo PIC LFO I was developing (http://www.diystompboxes.com/smfforum/index.php?topic=76436.0) as I can see that folks here have plenty of ideas for this sort of stuff.

Regards,
Tom
Title: Re: Project: PIC-based LFO Tremolo
Post by: frequencycentral on June 28, 2009, 02:34:06 PM
Quote from: ElectricDruid on June 28, 2009, 02:16:51 PM
Hi Mike,

Glad to see you got it all finished off. The final board looks great. I think you might have started something good here with simple DIY PIC-based effects.

I'd better get my backside in gear and finish off the tap-tempo PIC LFO I was developing (http://www.diystompboxes.com/smfforum/index.php?topic=76436.0) as I can see that folks here have plenty of ideas for this sort of stuff.

Regards,
Tom

Yes, very inspiring work. I'd certainly be interested in a pre-programmed PIC chip LFO or two. Very cool stuff Tom.
Title: Re: Project: PIC-based LFO Tremolo
Post by: .Mike on June 29, 2009, 02:18:29 AM
Thanks again for all the help, Tom. Emailing you was on my list of things to do!

I really think the barrier into getting into a project like this is putting the code on the chip. I had a friend make mine, and probably would have bought one if I could have. Otherwise, I probably would have never tried this, especially as a relative newbie.

It would be much easier to spend $10 on a ready-made chip than $50 on a programmer. Now that I have done one project, though, I definitely plan on buying/building a programmer and having some fun with PICs.

By the way, to anyone building this, R11 should be 1.8K, not 1K.  8)

Mike
Title: Re: Project: PIC-based LFO Tremolo
Post by: JKowalski on June 29, 2009, 03:02:22 AM
Quote from: frequencycentral on June 28, 2009, 02:34:06 PM
Quote from: ElectricDruid on June 28, 2009, 02:16:51 PM
Hi Mike,

Glad to see you got it all finished off. The final board looks great. I think you might have started something good here with simple DIY PIC-based effects.

I'd better get my backside in gear and finish off the tap-tempo PIC LFO I was developing (http://www.diystompboxes.com/smfforum/index.php?topic=76436.0) as I can see that folks here have plenty of ideas for this sort of stuff.

Regards,
Tom

Yes, very inspiring work. I'd certainly be interested in a pre-programmed PIC chip LFO or two. Very cool stuff Tom.


If you ever spent the time to get this off the ground, you could seriously make alot of money with this. I'd be willing to pay up to $10 for one pre-programmed, seeing as the part itself costs a mere $1.40 on bulk on mouser. Although I would buy many more if they were around $7, which I think is very reasonable. That's still a 500% profit, for not much work at all, provided you have a interface and a code set up for transferring!
Title: Re: Project: PIC-based LFO Tremolo
Post by: Auke Haarsma on June 29, 2009, 12:12:45 PM
Sounds nice! Thanks for sharing!
Title: Re: Project: PIC-based LFO Tremolo
Post by: soggybag on June 29, 2009, 01:19:31 PM
I'm impressed good work. I had been working on a Micro Controller project myself a few months back. But this far beyond what I was working on.
Title: Re: Project: PIC-based LFO Tremolo
Post by: fNNR on June 29, 2009, 04:51:30 PM
I'm loving the square wave/wave distortion sounds. Great job, thanks for all the links!

I've programmed quite a few PICs, but never in the field of audio (mostly robotics). This looks like a great starting point for me to start using PICs with audio.

Awesome
Title: Re: Project: PIC-based LFO Tremolo
Post by: .Mike on June 29, 2009, 08:38:29 PM
I've recorded a longer demo of various settings to show the flexibility of this thing. I'm using my shielded-but-noisy strat, and the board is connected to my unshielded breadboard for the input/output/power. I'm in a very noisy environment, surrounded by a TV, studio monitors, two LCD displays, my amp, a whole rack of gear, and... ermm... a coffee warmer.

The clip is noisy, but not from the tremolo. My strat has a bigger buzz than a high schooler at his first kegger.

I added some reverb using an aux channel on my mixer, since my isobox sounds, well, like a box. Pardon the sloppy playing. Hopefully you'll get the idea how flexible this effect really is: Link (http://mikesblog.americasdebate.com/uploads/longerdemo.mp3)

:)

Mike
Title: Re: Project: PIC-based LFO Tremolo
Post by: cloudscapes on June 29, 2009, 09:31:03 PM
thats really really cool!
I build a trem with a microcontroller shaper semi recently as well
nice to see more people doing it! wave distort looks really useful
Title: Re: Project: PIC-based LFO Tremolo
Post by: Processaurus on June 30, 2009, 07:10:41 AM
QuoteI'm still a relative beginner

Programming pics, designing & debugging analog circuitry, board mounted pots, silk screened PCB, maybe a beginner relative to like, Sir Robert Moog?  Thanks for sharing your project, very inspirational.
Title: Re: Project: PIC-based LFO Tremolo
Post by: Bunyaman on March 03, 2012, 02:45:32 PM
Men, can I take only tap-tempo part from this schematics http://www.guitar-gear.ru/forum/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=17150(resistor r9 and button to pin 4 of PIC) ? and I didn`t want to use multiplier pot.
Title: Re: Project: PIC-based LFO Tremolo
Post by: ElectricDruid on March 04, 2012, 11:44:23 AM
Quote from: Bunyaman on March 03, 2012, 02:45:32 PM
Men, can I take only tap-tempo part from this schematics http://www.guitar-gear.ru/forum/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=17150(resistor r9 and button to pin 4 of PIC) ? and I didn`t want to use multiplier pot.

That schematic is the one that Mike developed above and that I put in my Tap Tempo LFO datasheet:

http://www.electricdruid.net/index.php?page=projects.taplfo

If you don't need the Multiplier knob, just connect the input to +5V with 10K. That sets it to a permanent "x1" multiplier.

HTH,
Tom
Title: Re: Project: PIC-based LFO Tremolo
Post by: Bunyaman on June 05, 2012, 08:25:12 AM
I`ve done this device and added tap tempo part from this schematics 
http://www.electricdruid.com/images/lfo/TapTremolo.gif

I used SPDT button and I have the problem. Tap is response by pressing not every time, but on first, third fifth pressing.

http://www.youtube.com/watch?v=RZIJ6qlh8lE&feature=player_embedded

What's the problem?
Title: Re: Project: PIC-based LFO Tremolo
Post by: .Mike on June 05, 2012, 09:09:40 AM
Quote from: Bunyaman on June 05, 2012, 08:25:12 AMI used SPDT button and I have the problem. Tap is response by pressing not every time, but on first, third fifth pressing.

What's the problem?

The switch needs to be momentary, not latching. :)
Title: Re: Project: PIC-based LFO Tremolo
Post by: Bunyaman on June 05, 2012, 09:18:25 AM
It`s not lathing! I checked it....
Title: Re: Project: PIC-based LFO Tremolo
Post by: ElectricDruid on June 11, 2012, 10:10:38 AM
If the chip is working correctly, it should measure the time between the first and second taps. If you keep tapping, it'll measure the time between the first and second taps, then between the third and fourth taps, then between fifth and sixth, etc etc.

On the first tap of each pair, the waveform is reset to the start point - the top of the waveform for most shapes. If that's what you're seeing on the first, third, and fifth taps then that's entirely normal and correct.

HTH,
Tom
Title: Re: Project: PIC-based LFO Tremolo
Post by: Bunyaman on October 14, 2012, 06:21:38 PM
So, today i founded a mistake. I connected 11 pin(miltiplier input) to the GND, not 10k to 5V.... :icon_confused: