[SOLVED] Odroid XU4 buzzer not working, but it should

Post Reply
ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

[SOLVED] Odroid XU4 buzzer not working, but it should

Post by ramusters »

Hello everyone. Ramusters from the Netherlands here!

I have a strange problem and i have no idea why the buzzer does not work.

When I connect an active buzzer to pin 0 (physical pin5) and ground (physical pin 30), I measure 1.4V and 2mA but the buzzer does not work.

When I then connect the buzzer to a lab power supply limited to 1.4V and 2mA, it does work. Even at 1.0V, 1mA it works.

What am I missing? I do not understand why the buzzer does not work.

User avatar
odroid
Site Admin
Posts: 35594
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1200 times
Been thanked: 877 times
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by odroid »

Did you set the GPIO to output mode?
https://wiki.odroid.com/odroid-xu4/appl ... ent_30pins

ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by ramusters »

Yes, I did set it to output mode. It is turning on and you can hear a very soft sound. But at the same measured current and voltage on the bench power supply, the sound is normal/high.

User avatar
odroid
Site Admin
Posts: 35594
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1200 times
Been thanked: 877 times
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by odroid »

Can you show us the buzzer datasheet?
As far as I know, most buzzer needs over 20mA to make a loud sound level while XU4 SoC GPIO max current is only few mA.

I think the lab power supply seems to have a poor accuracy when the load is very light.
So it is worth to measure the current with a good DMM again.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by o_lampe »

Using a level-shifter board or separate driver/relais will cure the problem.
@odroid Is the GPIO able to drive a small relais? Any recommendations?

ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by ramusters »

odroid wrote:
Tue Jan 14, 2020 11:19 am
Can you show us the buzzer datasheet?
As far as I know, most buzzer needs over 20mA to make a loud sound level while XU4 SoC GPIO max current is only few mA.

I think the lab power supply seems to have a poor accuracy when the load is very light.
So it is worth to measure the current with a good DMM again.
I will measure again with a multimeter. Thanks.

Datasheet: https://datasheet.lcsc.com/szlcsc/18061 ... 200209.pdf
It appears the lab power supply may have been innacurrate, since the minimum rated voltage according to the datasheet is 4V.

User avatar
odroid
Site Admin
Posts: 35594
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1200 times
Been thanked: 877 times
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by odroid »

@ramusters,
Right. Something could be wrong with the lab power supply.

@o_lampe,
No. the level shifter IC TXS0108E has much lower current output. It might handle less than 1mA probably.
You need a transistor or FET to drive a load.

ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by ramusters »

Just tested the led on a 1.5V battery (1.68V) and the buzzer went off.
Measured the voltage with a multimeter. 1.68V.
When I connect the buzzer to gpio pins (ground and pin 0 on high) it does not go off but you can hear a very faint sound.

Even at max 3mA according to the lab power supply (and multimeter), the buzzer goes off.

It should work with the GPIO pins then!

I am using odroid_wiringpi.digitalwrite(0, 1) by the way.

Edit:
It appears to be a software issue. If I connect the buzzer to the 1.8V (non-gpio #) pin and ground, it works fine.
When I then connect it to a GPIO pin and 1.8V and set the GPIO pin to low the voltage differential should be 1.8V and it should work just the same way. But it doesn't.
The volume is a little bit higher though. Probably because the voltage differential is higher than when connecting to GPIO (on 'high') and ground.

I suspect wiringpi is using some sort of PWM that isnt keeping the voltage 0 or 1.8 100% of the time.

User avatar
odroid
Site Admin
Posts: 35594
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1200 times
Been thanked: 877 times
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by odroid »

Very weird.
We could observe the GPIO voltage level with an oscilloscope and it was clearly 0.0V and 1.8Volt.
Can you show us your WiringPi test code?
You need to set the direction first and output level later.

It is also worth to check "lsmod" output to see if any kernel driver modules might use some GPIO pins for other purpose or not.

ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by ramusters »

odroid wrote:
Wed Jan 15, 2020 11:17 am
Very weird.
We could observe the GPIO voltage level with an oscilloscope and it was clearly 0.0V and 1.8Volt.
Can you show us your WiringPi test code?
You need to set the direction first and output level later.

It is also worth to check "lsmod" output to see if any kernel driver modules might use some GPIO pins for other purpose or not.
Import wiringpi_odroid as Wpi

Wpi.pinMode(11, 1) #Pin 11 to output

Wpi.digitalWrite(11, 1) #Pin 11 to high

Will check lsmod when I am home.

ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by ramusters »

I used a 2N222 transistor with emitter to ground, base to a 1.8V Gpio pin and the collector to the 5V pin with buzzer inbetween. When the gpio pin is set to 'high', the buzzer will go off, untill the gpio pin is set to low.

This schematic makes it work for me, so my problem is solved. Thanks everyone for the input.

User avatar
odroid
Site Admin
Posts: 35594
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 1200 times
Been thanked: 877 times
Contact:

Re: Odroid XU4 buzzer not working, but it should

Post by odroid »

Glad to hear that.

o_lampe
Posts: 175
Joined: Wed Jan 01, 2020 12:35 am
languages_spoken: english german
ODROIDs: MC1 solo
Has thanked: 11 times
Been thanked: 16 times
Contact:

Re: [SOLVED] Odroid XU4 buzzer not working, but it should

Post by o_lampe »

What is the current consumption with the buzzer at 5V minus Uce of the transistor?
It might be better to add a resistor in series...

Just my 2Cent
Olaf

ramusters
Posts: 7
Joined: Sun Jan 12, 2020 12:10 am
languages_spoken: english, dutch
ODROIDs: Odroid XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: [SOLVED] Odroid XU4 buzzer not working, but it should

Post by ramusters »

o_lampe wrote:
Thu Jan 16, 2020 3:55 pm
What is the current consumption with the buzzer at 5V minus Uce of the transistor?
It might be better to add a resistor in series...

Just my 2Cent
Olaf
About 20-40mA, not too high

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest