Industrielle Fertigung
Industrielles Internet der Dinge | Industrielle Materialien | Gerätewartung und Reparatur | Industrielle Programmierung |
home  MfgRobots >> Industrielle Fertigung >  >> Manufacturing Technology >> Herstellungsprozess

Wie man mit Arduino Nano zu Hause ein Mini-Oszilloskop herstellt

Komponenten und Verbrauchsmaterialien

Arduino Nano R3
× 1
ElectroPeak 0,96" OLED 64x128 Anzeigemodul
× 1
Tastschalter, von oben betätigt
× 9
1N4148 – Allzweck-Schnellwechsel
× 4

Apps und Onlinedienste

Arduino-IDE

Über dieses Projekt

In diesem Video zeige ich Ihnen, wie Sie Ihr eigenes Mini-Oszilloskop zu Hause bauen. Es ist einfach und leicht zu erstellen. Es ist nicht mein eigener Code, ich mache nur ein Tutorial für euch. Um dieses Projekt zu erstellen, war ich auf den Quellcode von Drittanbietern angewiesen, dessen Link unten angegeben ist. Wenn Sie Fragen oder Anregungen haben, können Sie gerne mein YouTube-Video kommentieren und vergessen Sie bitte nicht, meinen YouTube-Kanal zu liken und zu abonnieren .

Klicken Sie hier für das vollständige Tutorial und den Quellcode.

Meine IG:https://www.instagram.com/pm.goharian/

Benötigte Komponenten

  • Arduino Nano
  • SSD1306 OLED-Display
  • 1N4148
  • Mikroschalter
  • 104 Kondensator
  • Widerstände:100Ω, 12k, 120k, 510k

Was ist ein Oszilloskop?

Ein „Oszilloskop“, früher „Oszillograph“ genannt und informell als Scope bekannt oder o-Scope ,CRO (für Kathodenstrahloszilloskop) oder DSO (für das modernere digitale Speicheroszilloskop) ist eine Art elektronisches Prüfgerät, das unterschiedliche Signal [Spannungen] grafisch anzeigt, normalerweise als zweidimensionale Darstellung eines oder mehrerer Signale als Funktion der Zeit. Andere Signale (wie Ton oder Vibration) können in Spannungen umgewandelt und angezeigt werden.

Oszilloskope zeigen die zeitliche Änderung eines elektrischen Signals mit Spannung und Zeit als Y- bzw. X-Achse auf einer kalibrierten Skala an. Die Wellenform kann dann auf Eigenschaften wie Amplitude, Frequenz, Anstiegszeit, Zeitintervall, Verzerrung und andere analysiert werden. Moderne digitale Instrumente können diese Eigenschaften direkt berechnen und anzeigen. Ursprünglich war für die Berechnung dieser Werte ein manuelles Messen der Wellenform mit den in den Bildschirm des Instruments integrierten Skalen erforderlich.

Schema für das Projekt

Hinweis: Stellen Sie sicher, dass alle Verbindungen in Ihrem Stromkreis genau den Schaltplänen entsprechen.

Referenz:

http://radiopench.blog96.fc2.com/blog-entry-893.html

https://www.wikipedia.org/

Code

  • Code
