0

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.

schematic

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.)

adtewa
  • 11
  • 3
  • You don't need diodes, rather you should simply not have any connection to the 5v supply as was already pointed out to you when you asked this on the raspberry pi site. Use the 3.3v supply. – Chris Stratton Dec 13 '15 at 22:05

2 Answers2

1

That one will work. Alternatives are 1N4148, 1N914, 1N4001 (or 400x).

Your application is for low frequency, and the differences between diodes won't have much impact on your system. You are correct that choosing one with a higher voltage and current rating is appropriate.

Note that if you can't obtain one, using an NPN transistor will usually work -- connect the base to the emitter, and use that as the anode ('+'), and use the collector as the cathode.

jp314
  • 18,395
  • 17
  • 46
1

Welcome aboard, Simon.

First, if the piezo has a built-in oscillator to generate the tone for the piezo element then your setup will be fairly simple. If not the micro needs to generate the on-off pulse train at a frequency in the range that the piezo will produce a decent tone.

Next, you can sort out any conflict between the micro and the manual feed to the piezo in the software. The piezo will be driven by an output pin. Your button will feed into the micro and sort it out in the code.

Next, that article tells you that the max current from each pin is 40 mA. The 200 - 300 mA is total package current for all pins and the chip itself. If your buzzer requires more than 40 mA then you need a transistor to drive it.

To address the diodes - should you still want them: For a simple application like this you need to pick a diode which will withstand the maximum reverse voltage it is likely to see in operation and will handle the maximum current it will see in operation. Your diode logic is correct.

Transistor
  • 168,990
  • 12
  • 186
  • 385
  • Thanks your answer. [This](http://www.hestore.hu/files/KPI-G2330E.pdf) is my piezo. It's maximum current is 10mA. I don't think it has oscillator, but it emits sound with just giving it the 5V. Before I used oscillating signal from Arduino to drive it. I'm not yet familiar with transistors :). Maybe I buy one of those too. If you say a single pin is 40 mA max, both on Arduino and Raspberry, even the 5V, than a 100mA diode would work too. – adtewa Dec 13 '15 at 20:35
  • That would be fine. As jp314 says any of the small signal diodes would work. Why don't you edit your original question and add in a simple schematic of that part of your circuit using the built-in schematic editor. Use the triangular logic buffer symbol to signify an input or output. That will prompt a few more comments and design tips for you. Put "edit" above your new part so that readers can see that some of the answers / comments were pre-edit. – Transistor Dec 13 '15 at 20:48