Example 1 - Temperature readings with Thermistors

The first item is the reading of temperatures with thermistors.

If you connect up two thermistors to your breadboard as required (See Adafruit's handy guide ) and connect to analogue inputs A0 and A1, you'll be ready to measure and log some temperatures.

The Node-RED flow can be found at http://flows.nodered.org/flow/4bceef5251eaa1f17a8f1fbeb5b6c34d and outputs the information in CSV format.

A few notes on the Node-RED flow:

  • The Johnny-Five sensors are created in a separate Johnny-Five node in the beginning of the code, that runs once at start-up. These sensors are then made available to future function nodes by setting them as global variables.
  • Subsequent functions then make use of these sensor variables to record data.
  • The reason for this convoluted approach is to ensure modularity. These subsequent function nodes care prompted to record information by the flow coming into them, meaning that they can copied and used throughout a flow each as a separate data recording action, allowing for scheduling these actions using the Node-Red flow.
  • If you created the sensor and then recorded data all in one node, every time a flow prompted that node to run, a new sensor instance would be created, causing mayhem with the Arduino board and resulting in an error.

The Fritzing diagram for a breadboard set-up is as follows: