Lab 43. Dashboard: analog input

Expected completion time of this lab: 20 min.

The analog input pins only support a voltage between 0 and 1.8V. NEVER apply a volyage outside that range, or you will fry the board.

Test the voltage of your input using a voltmeter before applying to the board.

For testing, you can leave the pin floating (the input voltage should be around 1V), or tied to ground.

  • Create the following Node-RED flow to enable analog input pin A0
     

    A little help

    The function node at the top contains the following code:

    msg.payload            = {
        "method" :  "PUT",
        "url" :     "/analog/A0",
        "body":     {
            "enable":      msg.payload,
            "rate":        10000,
            "sampleCount": 1,
            "dataFormat":  0
        },
        "token":    "myToken",
    }
    return msg;
  • You should end up with the following dashboard

Extra points!

Create little control loops between sensors and actuators!