Week12

Interface and application programming


Group Assignment Link

  • Compare as many tool options as possible

  • Assignment

  • Write an application that interfaces a user with an input and/or output device that you made

  • Node-RED
    Through group work I decided to use Node-RED as the interface language
    because Node-REDIntuitively used Accessible to many Easy to use for simple programming Can see the big picture of the overall structure of the code

    I used the board, sensor, and code in week 9 [Week 9 Link]
    Node-RED is a flow-based programming tool developed by IBM's Emerging Technology Services team
    Basically offer JavaScript language
    Node-RED download Link
    The node has different installation methods and required files depending on each OS
    Therefore, please follow the installation process according to your environment
    I use window OS

    Install node-red

    node-red : Node-RED connection, automatically turns on when Node-RED is turned off
    node-red-stop : Stop Node-RED
    node-red-start : Restart Node-RED
    sudo systemctl enable node.service : Auto-starts Node-RED every time it boots
    sudo systemctl disabled node.service : disables automatic execution at boot time
    "http://127.0.0.1:1880/" Open this browser to work Node-RED when the installation is complete


    Install the Node-RED Dashboards and Node-RED Serial Prints
    The picture was already taken after installation


    After adding the serial in node, locate the FTDI port on the setup > port and connect it (COM9)


    Add swich node
    Added switch node for LED on-off to be added to output later
    Drag it between the two nodes and connect it with a line


    I will read PM2.5 value of my dust sensor


    My dust sensor reads three kinds of values, PM2.5, PM1.0, PM10(The size of dust)
    All I need is a PM2.5 value, so I have to split it




    The Split node can be used to split the message into one message per line
    It can be followed by the nodes needed to operate on the individual lines of text
    followed by a Join node to recombine them back into a single block of text


    Add ChartNode and Ingauge Node


    Associate with PM2.5 Value


    If you type "http://127.0.0.1:1880/ui" this link in a new browser window,
    The PM2.5 value of my fine dust sensor is printed on the gauge and chart


    How to export a node code to a json file
    It was more fun and easy than writing when I coded while connecting visible nodes
    I'm very satisfied with the results, which are more intuitive and beautiful than the Arduino serial printer


    This week's hero video


    File
    My Node-RED.json file