CodeC/C++
/* (_20190212_OLEDoscilloscope.ino) 1285byte RAM frei 12.02.2019 */#include #include #include #include  // PROGMEM#include #define SCREEN_WIDTH 128 // OLED Display width#define SCREEN_HEIGHT 64 // OLED Display Höhe#define REC_LENGTH 200 // // Deklaration für ein SSD1306 Display an I2C (SDA, SCL Pins) #define OLED_RESET -1 // Reset Pin # (oder -1 wenn Arduino Reset Pin geteilt) Adafruit_SSD1306 Display (SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); // const char vRangeName[10][5] PROGMEM ={"A50V", „A 5V“, „50V“, „20V“, „10V“, „5V“, „2V“, „1V“, „0,5V“, „0,2V“}; // \0const char * const vstring_table[] PROGMEM ={vRangeName[0], vRangeName[1], vRangeName[2], vRangeName[3], vRangeName[4], vRangeName[5], vRangeName[6], vRangeName[ 7], vRangeName[8], vRangeName[9]};const char hRangeName[8][6] PROGMEM ={" 50ms", " 20ms", " 10ms", " 5ms", " 2ms", " 1ms", "500us", "200us"}; // (48const char * const hstring_table[] PROGMEM ={hRangeName[0], hRangeName[1], hRangeName[2], hRangeName[3], hRangeName[4], hRangeName[5], hRangeName[6], hRangeName[ 7]};int waveBuff[REC_LENGTH]; // (RAM)char chrBuff[10]; // String hScale ="xxxAs";String vScale ="xxxx";float lsb5V =0.0055549; // 5V0.005371 V/1LSBfloat lsb50V =0.051513; // 50V 0.05371volatile int vRange; // 0:A50V, 1:A 5V, 2:50V, 3:20V, 4:10V, 5:5V, 6:2V, 7:1V, 8:0.5 Vvolatile int hRange; // 0:50m, 1:20m, 2:10m, 3:5m, 4;2m, 5:1m, 6:500u, 7;200volatile int trigD; // 0:1:volatile int scopeP; // 0:, 1:, 2:volatile boolean hold =false; // volatile boolean paraChanged =false; // truevolatile int saveTimer; // EEPROMint timeExec; // (ms)int dataMin; // (min:0) int dataMax; // (max:1023)int dataAve; // 10 max:10230)int rangeMax; // int rangeMin; // int rangeMaxDisp; // max100int rangeMinDisp; // mint trigP; // boolescher trigSync; // int att10x; // 1void setup () { pinMode (2, INPUT_PULLUP); // (int0 pinMode (8, INPUT_PULLUP); // PinMode (9, INPUT_PULLUP) auswählen; // PinMode hoch (10, INPUT_PULLUP); // PinMode runter (11, INPUT_PULLUP); // PinMode (12, INPUT) halten; // 1/10 pinMode(13, OUTPUT); // // Serial.begin(115200); // RAM if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {// Adresse 0x3C für 128x64 // Serial. println(F("SSD1306 fehlgeschlagen")); for (;;); // Nicht fortfahren, Endlosschleife } loadEEPROM(); // EEPROM analogReference(INTERNAL); // ADC1.1Vvref) attachInterrupt(0, pin2IRQ , FALLEN); // Startbildschirm(); //} ungültige Schleife () { DigitalWrite (13, HIGH); setConditions(); // RAM40 readWave(); // (1.6ms) digitalWrite (13, LOW); // dataAnalize(); // (0,4-0,7ms) writeCommonImage(); // (4,6ms) plotData(); // (5,4ms+) dispInf(); // (6.2ms) display.display(); // (37ms) speichernEEPROM(); // EEPROM while (hold ==true) { // Hold dispHold(); Verzögerung(10); }}void setConditions() { // // PROGMEM strcpy_P(chrBuff, (char*)pgm_read_word(&(hstring_table[hRange]))); // hScale =chrBuff; // hScale // strcpy_P(chrBuff, (char*)pgm_read_word(&(vstring_table[vRange]))); // vScale =chrBuff; // vScale-Schalter (vRange) {// Fall 0:{// Auto50V // rangeMax =1023; // BereichMin =0; att10x =1; // brechen; } Fall 1:{// Auto 5V // rangeMax =1023; // BereichMin =0; att10x =0; // brechen; } Fall 2:{// 50V BereichMax =50/lsb50V; // rangeMaxDisp =5000; // 100 BereichMin =0; BereichMinDisp =0; att10x =1; // brechen; } Fall 3:{// 20V rangeMax =20/lsb50V; // rangeMaxDisp =2000; BereichMin =0; BereichMinDisp =0; att10x =1; // brechen; } Fall 4:{// 10V rangeMax =10/lsb50V; // rangeMaxDisp =1000; BereichMin =0; BereichMinDisp =0; att10x =1; // brechen; } Fall 5:{// 5V rangeMax =5/lsb5V; // rangeMaxDisp =500; BereichMin =0; BereichMinDisp =0; att10x =0; // brechen; } Fall 6:{// 2V rangeMax =2/lsb5V; // rangeMaxDisp =200; BereichMin =0; BereichMinDisp =0; att10x =0; // brechen; } Fall 7:{// 1V rangeMax =1 / lsb5V; // rangeMaxDisp =100; BereichMin =0; BereichMinDisp =0; att10x =0; // brechen; } Fall 8:{// 0,5V BereichMax =0,5/lsb5V; // rangeMaxDisp =50; BereichMin =0; BereichMinDisp =0; att10x =0; // brechen; } Fall 9:{// 0,5V BereichMax =0,2/lsb5V; // rangeMaxDisp =20; BereichMin =0; BereichMinDisp =0; att10x =0; // brechen; } }}void writeCommonImage() { // display.clearDisplay(); // (0,4 ms) display.setTextColor (WEISS); // display.setCursor(86, 0); // Beginne in der oberen linken Ecke display.println(F("av V")); // 1 display.drawFastVLine(26, 9, 55, WEISS); // display.drawFastVLine(127, 9, 55, WEISS); // display.drawFastHLine(24, 9, 7, WEISS); // Max display.drawFastHLine(24, 36, 2, WEISS); // display.drawFastHLine(24, 63, 7, WEISS); // display.drawFastHLine(51, 9, 3, WEISS); // Max display.drawFastHLine(51, 63, 3, WEISS); // display.drawFastHLine(76, 9, 3, WEISS); // Max display.drawFastHLine(76, 63, 3, WEISS); // display.drawFastHLine(101, 9, 3, WEISS); // Max display.drawFastHLine(101, 63, 3, WEISS); // display.drawFastHLine(123, 9, 5, WEISS); // Max display.drawFastHLine(123, 63, 5, WEISS); // für (int x =26; x <=128; x +=5) { display.drawFastHLine(x, 36, 2, WHITE); // () } for (int x =(127 - 25); x> 30; x -=25) { for (int y =10; y <63; y +=5) { display.drawFastVLine(x, y , 2, WEISS); // 3 } }}void readWave () {// if (att10x ==1) {// 1/10 PinMode (12, OUTPUT); // digitalWrite (12, LOW); // NIEDRIG} Else {// PinMode (12, INPUT); // Hi-z} Schalter (hRange) {// Fall 0:{// 50ms timeExec =400 + 50; // (ms) EEPROM ADCSRA =ADCSRA &0xf8; // 3 ADCSRA =ADCSRA | 0x07; // 128 (arduino for (int i =0; i  dataMax) {// dataMax =d; } } // dataAve =(Summe + 10) / 20; // 10 // max,min if (vRange <=1) { // Auto1 rangeMin =dataMin - 20; // -20 rangeMin =(rangeMin / 10) * 10; // 10 if (rangeMin <0) { rangeMin =0; // 0} rangeMax =dataMax + 20; // +20 BereichMax =((BereichMax / 10) + 1) * 10; // 10 if (rangeMax> 1020) { rangeMax =1023; // 10201023} if (att10x ==1) {// rangeMaxDisp =100 * (rangeMax * lsb50V); // ADC rangeMinDisp =100 * (rangeMin * lsb50V); //} else { // rangeMaxDisp =100 * (rangeMax * lsb5V); rangeMinDisp =100 * (rangeMin * lsb5V); } } else { // // } // for (trigP =((REC_LENGTH / 2) - 51); trigP <((REC_LENGTH / 2) + 50); trigP++) { // if (trigD ==0) { // 0 if ((waveBuff[trigP - 1] <(dataMax + dataMin) / 2) &&(waveBuff[trigP]>=(dataMax + dataMin) / 2)) { break; // } } else { // 0 if ((waveBuff[trigP - 1]> (dataMax + dataMin) / 2) &&(waveBuff[trigP] <=(dataMax + dataMin) / 2)) { break; } // } } trigSync =true; if (trigP>=((REC_LENGTH / 2) + 50)) {// trigP =(REC_LENGTH / 2); trigSync =falsch; // Unsync }}void startScreen() { // display.clearDisplay(); display.setTextSize(1); // 2 display.setTextColor (WEISS); // display.setCursor (10, 25); // display.println(F("PM.GOHARIAN")); // display.setCursor (10, 45); // display.println (F ("Stift-Skop")); display.display(); // Verzögerung (5000); display.clearDisplay(); display.setTextSize(1); // }void dispHold () { // Display.fillRect (32, 12, 24, 8, BLACK) halten; // 4 display.setCursor (32, 12); display.print(F("Halten")); // Halten Sie display.display(); //}void dispInf () { // Float-Spannung; // display.setCursor(2, 0); // display.print (vScale); // if (scopeP ==0) { // display.drawFastHLine (0, 7, 27, WEISS); // display.drawFastVLine(0, 5, 2, WEISS); display.drawFastVLine(26, 5, 2, WEISS); } // display.setCursor (34, 0); // display.print (hScale); // (time/div) if (scopeP ==1) { // display.drawFastHLine(32, 7, 33, WHITE); // display.drawFastVLine(32, 5, 2, WEISS); display.drawFastVLine(64, 5, 2, WEISS); } // display.setCursor (75, 0); // wenn (trigD ==0) {display.print (char (0x18)); //} Else {display.print(char(0x19)); //} if (scopeP ==2) { // display.drawFastHLine(71, 7, 13, WEISS); // display.drawFastVLine(71, 5, 2, WEISS); display.drawFastVLine(83, 5, 2, WEISS); } // if (att10x ==1) {// 10 Spannung =dataAve * lsb50V / 10.0; // 50V} Else {Spannung =DataAve * lsb5V / 10.0; // 5V} dtostrf (Spannung, 4, 2, chrBuff); // x.xx display.setCursor (98, 0); // display.print (chrBuff); // // display.print (saveTimer); // // Spannung =rangeMaxDisp / 100.0; // Max if (vRange ==1 || vRange> 4) {// 5VAuto5V dtostrf (Spannung, 4, 2, chrBuff); // *.** } else { // dtostrf(Spannung, 4, 1, chrBuff); // **.* } display.setCursor(0, 9); display.print (chrBuff); // Maximale Spannung =(rangeMaxDisp + rangeMinDisp) / 200.0; // if (vRange ==1 || vRange> 4) {// 5VAuto5V dtostrf (Spannung, 4, 2, chrBuff); // 2 } else { // dtostrf (Spannung, 4, 1, chrBuff); // 1 } display.setCursor (0, 33); display.print (chrBuff); // Spannung =rangeMinDisp / 100.0; // Min if (vRange ==1 || vRange> 4) {// 5VAuto5V dtostrf (Spannung, 4, 2, chrBuff); // 2} Else { dtostrf (Spannung, 4, 1, chrBuff); // 1 } display.setCursor (0, 57); display.print (chrBuff); // Min // wenn (trigSync ==false) { // display.setCursor(60, 55); // display.print (F("Unsync")); // Unsync }}void plotData() { // long y1, y2; for (int x =0; x <=98; x++) { y1 =map(waveBuff[x + trigP - 50], rangeMin, rangeMax, 63, 9); // y1 =einschränken(y1, 9, 63); // y2 =map(waveBuff[x + trigP - 49], rangeMin, rangeMax, 63, 9); // y2 =einschränken(y2, 9, 63); // display.drawLine(x + 27, y1, x + 28, y2, WEISS); // }}void saveEEPROM() { // EEPROM if (paraChanged ==true) { // saveTimer =saveTimer - timeExec; // if (saveTimer <0) { // paraChanged =false; // EEPROM.write (0, vRange); // EEPROM.write (1, hRange); EEPROM.write(2, trigD); EEPROM.write(3, scopeP); }}}void loadEEPROM() {// EEPROM int x; x =EEPROM.read(0); // vRange if ((x <0) || (x> 9)) { // 0-9 x =3; // } vRange =x; x =EEPROM.read(1); // hRange if ((x <0) || (x> 7)) { // 0-9 x =3; // } hRange =x; x =EEPROM.read(2); // trigD if ((x <0) || (x> 1)) { // 0-9 x =1; //} trigD =x; x =EEPROM.read(3); // GeltungsbereichP if ((x <0) || (x> 2)) { // 0-9 x =1; //} scopeP =x;}void pin2IRQ() { // Pin2 (int0) //pin8,9,10,11Pin2 // int x; // x =PINB; // B if ( (x &0x07) !=0x07) { // 3High saveTimer =5000; // EEPROM(ms paraChanged =true; // ON } if ((x &0x01) ==0) { scopeP++; if (scopeP> 2) { scopeP =0; } } if ((x &0x02) ==0 ) { // UP if (scopeP ==0) { // vRange++; if (vRange> 9) { vRange =9; } } if (scopeP ==1) { // hRange++; if (hRange> 7) { hRange =7; } } if (scopeP ==2) { // trigD =0; // } } if ((x &0x04) ==0) { // DOWN if (scopeP ==0) { // vRange- -; if (vRange <0) { vRange =0; } } if (scopeP ==1) { // hRange--; if (hRange <0) { hRange =0; } } if (scopeP ==2) { // trigD =1; // } } if ((x &0x08) ==0) { // HOLD halten =! halten; // }}

Schaltpläne


Herstellungsprozess

  1. Machen Sie eine DIY-Hausaufgaben-Schreibmaschine zu Hause
  2. DIY Photoshop-Bearbeitungskonsole mit Arduino Nano RP 2040
  3. Wie man zu Hause Kohlefaser von Grund auf neu herstellt
  4. Erstellen von Monitor-Ambilight mit Arduino
  5. So erstellen Sie eine anpassbare stanzbare Tastaturtaste
  6. So misst man die Masse der Erde mit Arduino
  7. So erstellen Sie eine Website, die Arduino mithilfe von PHP kommuniziert
  8. Wie man mit einem Arduino Musik macht
  9. Wie erstelle ich eine Arduino-basierte automatische Türöffnung
  10. So erstellen Sie einen Kompass mit Arduino und Processing IDE