madbeanpedals::forum

General => Open Discussion => Topic started by: cooder on May 11, 2018, 05:45:00 AM

Title: Any Arduino ninjas out there...?
Post by: cooder on May 11, 2018, 05:45:00 AM
I was surfing around stumbling onto that whole Arduino thing after having it ignored for a long time.
Just wondering if there are any of you ninjas out there doing stuff with it like switching or looping duties, switching relays for effects or so.
I don't have any real idea about it, so just wondering if there's any use for pedal building in it.
This chip seems particularly nifty:
https://www.makeuseof.com/tag/meet-arduino-killer-esp8266/ (https://www.makeuseof.com/tag/meet-arduino-killer-esp8266/)

Enlighten me pleeeease....
Title: Re: Any Arduino ninjas out there...?
Post by: mjg on May 11, 2018, 08:59:11 AM
I use Arduino IDE to program ATTiny chips for relay switching. I'm using a spare Arduino Uno as the programmer too.

Have also used an Arduino as a basic MIDI controller if you're into that kind of thing. 

Some of the more recent boards have beefier processors and better ADC and more memory...I've been meaning to see what is possible in terms of DSP using one of those (but really haven't looked into it yet)

So yeah, there's certainly stuff you can do with it. 
Title: Re: Any Arduino ninjas out there...?
Post by: EBK on May 11, 2018, 09:45:16 AM
I've used an Arduino to drive a bar graph display in a compressor.  It's hard to see in this video, but there are red, yellow, and green bars, indicating attenuation, output level, and amplification:
https://youtu.be/U7caRyEjSeg
(Easiest to see it if you skip to about 0:37).
Title: Re: Any Arduino ninjas out there...?
Post by: peterc on May 11, 2018, 04:04:30 PM
Nice idea Eric, what circuit did you use for the Arduino meter?

Thanks Peter
Title: Re: Any Arduino ninjas out there...?
Post by: EBK on May 11, 2018, 04:51:03 PM
Quote from: peterc on May 11, 2018, 04:04:30 PM
Nice idea Eric, what circuit did you use for the Arduino meter?

Thanks Peter
The display is this:
Bi-Color (Red/Green) 24-Bar Bargraph w/I2C Backpack Kit (https://www.adafruit.com/product/1721)

The Arduino I used is this:
Adafruit Pro Trinket - 5V 16MHz (https://www.adafruit.com/product/2000), although an even simpler one would probably work. 

The compressor itself is based on a THAT Corp. Analog Engine:
http://www.thatcorp.com/pedals/4316%20Battery-Powered%20One%20Knob%20Squeezer.pdf

The Arduino measures the analog voltages at pins 5 and 12 of the Analog Engine chip, which are the RMS level detector output and the control voltage input, respectively.  These voltages are dB-scaled representations of the input level and gain of the compressor.  The Arduino code does some relatively simple math to figure out which bars to light in which color and sends that info to the I2C bar graph driver chip attached to the display, which handles the rest.  To reduce jitter, a median filter is built into the program.  I can dig up the code if you want to see it.

Also, the Arduino uses one pin to check the stomp switch state (the stomp switch pin that you would normally use to light your LED in a pedal circuit). 
Title: Re: Any Arduino ninjas out there...?
Post by: peterc on May 11, 2018, 05:23:35 PM
Ok thanks for the info

Peter
Title: Re: Any Arduino ninjas out there...?
Post by: gtr2 on May 11, 2018, 05:34:50 PM
The best thing about the Arduino is the community and the available libraries.  I have used the Arduino for fun stuff like temperature monitoring etc with a OLED display etc and also for getting into using it for attiny stuff.

There is such a high level of abstraction that hides a lot of the interworkings of what is happening.

I have since been using PICs for everything and am far happier.  The learning curve is far steeper, but you'll actually understand what is going on instead of copying and pasting someone's forum code, hoping it works, and have no idea how to fix it when it's not.

I would recommend these tutorials, they are excellent for the kind of stuff you want to do.  Just my two cents... Coming from the arduino platform...
http://www.gooligum.com.au/pic-tutorials

Arduino stuff is great and there are a ton of cool projects, pick your poison I guess...

Josh
Title: Re: Any Arduino ninjas out there...?
Post by: cooder on May 11, 2018, 10:42:43 PM
Thanks there's some cool info guys! I have to chew through that a bit as at this stage I haven't got the foggiest of ideas...
Very interesting though, seems a big topic to start with.
Quote from: gtr2 on May 11, 2018, 05:34:50 PM
The best thing about the Arduino is the community and the available libraries.  I have used the Arduino for fun stuff like temperature monitoring etc with a OLED display etc and also for getting into using it for attiny stuff.

There is such a high level of abstraction that hides a lot of the interworkings of what is happening.

I have since been using PICs for everything and am far happier.  The learning curve is far steeper, but you'll actually understand what is going on instead of copying and pasting someone's forum code, hoping it works, and have no idea how to fix it when it's not.

I would recommend these tutorials, they are excellent for the kind of stuff you want to do.  Just my two cents... Coming from the arduino platform...
http://www.gooligum.com.au/pic-tutorials

Arduino stuff is great and there are a ton of cool projects, pick your poison I guess...

Josh
Cheers Josh, I will as time allows have a look into all that. Those tutorials seem really good even though it's all a bit above my head at this stage, probably have to watch a few times and also get an idea what I actually want out of it.

For my normal relay bypass switching I couldn't be happier with your finish line boards, highly recommend them!
They work great for me and I never had one fail on me (which can't be said for the mail man though... >:().
Anyway, thanks so much!
Title: Re: Any Arduino ninjas out there...?
Post by: chromesphere on May 12, 2018, 02:15:56 AM
what other AVR has its own celebration day? :)

https://www.google.com/search?q=arduino+day&ie=utf-8&oe=utf-8&client=firefox-b

I bought one recently to mess around with, showed up a couple of days ago.  Ive already totally mastered it.  My LED is blinking away happily.  Go me. 

In all seriousness i think there is some scope for arduino / pedal projects.  Mod and delay could be possible with an AVR that has more ram (or external ram chip), it would still be interesting to see an attempt with arduino for delay.  I know its possible but i believe the delay is limited by RAM and sample rate.  Some sort of PWM effect could be interesting as well.

Title: Re: Any Arduino ninjas out there...?
Post by: EBK on May 12, 2018, 04:08:40 AM
If you want Arduino with more DSP
-like potential, you could look into the Teensy:
https://www.pjrc.com/teensy/index.html
Title: Re: Any Arduino ninjas out there...?
Post by: r-nox on May 12, 2018, 02:15:20 PM
My mailbox is arduino powered and talks to my vera edge. Sends me a text when I get mail. :)
Title: Re: Any Arduino ninjas out there...?
Post by: woolie on May 14, 2018, 12:52:48 PM
Quote from: chromesphere on May 12, 2018, 02:15:56 AM
what other AVR has its own celebration day? :)

