The LMT87 Temp sensor is a 3 pin device that I suspect might be represented by the analog-sensor. There is a rather complicated mapping (for tight tolerances) and a rough formula (for low tolerance) to interpret the output to an understood value. If I am to use the analog-sensor, how am I to enter the mapping or the formula? If not, can this node be created?
I can also imagine that an LMT87 node can be created from the analog-sensor. Is this the path that is usually followed?
A good starting point is the official guide to creating nodes for analog sensors:
You can use the XOD math nodes to implement your mapping/formula.
If you get stuck, post your XOD patch here and I’m sure someone will point you in the right direction.
While the analogRead function in the Arduino IDE returns a value in the range 0 to 1023, XOD’s analog-read node outputs a value in the range 0.0 to 1.0. This means that if you’re using an Arduino Uno, you simply need to multiply the output from the analog-read node by five to get the voltage.
Wayland, I understand. This is not foreign to me.
Per the LMT87 datasheet, “Although the LMT87 is very linear, the response does have a slight umbrella parabolic shape.” My needs require the ability across most of the full range. While there is a mapping (they call it a transfer table), I need the granularity between lookup elements. That means a formula is needed.
I have the formula. Now, I need to make it work. If I get this to work as a standard Arduino library, how well do libraries translate in XOD?
The developers have made it easy to wrap class-based Arduino libraries, see:
However, for your project it may be simpler to place all of the code for your formula inside a not-implemented-in-xod node, see:
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.