Library or manual code for speaker / amplifier with sensor, voltage and ground (Arduino UNO)

Hi,
I'm looking for the correct library to use (or help with raw code if necessary) for use with my arduino compatible speaker / amplifier.

Tone.h is designed for only voltage and ground and can't be used on my board because of incompatibility with Servo.

BobaBlox.h is same or can be altered to "connect the speaker across two pins." (getting closer... maybe what I want?)

I believe both are designed for use with a Piezo, where I have a dedicated speaker, with dedicated pins labed SVG (Sensor, Voltage, Ground) I'm nearly sure. Speaker has a volume knob built in.

I want to be able to send (Frequency, Duration) through a digital pin output to the sensor, with the input being coded into my 'void loop()'.

Attached photo.
Look forward to your input.

There is an alternative servo library if not mistaken. Do a search.

Your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for advice on (nor for problems with) your project.

1 Like

ServoTimer2 is the alternative library.

Tried this. Unfortunately would mean rewrite of about 70% of my code, but still doesn't solve issue of Tone library being designed for 2 pins not 3... I have a further update on that topic too.

p.s. this will probably be useful for others researching this topic anyway. tyvm :slight_smile:

I've got the speaker playing tones using only the voltage pin and some code I found online. However it's very quiet, which is to be expected after reading documentation for BobaBlox. Now to experiment with increasing the volume without blowing up the speaker. Open to any advice.

V connects to +v
G connects to gnd
S - signal, connects to your digital output pin

1 Like

Unit working.

Connecting voltage on this side didn't work and resistor made it too quiet.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.