Page 1 of 1

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

Posted: Sun Jan 12, 2020 12:16 am
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Mon Jan 13, 2020 10:24 am
by odroid
Did you set the GPIO to output mode?
https://wiki.odroid.com/odroid-xu4/appl ... ent_30pins

Re: Odroid XU4 buzzer not working, but it should

Posted: Mon Jan 13, 2020 9:03 pm
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Tue Jan 14, 2020 11:19 am
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Tue Jan 14, 2020 4:04 pm
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?

Re: Odroid XU4 buzzer not working, but it should

Posted: Tue Jan 14, 2020 6:41 pm
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Tue Jan 14, 2020 7:43 pm
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Wed Jan 15, 2020 2:12 am
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Wed Jan 15, 2020 11:17 am
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Wed Jan 15, 2020 10:03 pm
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Thu Jan 16, 2020 2:50 am
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.

Re: Odroid XU4 buzzer not working, but it should

Posted: Thu Jan 16, 2020 11:54 am
by odroid
Glad to hear that.

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

Posted: Thu Jan 16, 2020 3:55 pm
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

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

Posted: Thu Jan 16, 2020 6:31 pm
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