https://www.google.com/search?q=arduino+day&ie=utf-8&oe=utf-8&client=firefox-b

I bought one recently to mess around with, showed up a couple of days ago.  Ive already totally mastered it.  My LED is blinking away happily.  Go me. 

In all seriousness i think there is some scope for arduino / pedal projects.  Mod and delay could be possible with an AVR that has more ram (or external ram chip), it would still be interesting to see an attempt with arduino for delay.  I know its possible but i believe the delay is limited by RAM and sample rate.  Some sort of PWM effect could be interesting as well.

PWM is very commonly done.


Sent from my iPad using Tapatalk Pro
Title: Re: Any Arduino ninjas out there...?
Post by: woolie on May 14, 2018, 12:53:57 PM
Quote from: EBK on May 12, 2018, 04:08:40 AM
If you want Arduino with more DSP
-like potential, you could look into the Teensy:
https://www.pjrc.com/teensy/index.html

Problem is, you'll need ADC/DAC.


Sent from my iPad using Tapatalk Pro
Title: Re: Any Arduino ninjas out there...?
Post by: orbitbot on May 20, 2018, 02:56:22 PM
I've been reading up on the subject for a while, but a lot of my projects and ideas are in different stages of WIP, so take the following with the appropriate disclaimer.

For more complex audio projects, unfortunately the basic arduinos, teensys and the like don't do too well for signal processing, the main problem is that their analog-to-digital (ADC) and digital-to-audio (DAC) converters are not fast/precise enough to achieve reasonable fidelity. As such, they work better for control or generative purposes, ie. oscillators or lo-fi synths. This includes the ESPs, since even if they're faster the ADCs and DACs are still not good enough.

There are separate chips, audio codecs (combination of DAC and ADC) that have the features required for signal processing, which can be found in separate projects;

Teensy's have a separate Audio board ( https://www.pjrc.com/store/teensy3_audio.html ) and a guitar-oriented board in https://www.tindie.com/products/Blackaddr/arduino-teensy-guitar-audio-shield/ . For arduino there's a few music-oriented boards around, but nothing guitar-specific as such as far as I'm aware. Though you can use arduino environment to program the teensy as well, so arguably the previous ones are kind of the same if you don't look too closely  ;)

Then expanding the horizon a bit, you can go on to raspberry pis etc with their own audio stuff, but at that point there's either different audio processing environments to consider or more system issues to consider since the RPIs are running a full keyboard, mouse and monitor operating system (if you wish).

I have a bunch of stuff like this that I'm slowly working on, unfortunately hindered by a lack of time/energy and reliable electronics skills...
Title: Re: Any Arduino ninjas out there...?
Post by: Dave_B on May 21, 2018, 05:00:06 PM
Quote from: woolie on May 14, 2018, 12:53:57 PM
Problem is, you'll need ADC/DAC.
The Teensy has both of those.  The newer models can run up to 240mhz, so it's possible to at least experiment with them as-is.
Title: Re: Any Arduino ninjas out there...?
Post by: woolie on May 21, 2018, 05:09:04 PM
Quote from: Dave_B on May 21, 2018, 05:00:06 PM
Quote from: woolie on May 14, 2018, 12:53:57 PM
Problem is, you'll need ADC/DAC.
The Teensy has both of those.  The newer models can run up to 240mhz, so it's possible to at least experiment with them as-is.


