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

  • 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
    Commented Jan 10, 2016 at 14:02
  • Hello and welcome. Have a look at these related posts: raspberrypi.stackexchange.com/questions/25957/… (albeit 60 mA) and raspberrypi.stackexchange.com/questions/27928/… (driving a relay, but the idea is the same, the most simple transistor circuit for this task)
    – Ghanima
    Commented Jan 10, 2016 at 14:08
  • Can't you just get a buzzer that's 3.3v ?
    – allegory
    Commented Jan 10, 2016 at 23:43
  • 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
    Commented Jan 11, 2016 at 7:04
  • 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
    Commented Jan 11, 2016 at 22:29


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.