Jetson xavier NX with a buzzer

Hello!

I’m trying to connect a buzzer to jetson xavier NX through Jetson.GPIO library in python, I tried a lot and I couldn’t seem to get it right, I also made a lot of research about this and couldn’t find any useful information.

Can you help me?
I’m trying to connect a buzzer to GPIO so I can control when it beeps and when it stops through python.

Thank you for your time!

I have poor experience with GPIO settings so I may not further help, but you may tell if you want to use an active buzzer that will just make a given sound when powered, or a passive buzzer that would require a PWM output.

I want to use a buzzer as output, one pin on ground and the other on a gpio pin, when I trigger it as HIGH it will beep, when I trigger it as LOW it will stop, simple but I couldn’t get it right for some unknown issue that I don’t know how to fix.

hello mohammad.tayseer.comn,

you may refer to Topic 144550, for several ways to access GPIOs. such as, kernel APIs, python scripts, C++ samples.
thanks

I’ve tried the solutions they provided in the jetson-gpio github page, it seems that the buzzer works but there is a very low sound going from it, just like “tssssss”.
I’ve tested the buzzer by connecting it to 3.3V and 5V, it is working properly, but when I try to use it on board pin 12, the sound is so low and like a tssss sound, not a beep.
Please help me

This is my code

import RPi.GPIO as GPIO
import time
buz = 12 # BOARD pin 12

def main():
# Pin Setup:
GPIO.setmode(GPIO.BOARD) # BOARD pin-numbering scheme
GPIO.setup(buz, GPIO.OUT) # buz pin set as output

GPIO.output(buz, GPIO.LOW)
print("Starting demo now! Press CTRL+C to exit")
try:
    while True:
        GPIO.output(buz, GPIO.HIGH)
        time.sleep(1)
        GPIO.output(buz, GPIO.LOW)
finally:
    GPIO.cleanup()  # cleanup all GPIO

if name == ‘main’:
main()

hello mohammad.tayseer.comn,

since the voltage of GPIO pin 12 is 3.3V, could you please setup and probe the pin to check if there’s voltage drops.
thanks

I was able to use the GPIO pin 12 using a npn transistor, since the Jetson can’t give enough current to open the alarm sound.
I’ve used the transistor as a switch, so when I give current to the base the switch will open and the alarm will go on.
Thank you in advance!!