user15454: I'm working on a morse transmitter (kind-a), this how it looks like now:

It's working, but is it correct? My piezo buzzer is 3-24V. I use the potentiometer as a volume control. The button is for transmitting morse code.
I've seen a way of wiring like this, not using any resistors, it feels wrong, is it correct?
https://cdn.sparkfun.com/assets/learn_tutorials/3/1/0/Arduino_circuit_11_01.png

user13432: You are using the Arduino basically as a power supply (in your wiring). The linked wiring is for PWM (analogWrite). This allows pulse output to generate tone (and volume). Here is a good reference. 

15454: <p>I'm working on a morse transmitter (kind-a), this how it looks like now:
<a href="https://i.stack.imgur.com/RYiYq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RYiYq.png" alt="Arduino-button-potentiometer-piezobuzzer"></a></p>

<p>It's working, but is it correct? My piezo buzzer is 3-24V. I use the potentiometer as a volume control. The button is for transmitting morse code.</p>

<p>I've seen a way of wiring like this, not using any resistors, it feels wrong, is it correct?
<a href="https://cdn.sparkfun.com/assets/learn_tutorials/3/1/0/Arduino_circuit_11_01.png" rel="nofollow noreferrer">https://cdn.sparkfun.com/assets/learn_tutorials/3/1/0/Arduino_circuit_11_01.png</a></p>
 13432: <p>You are using the Arduino basically as a power supply (in your wiring). The linked wiring is for PWM (analogWrite). This allows pulse output to generate tone (and volume). Here is a good <a href="http://www.varesano.net/blog/fabio/pwm-and-arduino-fading-led-and-playing-melodies-piezo-speaker" rel="nofollow">reference</a>. </p>
