Arduboy Audio Out to Speaker (for XL)

How to drive a speaker from all possible conditions from the Arduboy.

Some games have differential signaling. Others just use simple pwm on one or the other pins, and and some use PWM on both.

How to account for all these situations?

If not for the differential signaling method, you could do something simple like this:

But a differential signal would cancel itself out, which is the problem I’m trying to fix now.

Actually, maybe the solution is to simply invert one of the pins…

Because the PWM signaling methods won’t be effected by this?

Will this work and if so does anyone have a clue for a part number of op-amp to use like this?

Didn’t the Arduboy originally just wire both speaker terminals to the micro (one pin to “left” and one pin to “right”)? Do you really need to drive the speaker single-ended?

Anyway assuming you do need a single-ended output, yes, you could just invert one side, and since it’s a digital signal, you don’t need an opamp, just an inverter.


The Arduboy uses a piezoelectric speaker. And I want to now use an electromagnetic. So, maybe?

I guess I didn’t think it could be that easy I’ll test it out.

And, what do you mean by “inverter” are there discrete components that do this?

Using the speaker directly to gpio instead of the piezo works fine, and the volume is plenty loud especially within the case.

The inverted signal / combining method would be useful as then it could be amplified, but it seems like that’s not necessary.

(I actually did try this first, but it turns out the speaker I was testing with… was broken lol)

1 Like

Yeah, I meant an inverter like a 7404… these days you can get them as single gates:

I’m not actually recommending that, though. Just use a working speaker :sweat_smile:

1 Like

Nice, good to know for the future! #learning

This is where I landed, seems plenty loud:

If, as you say, the pins are able to safely drive the speaker directly with sufficient volume, then you could probably get away with just a single trim pot. This would be more in keeping with the Arduboy, since setting one pin to an input would mute the sound, whereas your circuit wouldn’t.


In that case I’m definitely getting one “when its done and when its fun”

My tinitus makes it so I can’t hear the piezo much at all.

If it helps I drove an 8ohm mini metal speaker wired the same as the piezo and it sounded great on all the different audio methods. Just haven’t had time to finish my homemade Arduboy (I enjoy coding more than hardware).

The XL has the audio jack too so headphones / line out will be a thing.

1 Like

If the audio jack could be used as line-in too then you could have 2 player multiplayer over a 3.5mm audio cable :slight_smile:

Over software serial yup.

Trying to do hardware serial over the usb c cable.

1 Like