I use Rasperry Pi / Arduino as power source (5V,3.3V) and for input/output (GPIO, Arduino headers). I reached a point when I realized, that what's in my mind needs diodes.
I'm building a morse transmitter/reciever trainer, and there will be two options to drive a piezo: 1. when the program outputs morse code, 2. when I press a button and the signal is going to the Piezo and to a GPIO input. The two lines needs to have diodes so when one line is working it can't get through the other
I read that Raspberry 5V current is about 200-300mA. Here I read the Arduino 5V current is about 400 mA.
In the shop there are plenty possibilities. I found one, BAV21. I can't make much out from it's page, but they wrote two data: 200V and 600mA. My logic is: 200V bigger than 5V, 600mA is bigger than 400mA. It should be OK.
Is it good for what I mean to do? Is it too low, too much? Is there more suiting diode? How to chose a diode for breadboarding?
UPDATE 1:
This is what I have in mind. This is only using the Raspberry Pi. I wrote a program in Java ME 8, which can recieve (GPIO 17) and send (GPIO 22) morse signal.
simulate this circuit – Schematic created using CircuitLab
The best would be if I could drive the piezo from the 5V with the GPIO22. How could I do that? With an NPN transistor perhaps?
(Another thread about part of this circuit is going on here.)