I'm trying to do this: Play a Melody using the tone() function and this is the hardware required:
Arduino board
8 ohm small speaker
100 ohm resistor
hook-up wire
But I only have 2 speakers made of 4 Ohm and a resistances of R. 470 ohm, R. 1 K and R. 10K.
I think I have managed to put the speakers connected in series to get 8 Ohm but now I don't know which resistance I could use to get the best results.
I would be very pleased if someone could clarify that.
Use four 470s, connected in parallel, will be a little over 117 ohm. With the 8 ohms from the speakers, will be at 40mA, right at the edge of the pin output limits.
Use a blocking capacitor so the speaker only sees AC. Arduino pin to 150 ohm resistor, the to 47uF cap (+ve),
-ve side of cap to speaker, other side of speaker to ground.
You can use multiple pins each with 150 ohm resistor to the cap's +ve terminal to increase the power - just
drive the pins in unison to get more current to speaker.