I was working adding a buzzer support to BBBMini and I this is how you can add too. This is a two parts Hardware and Software.
First, to avoid problems with current, you will need a little circuit with:
- 1K resistor
- 1NPN transsistor(in my case BC 548)
- 1 5V buzzer - I'm using this one: http://www.banggood.com/5V-Active-Buzzer-Alarm-Beeper-With-Cable-for-FPV-Racer-Quadcopter-Drone-DIY-p-1032123.html
In my case instead to use a PCB I create this circuit using a servo cable as follow:
On BBB Board, I cut the last pin header(PWM output 12) and solder a cable from pin P8_32 to PWM output 12 - with that, the servo cable fit perfectly.
Part 1 - Linux
First of all, we need a DTB file to enable pin8_32 as output( file attached BBBMINI-BUZZER.dts )
and them compile dtc -O dtb -o /lib/firmware/BBBMINI-BUZZER-00A0.dtbo -b 0 -@ BBBMINI-BUZZER.dts
To enable, you must load the dtbs with echo BBBMINI-BUZZER > /sys/devices/platform/bone_capemgr/slots
In my case I put this on /etc/rc.d/rc.local file
Part 2 - Arducopter
I submit my code to ardupilot master branch, so I will update when wil be avalable.
for tests, I'm attaching the 3 files (Buzzer.cpp, Buzzer.h and AP_Notify,cpp)
This is a video demonstrating
1) The servo cable is a workaround, a PCB is better but I think the servo cable structure can be improved.
2) The buzzer is a 5 volts
Good stuff! I thought about adding a buzzer in the past, great you did it and thanks for sharing!