The teensy 3.6 is crazy impressive. An ARM Cortex m4? Crazy!
That being said the ADC's are 13 bit and the DAC are 12 bit resolution. Fun to play with but not really suitable for audio processing. IMHO of course.


Sent from my iPad using Tapatalk Pro
Title: Re: Any Arduino ninjas out there...?
Post by: Dave_B on May 21, 2018, 05:14:12 PM
Quote from: woolie on May 21, 2018, 05:09:04 PM
Quote from: Dave_B on May 21, 2018, 05:00:06 PM
Quote from: woolie on May 14, 2018, 12:53:57 PM
Problem is, you'll need ADC/DAC.
The Teensy has both of those.  The newer models can run up to 240mhz, so it's possible to at least experiment with them as-is.


The teensy 3.6 is crazy impressive. An ARM Cortex m4? Crazy!
That being said the ADC's are 13 bit and the DAC are 12 bit resolution. Fun to play with but not really suitable for audio processing. IMHO of course.


Sent from my iPad using Tapatalk Pro
Yep.  I totally agree.  Having said that, I still have a 12-bit Roland SDE 1000 delay that sounds pretty good.  :)
Title: Re: Any Arduino ninjas out there...?
Post by: EBRAddict on May 22, 2018, 12:42:15 AM
Quote from: Dave_B on May 21, 2018, 05:00:06 PM
Quote from: woolie on May 14, 2018, 12:53:57 PM
Problem is, you'll need ADC/DAC.
The Teensy has both of those.  The newer models can run up to 240mhz, so it's possible to at least experiment with them as-is.

The Teensy is the gold standard of Arduino framework boards. The community is the best, and Paul (the creator) was a contributor to many improvements in the Arduino framework. His stuff works.

Title: Re: Any Arduino ninjas out there...?
Post by: oip on May 22, 2018, 03:10:57 AM
i've got an arduino but haven't touched it for ages, successfully made it scroll text across a 2 line screen at one point.  had some ideas to make a MIDI sequencer but never got into it. 

definitely interested in PIC programming but damn it feels like deep water to jump into without a programming or hardware design background.

on a semi-related note there are a few very interesting diy DSP platforms like axoloti and bela.
Title: Re: Any Arduino ninjas out there...?
Post by: Dave_B on May 23, 2018, 05:09:47 AM
Quote from: oip on May 22, 2018, 03:10:57 AM
i've got an arduino but haven't touched it for ages, successfully made it scroll text across a 2 line screen at one point.  had some ideas to make a MIDI sequencer but never got into it. 

definitely interested in PIC programming but damn it feels like deep water to jump into without a programming or hardware design background.

on a semi-related note there are a few very interesting diy DSP platforms like axoloti and bela.

FWIW, I spent a few years with PICs and grew tired of the way their memory is set up in pages (which may no longer be the case). I switched to AVRs and found those much easier to code for.  This was all pre-Arduino and done in assembler, again FWIW.  :)

If I was to start from scratch today, I'd probably start with an ARM Cortex processor (what the Teensy boards use), or as you said a DSP platform.   
Title: Re: Any Arduino ninjas out there...?
Post by: woolie on May 23, 2018, 05:50:03 AM
Quote from: Dave_B on May 23, 2018, 05:09:47 AM
Quote from: oip on May 22, 2018, 03:10:57 AM
i've got an arduino but haven't touched it for ages, successfully made it scroll text across a 2 line screen at one point.  had some ideas to make a MIDI sequencer but never got into it. 

definitely interested in PIC programming but damn it feels like deep water to jump into without a programming or hardware design background.

on a semi-related note there are a few very interesting diy DSP platforms like axoloti and bela.

FWIW, I spent a few years with PICs and grew tired of the way their memory is set up in pages (which may no longer be the case). I switched to AVRs and found those much easier to code for.  This was all pre-Arduino and done in assembler, again FWIW.  :)

If I was to start from scratch today, I'd probably start with an ARM Cortex processor (what the Teensy boards use), or as you said a DSP platform.   

The bank switching is really only on 8 bit (and to a much lesser degree the 16 bit) M/CPUs. PICs also have a DSP family of chips, but as I've spent a lot of time on ARM, Cortex-M7 would be my first choice, maybe including the SHARC or Keystone stuff.


Sent from my iPad using Tapatalk Pro
Title: Re: Any Arduino ninjas out there...?
Post by: Dave_B on May 23, 2018, 06:29:13 AM
That makes sense.  This was around 1998, and I was learning on the PIC16 series.  I remember now that the other big attraction with the AVRs was the large number of registers.  I suppose these things only really matter if you're using assembler exclusively, which was a corner I painted myself into more than a few times. 
Title: Re: Any Arduino ninjas out there...?
Post by: EBRAddict on May 24, 2018, 05:06:36 PM
Right now Arrow has the legit Arduino Uno R3 (this is what 99% of people mean when they say Arduino) for $20 with free overnight shipping.

https://www.arrow.com/en/products/a000066/arduino-corporation (https://www.arrow.com/en/products/a000066/arduino-corporation)