Der Modul RPI-OUT2-D kann auf einem Raspberry Pi mit 40 poligem Stecker aufgesteckt werden. Es sind folgende Ausgänge realisiert : . Sirene für Piezosignalgeber z.B.: KEPO PCT-G5720-6320 Conrad 710666 - 62 . -1- OptoMOS AQZ202D oder OptoMOS AQZ204D oder Dual Power SCR Thyristor CPC1976 . -2- OptoMOS AQZ202D oder OptoMOS AQZ204D oder Dual Power SCR Thyristor CPC1976 Pos Name Wert Gehäuse C1 100µF 1210 Mouser 963-JMK325ABJ107MM-P C2 100µF 1210 Mouser 963-JMK325ABJ107MM-P C3 100µF 1210 Mouser 963-JMK325ABJ107MM-P C4 10nF 0805 IC1 74HCT132 DIL14 IC2 74HCT132 DIL14 IC3 74HCT14 DIL14 K1 KLEMME2POL KLEMME2 Conrad 731986 - 62 K2 KLEMME2POL KLEMME2 Conrad 731986 - 62 K3 KLEMME2POL KLEMME2 Conrad 731091 - 62 K5 Raspberry PI 40pol. Conrad 1094904 - 62 R1 330 0805 R2 330 0805 R7 250K TRIMMER_PTC10LV R12 10K 0805 RE1 Sockel Conrad 505418 - 62 RE2 Sockel Conrad 505418 - 62 https://aisler.net/p/CCIEBQGD Software für Raspberry PI : https://www.elektronik-kompendium.de/sites/raspberry-pi/2202121.htm Initalisierung : pigs mode 2 w pigs mode 3 w pigs mode 4 w pigs mode 5 w Ansteuerung : Generelle Freigabe pig w 4 0 Sirene: pigs w 5 1 Out -1-: pigs w 2 1 Out -2-: pigs w 3 1 Generelles Sperren pigs w 4 1 Mit R7 kann die Frequenz für den Piezosignalgeber optimiert werden (4kHz für KEPO PCT-G5720-6320), Lautstärke: 104dB ! Nachbau und Betrieb auf eigene Veranwortung und Risiko!
:
Bearbeitet durch User
Rasperry und Ausgabemodul passen ins Hifiberry-Gehäuse wenn die Optomos-Modulr direkt eingelötet werden. https://www.conrad.at/de/p/hifiberry-rb-hifiberry-case-sbc-gehaeuse-passend-fuer-raspberry-pi-schwarz-1427397.html
Opto-MOS wurden fix eingelötet und passen mit einem Raspberry PI im ein Hifiberry-Gehäuse. Mit einer Heißklebepistole wurde über die Anschlüsse der Ausgänge -1- und -2- (Opto-MOS) eine Isolationsschichte aufgetragen. Diese isoliert in Richtung Raspberry Pi. Im Bild https://www.mikrocontroller.net/attachment/494888/RPI-OUT2-D_Unterseite.jpg erstreckte sich die Isolierung nur über die Klemmen -1- und -2- und nicht über die Opto-MOS Ausgänge!
Leiterplatte (RPI-OUT2-E) : https://aisler.net/p/VVCFXWBJ Aufruf: sirene ton(ms) toff(ms) Dauer: 120s
1 | #include <stdio.h> |
2 | #include <stdlib.h> |
3 | #include <unistd.h> |
4 | #include <string.h> |
5 | #include <pigpiod_if2.h> |
6 | |
7 | void init(int pi) |
8 | {
|
9 | set_mode(pi,4,PI_OUTPUT); // set PIN4 to output |
10 | gpio_write(pi,4,1); // set common DISABLE |
11 | |
12 | set_mode(pi,2,PI_OUTPUT); // set PIN2 to output |
13 | gpio_write(pi,2,0); // turn off OUT1 |
14 | |
15 | set_mode(pi,3,PI_OUTPUT); // set PIN3 to output |
16 | gpio_write(pi,3,0); // turn off OUT2 |
17 | |
18 | set_mode(pi,5,PI_OUTPUT); // set PIN5 to output |
19 | gpio_write(pi,5,0); // turn of Sirene |
20 | |
21 | gpio_write(pi,4,0); // clear common DISABLE |
22 | }
|
23 | |
24 | void help(void) |
25 | {
|
26 | printf("rpi-sirene v1.0\r\n\r\n"); |
27 | printf("\tsirene ton[ms] toff[ms]\r\n"); |
28 | printf("\tsirene -h => help\r\n"); |
29 | printf("\tsirene -i => init\r\n\r\n"); |
30 | }
|
31 | |
32 | int main(int argc, char *argv[]) |
33 | {
|
34 | int on=200; |
35 | int off=80; |
36 | int cyc=10; |
37 | int pi; |
38 | |
39 | pi = pigpio_start(0,0); /* Connect to local Pi. */ |
40 | |
41 | if (pi < 0) |
42 | {
|
43 | printf("Can't connect to pigpio daemon\r\n"); |
44 | return 1; |
45 | }
|
46 | |
47 | if ((argc==2)&&(strstr(argv[1],"-h")!=NULL)) |
48 | {
|
49 | help(); |
50 | pigpio_stop(pi); |
51 | return 2; |
52 | }
|
53 | else if ((argc==2)&&(strcmp(argv[1],"-i")==0)) |
54 | {
|
55 | init(pi); |
56 | pigpio_stop(pi); |
57 | return 0; |
58 | }
|
59 | else
|
60 | {
|
61 | switch(argc) |
62 | {
|
63 | case 3: if (atoi(argv[2])) off=atoi(argv[2]); |
64 | case 2: if (atoi(argv[1])) on=atoi(argv[1]); |
65 | }
|
66 | |
67 | cyc=12000/(on+off); |
68 | |
69 | if (gpio_read(pi,3)==1) |
70 | {
|
71 | printf("Another instance of 'sirene' is running!\r\n"); |
72 | pigpio_stop(pi); |
73 | return 0; |
74 | }
|
75 | |
76 | gpio_write(pi,3,1); // activate out 1 |
77 | |
78 | while (cyc!=0) |
79 | {
|
80 | gpio_write(pi,5,1); // activate piezo alarm buzzer |
81 | usleep(on*1000); |
82 | gpio_write(pi,5,0); // deactivate piezo alarm buzzer |
83 | usleep(off*1000); |
84 | cyc--; |
85 | }
|
86 | gpio_write(pi,3,0); // deactivate out 1 |
87 | gpio_write(pi,5,0); // deactivate piezo alarm buzzer |
88 | }
|
89 | pigpio_stop(pi); |
90 | }
|
:
Bearbeitet durch User
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.