Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Dyne's Audio Modulator Circuit
#1
I have added a wiki page describing the simple Audio Modulator Circuit that I made for Artie Deco (mostly based on info from the Arduino forums), just in case someone wants to use it on their droids.  It's just a quick and dirty circuit that feeds the audio level back into an analog input on his Artieduino.  I use it to make his neopixel eye flash "in time" with his sound effects.

There are far superior or at least more correct ways to do this, but this is probably the simplest and easiest, requiring the least knowledge of electronics (and I explain how most of it works anyway).

The page is still a work in progress, but a lot of info is there already.  I still need to write more in the coding section, as I need to extract Artie's current code into something self-contained that people can adapt more easily.  I will probably also add more images.  The page has been linked on the main page of the wiki, in the electronics section.

Let me know if anything is unclear.
Reply
#2
Awesome! I look forward to checking it out Big Grin
Reply
#3
Cool, thanks for sharing! more wiki content is always good.

That's also the general idea for the electronics/mechanical sections. We're building a variety of droids, so hopfully we can collect generally useful techniques that are good for a wide variety of droids.

That's actually very similar to what my Lego BB-8 does. Ardunio analog input to get a (single in my case) channel from my audio signal then use that to drive the neopixel in BB-8's vocoder. I was considering that post, but I guess you saved me time Smile
Reply
#4
Hmm, I wonder - if you only used one channel instead of both, then you could ditch the resistor to the analog input, or maybe make it smaller - then you'd have a broader range?

I don't remember what BB-8's range is, but I think it uses a decent amount of the ADC spectrum - I'm using a headphone output from my phone, which is adjustable loudness.
Reply
#5
(09-18-2016, 12:39 PM)kresty Wrote: Hmm, I wonder - if you only used one channel instead of both, then you could ditch the resistor to the analog input, or maybe make it smaller - then you'd have a broader range?

I didn't understand your question at first (I wasn't sure what you meant by "if you only used one channel" since I AM only using one left/right audio channel).  But that confusion got me to looking at things in more detail rather than merely describing what I was currently using.

It turns out that, yes, I have been doing something really stupid.

I assembled this circuit out of a few different circuits I'd found.  I stuck it into Artie's wiring plan, but due to the way Fritzing represented the original sound board, I didn't actually put in the entire circuit (the "ground" connections for the audio were omitted, or rather non-obvious, and the labeling didn't specify what connected to the inputs).  Since I had no way to test this setup at that point, I then ignored the circuit for awhile and worked on other things.  I also changed sound board plans.  I subsequently lost track of the original circuits I'd found and their sources, leaving me to work only from what I'd put into Artie's wiring diagrams.

As I had little time to spare by the time I got around to building it, I just fiddled around until I got something that more or less worked, and didn't think very deeply about what was going on (especially with the resistors in the input section).

Now that I'm looking in more detail, I can see that the input side of the circuit is just another voltage divider structure. What it does depends on what you connect to it.  It was supposed to be connected as a stereo-to-mono converter.  I don't have it wired that way, and couldn't easily sort that problem out from the (incomplete) schematic that I was using.  Here's a better one:

[Image: yXfvKqgl.jpg]


Instead of averaging between the left and right channels as the above version does (which mixes them to mono), I've wired the input side as a straight up voltage divider, literally halving whatever voltage comes in from the ONE audio channel I have hooked up.

The circuit will actually work that way, but it obviously reduces the range of voltages available for the Arduino to interpret, thus reducing the granularity of the lights and making the signal to noise ratio even worse than it already was.  That explains why debugging wasn't showing the range of values I'd expected to see.

I'll work on revising the wiki article.  Thanks for pointing it out in a way that forced me to actually think about it.


Edit: As far as adjusting the values of R1 and R2 goes, as long as they are equal (including if both are removed) then the capacitor will always see a voltage halfway between the inputs.  It you change their relative values or eliminate one of them (but keep the input itself), that will weight the value that the capacitor sees more toward one input's value or the other.  In no event will changing those resistors increase the voltage range from what the audio source supplies.  After all, it's a voltage divider setup, not a voltage multiplier.  If I wire the inputs properly, I'll get a broader range than what I have now.  But still no broader than ± 1 volt or ±0.2 volts, depending on the signal being supplied.  I need to add an amplifier to the circuit if I want to alter that.

I suspect that the exact values for R1 and R2 relate to the desired impedance of the circuit.  If the impedance is lower than the audio source was designed to handle, then my understanding is that the audio source will essentially be shorting out, which could damage it.  I didn't calculate those values and don't understand impedance well enough to do so, or even decide which values are good and which are not.  So I'm loathe to alter them.
Reply
#6
I was reasonably confused, kind of ignoring R3 or R4 and thinking that R1/R4 would act like a voltage divider as well. I'm still confused, but less so, sorry, my mistake Smile I know enough to be dangerous with electronics.

I just got rid of the R1 (or was it R2?) and only used Right or Left in because I figured they were about the same. Doesn't really matter if you have both or one. Unless you had a wildly unbalanced soundtrack you were playing.

I have a bigger level because I'm using the headphone (not line) out and so my peaks are higher voltage.
Reply
#7
(09-19-2016, 07:45 PM)kresty Wrote:  I know enough to be dangerous with electronics.

I am much the same, heh.
Reply
#8
BTW: I was just noticing that you're still about half the electronics content in the Wiki, so many thanks for providing that!
Reply
#9
(03-01-2017, 10:11 PM)kresty Wrote: BTW: I was just noticing that you're still about half the electronics content in the Wiki, so many thanks for providing that!
I still need to finish that article, though.

It's on my list, I swear! No, No please don't get up. Storm troopers, here?

Oh no, I've been shot!
Reply
#10
Ah, so by that quote I take it to mean that your next electronics post is going to be how to drive a '3PO head light & sounds? Wow! ;-)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)