본문 바로가기
큐브셋 초소형 인공위성

CubSet - How to Use Processing Software

by 로니킴 2021. 9. 2.


본 연구의 목표는 큐브셋을 통해 우주 시스템을 이해하고 창의 임무 설계, 요구 조건 분석, 그리고 시스템 기본 설계 및 제작을 통해 학교에서 배워온 지식을 실제 응용하여 공학과 과학의 관계와 차이를 배우고 관련 전공에 대한 흥미를 유발하기 위함에 있다.  다양한 환경센서를 성층권에서 측정하는데 목적이 있다. 

 

 

목차

     

     

     

     


     

    How to Use Processing Software

     

    https://docs.google.com/document/d/1ZjUHg2AiO1qDC59P-D7_8wFgAnIO05JmfMH2dPjh4Rk/edit#heading=h.cce2ofax6t6o

     

    이 가이드는 이 소프트웨어를 사용하여 2021 CubeSat 프로토타입 키트의 구성 요소를 사용하여 결과를 표시하는 방법의 예를 보여줍니다.

     

    How to Use Processing Software.pdf
    4.94MB

     

     


    기상 관측소 (쉴드 사용하기)

     

    MKR1000 WiFi 마이크로컨트롤러와 MKR ENV Shield만 사용하여 Arduino IDE 및 처리 소프트웨어를 활용하여 온도, 습도 및 압력에 대한 수치를 보여주는 라이브 시각적 표시를 만들 수 있습니다.

    Arduino 코드는 ENV Shield 시작 가이드에 있는 샘플 코드의 축소 버전으로, 온도, 습도 및 압력만 표시하도록 변경되었습니다.

    처리 코드는 Arduino 프로젝트 허브의 이 프로젝트에서 제공됩니다.

     

     

     


    1. 아두이노 IDE를 엽니다.

     

    #include <Arduino_MKRENV.h> 
    
    void setup() {
    
      Serial.begin(9600);
      while (!Serial); 
      if (!ENV.begin()) {
        Serial.println("Failed to initialize MKR ENV shield!"); 
        while (1); 
      }
    }
    
    void loop() {
    
      float temperature = ENV.readTemperature(); 
      float humidity    = ENV.readHumidity();
      float pressure    = ENV.readPressure();
      float illuminance = ENV.readIlluminance();
      float uva         = ENV.readUVA();
      float uvb         = ENV.readUVB();
      float uvIndex     = ENV.readUVIndex();
    
      Serial.print(temperature);
      Serial.print(",");
      Serial.print(humidity);
      Serial.print(",");
      Serial.print(pressure);
      Serial.println();
    
      delay(1000);
    }

     

    2. 텍스트를 삭제하고 이 코드를 복사하여 붙여넣고, 컴파일후 업로드 합니다. 

    mkr1000.ino
    0.00MB

     


    3. 코드를 업로드하고 매초 업데이트되는 온도, 습도, 압력을 목록으로 출력해야 하는 시리얼을 엽니다. 

     

     

     

     


    기상 관측소 (쉴드 사용하기) - 2

    Processing 프로그램을 이용해 시각적으로 데이터를 확인할 수 있습니다. 


    Processing은 학습, 프로토타입 제작 및 프로젝트에 시각적 측면 적용에 완벽한 무료 오픈 소스 소프트웨어 및 프로그래밍 언어입니다.


    Processing 프로그램은 https://processing.org/download/에서 다운로드할 수 있습니다.

    https://processing.org/download




    다음 코드는 2021 CubeSat 프로토타입 키트의 구성 요소를 사용하여 결과를 표시하는 방법의 예를 보여줍니다.

     

    1. processing 프로그램을 실행합니다 .


    2. 텍스트를 삭제하고 이 코드를 복사하여 붙여넣고, 컴파일후 업로드 합니다. 

     

    import meter.*;
    import processing.serial.*;
    
    Serial port;
    String[] list;
    
    Meter m, m2, m3;
    
    void setup() {
      size(1260, 600);
      background(71, 194, 197);
      
      port = new Serial(this, "COM12", 9600);
    
      fill(120, 50, 0);
      m = new Meter(this, 10, 100);
      // Adjust font color of meter value  +
      m.setMeterWidth(400);
      m.setTitleFontSize(20);
      m.setTitleFontName("Dialog");
      m.setTitle("Temperature (C)");
      m.setDisplayDigitalMeterValue(true);
      
      // Meter Scale
      String[] scaleLabelsT = {"0", "10", "20", "30", "40", "50", "60", "70", "80"};
      m.setScaleLabels(scaleLabelsT);
      m.setScaleFontSize(18);
      m.setScaleFontName("Dialog");
      m.setScaleFontColor(color(200, 30, 70));
      
      m.setArcColor(color(255, 242, 0));
      m.setArcThickness(10);
      m.setMaxScaleValue(80);
      
      m.setNeedleThickness(3);
      
      m.setMinInputSignal(0);
      m.setMaxInputSignal(80);
    
      // A second meter for reference
      int mx = m.getMeterX();
      int my = m.getMeterY();
      int mw = m.getMeterWidth();
      
      m2 = new Meter(this, mx + mw + 20, my);
      m2.setMeterWidth(400);
      m2.setTitleFontSize(20);
      m2.setTitleFontName("Dialog");
      m2.setTitle("Humidity (%)");
      m2.setDisplayDigitalMeterValue(true);
      
      String[] scaleLabelsH = {"0", "10", "20", "30", "40", "50", "60", "70", "80", "90", "100"};
      m2.setScaleLabels(scaleLabelsH);
      m2.setScaleFontSize(18);
      m2.setScaleFontName("Dialog");
      m2.setScaleFontColor(color(200, 30, 70));
      
      m2.setArcColor(color(255, 242, 0));
      m2.setArcThickness(10);
      m2.setMaxScaleValue(100);
      
      m2.setNeedleThickness(3);
      
      m2.setMinInputSignal(0);
      m2.setMaxInputSignal(100);
      
      // A third meter for reference
      int m2x = m2.getMeterX();
      int m2y = m2.getMeterY();
      int m2w = m2.getMeterWidth();
      
      
      
      m3 = new Meter(this, m2x + m2w + 20, m2y);
      m3.setMeterWidth(400);
      m3.setTitleFontSize(20);
      m3.setTitleFontName("Dialog");
      m3.setTitle("Pressure (KPa)");
      m3.setDisplayDigitalMeterValue(false);
      
      String[] scaleLabelsP = {"99", "99.5", "100", "100.5", "101", "101.5", "102", "102.5", "103", "103.5", "104"};
      m3.setScaleLabels(scaleLabelsP);
      m3.setScaleFontSize(15);
      m3.setScaleFontName("Dialog");
      m3.setScaleFontColor(color(200, 30, 70));
      
      m3.setArcColor(color(255, 242, 0));
      m3.setArcThickness(10);
      m3.setMaxScaleValue(104);
      
      m3.setNeedleThickness(3);
      
      m3.setMinInputSignal(99);
      m3.setMaxInputSignal(104);
      
    }
    
    public void draw() {
      
      textSize(70);
      fill(190, 30, 45);
      text("ENV Shield Weather Station", 200, 425);
      if (port.available() > 0) {
        String val = port.readString();
        list = split(val, ',');
        float temp = float(list[0]);
        float hum = float(list[1]);
        float press = float(list[2]);
        println("Temperature: " + temp + " C  " + "Humidity: " + hum + " % " + "Pressure: " + press + "KPa");
        m.updateMeter(int(temp));
        m2.updateMeter(int(hum));
        m3.updateMeter(int(press));
      }
    }

    test1.pde
    0.00MB

     

    3. 실행을 선택하면 매초 업데이트되는 온도, 습도, 압력을 출력합니다. 

     

    4. 자동으로 시리얼 드로잉 창이 나타나면서 아날로그 게이지로 표시됩니다. 

     

     

     

     

     

     

     

     


     

     

     

     

    모두의 아두이노 환경 센서 책

    [모두의 아두이노 환경 센서] 책은 예스24, 인터넷 교보문고, 알라딘, 인터파크도서, 영풍문고, 반디앤루니스 , 도서11번가 등에서 구입할 수 있다. 이 책에서는 PMS7003, GP2Y1010AU0F, PPD42NS, SDS011 미세먼지 센서, DHT22 온습도 센서, MH-Z19B 이산화탄소 센서, ZE08-CH2O 포름알데히드 센서, CCS811 총휘발성유기화합물 TVOC, GDK101 방사선(감마선) 센서, MQ-131 오존(O3) 센서, MQ-7 일산화탄소, MICS-4514 이산화질소 센서, MICS-6814 암모니아 센서, DGS-SO2 아황산가스(SO2) 센서, BME280 기압 센서, GUVA-S12SD 자외선(UV) 센서, MD0550 기류 센서, QS-FS01 풍속 센서(Wind speed) 를 사용한다.  

     

    모두의 아두이노 환경 센서

    아두이노와 센서로 내 건강을 지킬 수 있다!다양한 환경 센서를 실생활 프로젝트에 응용해보자!시중에 판매되고 있는 간이측정기도 센서로 값을 측정합니다. 똑같은 센서를 아두이노에 연결하

    book.naver.com

     

     

     

     



    댓글