Analog pin readings and temperature readings

I have several temperature sensors that I am trying to attach to the spark core, each of which only needs/has a 0V and analog connection.

Alone all of the analog readings from each pin using [reading = analogRead(A0-7);] show 2000 ish, when i attach my sensors to 3.3* (0V) and analog to A0-7, the readings then become 4000 ish / 3.22 volts and a highly non survivable 272 deg as the result using the calculations from the examples page.

Are my sensors just not compatible with spark core in that it requires a sensor with a earth connection, the ones I’m using usually connect to a powered controller.

Hi @xenoborg

I think you are going to have to tell us a bit more about the temperature sensors for us to help. Is there a reference or data sheet?

It sounds like they are thermistors which change resistance based on temp. If that is the case you will need another fixed non-temperature sensitive resistor to make voltage divider. If they have a very high resistance at room temperature (100k ohm) you may need more circuitry. If they are the lower resistance at room temperature (10k ohm) you can probably just add a fixed resistor.


They are Trend TB/TS/K Thermistor Room sensors

Looks like they are 10k ohm thermistors so you just need an external fixed resistor. A 10k ohm fixed resistor will work great. You make a voltage divider between with the resistor and the thermistor so one end is tied to 3.3V* and the other to GND or 0V. You connect the analog input pin to the common point between the resistors in the middle.

Here is an Arduino reference that might help you–just remember that on Spark analogRead returns a value between 0 and 4095 so all the 1024.0 in the code should be 4096.0 instead.

Thank you, got the thing working at last!

1 Like