1

I am new to Raspberry Pi. I recently wanted to connect a active buzzer (5V 30mA) like this: BUZZ to my Raspberry.

I am not sure should I use a resistor on the way to +5v pin and DATA GPIO pin. (like it was with DS18B20+ thermometer). I have searched the Internet and found that there is no resistor on the way, but the best practices tells me that there should be some Resistor on the way to DATA pin. I was thinking about 1k resistor on the DATA pin. Would this be ok? Thank you

NightKn8
  • 151
  • 5
  • Do not connect like that (5V <-> resistor <-> GPIO). The GPIOs are not 5V tolerate and you may trash the pi. There may be a way to do this using a voltage divider with two resistors but I am not sure. The ideal solution is I think a darlington transistor array chip, these are very cheap (<$2) but you probably have to order them from somewhere. – goldilocks Jan 10 '16 at 14:02
  • Hello and welcome. Have a look at these related posts: http://raspberrypi.stackexchange.com/questions/25957/can-rasberry-pi-drive-a-pcb-speaker-directly/25958#25958 (albeit 60 mA) and http://raspberrypi.stackexchange.com/questions/27928/power-a-5v-relay-from-gpio-pins/28201 (driving a relay, but the idea is the same, the most simple transistor circuit for this task) – Ghanima Jan 10 '16 at 14:08
  • So why there is 5v pin on raspberry? On some tutorials (from more believable sources) I saw that someone did connect directly: vcc to 5v, gnd to gnd and signal to gpio pin. Well I recently connected a thermometer to 5v pin and data to gpio pin with 4.7k resistor and it works, but what you are telling me is that it can damage the pi, so why there are those 5v things? – NightKn8 Jan 11 '16 at 07:04
  • Can't you just get a buzzer that's 3.3v ? – allegory Jan 10 '16 at 23:43
  • Ok so after searching the WWW I have found some examples with a usage of a transistor LINK so a bit of a modification and: LINK. (the buzzer is 5v and If is 30mA). This looks quite promising but still I am not sure if this will do. I still need to order those transistors that I forgot about... – NightKn8 Jan 11 '16 at 22:29
  • Ok so I have connected the buzzer but I am stuck, I don't know where I need to connect the Signal pin (blue) IMAGE that will be controlled by pin 27. I have tried to connect it to the middle leg of the NPN transistor but it seams to not work. – NightKn8 Jan 17 '16 at 19:57

0 Answers0