OpenMarine
RPI, OpenCPN and buzzer - Printable Version

+- OpenMarine (https://forum.openmarine.net)
+-- Forum: OpenPlotter (https://forum.openmarine.net/forumdisplay.php?fid=1)
+--- Forum: General discussion (https://forum.openmarine.net/forumdisplay.php?fid=2)
+--- Thread: RPI, OpenCPN and buzzer (/showthread.php?tid=1065)

Pages: 1 2 3


RPI, OpenCPN and buzzer - Douz - 2018-03-13

Bonjour,
Je voudrais avoir un buzzer au lieu de la sonnerie de l'alarme AIS. (Je n'ai aucun amplificateur).
Je pensais que c'était simple avec GPIO, mais en fait, je ne sais pas comment faire ça.
Une idée?


RE: RPI, OpenCPN and buzzer - abarrow - 2018-03-13

You would need something like a transistor to use as a switch for the buzzer. RPI GPIO pins don't provide enough current for a buzzer directly.


RE: RPI, OpenCPN and buzzer - Douz - 2018-03-13

(2018-03-13, 09:34 PM)abarrow Wrote: You would need something like a transistor to use as a switch for the buzzer. RPI GPIO pins don't provide enough current for a buzzer directly.

I know. But my first problem is to open a GPIO pin...


RE: RPI, OpenCPN and buzzer - abarrow - 2018-03-13

Here is a good thread on doing it using PWM. GPIO pins on RPIs are limited to a safe current of 16ma, so you won't get much volume without a transistor to switch the power to the buzzer.

https://www.raspberrypi.org/forums/viewtopic.php?t=40515


RE: RPI, OpenCPN and buzzer - Douz - 2018-03-13

Thank you, but how AIS alarm can switch on GPIO pin ?


RE: RPI, OpenCPN and buzzer - abarrow - 2018-03-13

Don't know for sure, but I would think you could do it with Node Red.


RE: RPI, OpenCPN and buzzer - Douz - 2018-03-13

Node-red, that's what I was thinking about. But I don't know how to do that.


RE: RPI, OpenCPN and buzzer - jim321 - 2018-03-14

""Thank you, but how AIS alarm can switch on GPIO pin ?""

you can look into this node i haven't played with it yet but looks like it would work, probably work for anchor watch too..
https://flows.nodered.org/node/node-red-contrib-geofence
https://www.npmjs.com/package/node-red-node-geofence

opencpn has AIS "sound cpa alarm"


RE: RPI, OpenCPN and buzzer - Douz - 2018-03-14

OK, but I think it's too complicated.
Isn't it possible to use OpenCPN alarm system for switching on a GPIO pin?


RE: RPI, OpenCPN and buzzer - jim321 - 2018-03-14

http://forum.openmarine.net/showthread.php?tid=1032
if i had something built already to do it i would give it to you but i don't sorry
https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:toolbar_buttons:ais#when_exactly_is_an_alarm_activated