I just found the Polulu products when surfing for some actuators.
After reading abit about the MicroMastro I see that one can use a pot.meter as an input signal.
I want to read two temperatures and do some basic calculations on the readings before running a servo.
I’m wondering if anyone has any tips on temp. sensor that I can wire to the MicroMaestros input lines?
This type of application is what the Maestro’s internal scripting language was designed for.
You’ll need to find a temperature sensor that outputs an analog voltage within 0-5 V. (A lot of temperature sensors use some kind of digital protocol like I2C, and that would probably be very complicated to implement on the Maestro.) Then you would configure a Maestro channel as an input and connect the temp sensor output to the signal pin of that channel. Here are some temperature sensors from Sparkfun that would probably work:
I don’t know what an NTC is, and you didn’t provide any information, but I imagine the output voltage is linearly related to temperature. The Maestro’s internal scripting lets you do basic arithmetic including addition, subtraction, multiplication, and division, so that should allow you to apply any arbitrary linear function to the voltage reading and convert it to degrees. Just be careful not to overflow +/-32767.
Sorry for the lousy explanation, I will try to explain a little better what I want to achieve.
An NTC is also called a thermistor, is a resistor that changes its resistance in variance with the temperature.
The problem is that this change in resistance is not linear, therefore either a calculation or maybe the use of
a predefined lookuptable is needed to convert into degrees.
I think I will opt for the predefined lookup table, as I think the formula used is to complex for the
script language. See the Steinhart-Hart formula here en.wikipedia.org/wiki/Thermistor
I would love if it is possible to do a lookup in a table, eg. if the voltage read is 2.4v then it will find a number in a table that corresponds to eg . 24degreesC if I read 2.45v then it will be eg. 24.5degreesC and so on.
Sorry, there is no great way to make a lookup table in a Maestro script.
You could, of course, use comparisons and if statements in a script to get some basic lookup functionality but it would not be a very efficient way of storing lookup data.
Is it possible that you could do something like a quadratic fit to the data and use that as the basis for a simple formula that is precise enough? Another option would be a piecewise-linear approximation: have a few IF statements to break your function down into individual line segments that match up at their endpoints.
By the way, why do you need to get a precise temperature value on the Maestro? What is it going to do with that information?
First of all, what I want to do is to measure a few temperatures in my waterbased underfloor heating pipes and the room temperature itself.
I then want to do some adjustment, based on the readings, to the shuntvalve that mixes the cold and warmwater, this is done with a servo.
I guess that the reading of the temperature does not have to be precise when it comes to degrees, but I was thinking about logging all
readings to a computer to later maybe use it there. I would then be great if the values I have are a ‘finished’ product so to say.
I have now done a little ‘research’, and ordered a few LM35 temp sensors.
I connected them to the pololus input pin, but I dont get any readings at all hmm… Seen a lot of PIC16x exampled and the LM35 is directly connected to the
adc input of the PIC, shouldn’t it be possible to do something similar with the Pololu?
Also, I want to add that I see no reason to do any kinds of computations on the Maestro itself if it will be connected to a computer the whole time. Why not just let the computer do all of the work?
Well, the main reason for not having a computer on all the time is that the logging is not the most important thing for me.
I really want a ‘self-contained’ solution, so that I can do some logging to maybe other equipment than a PC.
For the LM35, I connected it directly to the maestro without any scripts, did a factory reload of the maestro, selected I/O 0 as input.
The only reading I get in MaestroCC under status is 0, strange as I do get readings with my former method of reading via Thermistor and a voltage divider…
Maestro is only USB powered, don’t know if that means anything…
You have not said what your connections are, but I am going to guess that you have plugged the power of your sensor into a servo power line on the Maestro without actually applying any servo power. Using a multimeter is a good idea - if you still cannot get it to work, tell me exactly how everything is connected!
Okay, so for self-contained operation, a script is useful. But originally you were asking about how to do an accurate conversion of an analog value to temperature - if that is still necessary, I recommend doing it on the computer and just storing the final, converted setpoint on the Maestro.
I also jumped on the LM35 as its linear centigrade to volts and looked like it should work directly on an analog input.
I got the same results as you.
The values are jumpy and not accurate enough to be useful.
The LM35 increases only 10 mV for each centigrade making it hard to read together with noise on the line.
I checked it afterwards with an oscilloscope and the sensor does work, just not like we hoped directly with the Maestro.
TommyE said that he was only ever getting a reading of zero. It sounds like that is different from what you are seeing. If the sensor is working correctly but you want to cut down on noise, is it possible that doing a little averaging could help you?