heatseeknyc / relay

web app for setting up sensors, receiving and storing their data, and viewing it
0 stars 2 forks source link

use stored board type for each cell to decide how to interpret voltage #19

Closed williamcodes closed 8 years ago

williamcodes commented 8 years ago

This should allow us to use v0.5 cells.

williamcodes commented 8 years ago

We have 50 of the v0.5 cells ready to go. They're on the second tab of the XBee ID spreadsheet. @hrldcpr when do you think we'll be able to start deploying them?

williamcodes commented 8 years ago

As promised in firmware/#18, I took a v0.5 cell and put it in a box with an extech 39240 air probe (same model HPD uses, accurate to ±2ºF) and got 71.4ºF from the extech and this from the cell within five minutes of the reading being taken:

Taken At                   Hub ID            Temperature  Sleep Period  Received At                       Relayed At
2016-01-06 03:50:47+00:00  0013a20040b9e379  110.97°      359000        2016-01-06 03:50:50.647402+00:00   

If you want a v0.5 cell to play with, we have plenty, feel free to come grab one whenever.

williamcodes commented 8 years ago

Looks like we actually can't start deploying v0.5 cells until the relay server is updated even though we're saving the raw voltage. Without the update, readings get passed through to the app as >100ºF, which users would then see. We'd have to hold off on setting up accounts for those users, and the advocates want to see data within a day or so of the install. We're down to our last 17 v0.3 cells and will probably run out within the next 4 or 5 days. Do you have time to set up the ability to interpret both voltages?

hrldcpr commented 8 years ago

Cool, I will make it work on Saturday.

williamcodes commented 8 years ago

Yay! Thank you!

hrldcpr commented 8 years ago

In the snippet you pasted earlier it says "Hub ID" is 0013a20040b9e379, which doesn't seem possible to me from the data… is that actually the Cell ID?

hrldcpr commented 8 years ago

Hmmm, that voltage reading doesn't seem to agree with the datasheet.

The stored ADC value is 291, which corresponds to 291 / 1023 * 3.3V = 939mV, which according to the datasheet is 32°C, or 89°F…

For now I'll try calibrating it to the known value, but it's possible something fishy is going on, or that the XBee's ADC just isn't accurate enough for this chip.

hrldcpr commented 8 years ago

Whoops forgot to close this yesterday. The different-cell-versions code is live now, using a new database table called cells, and based on the calibration you did above.

However you should do some testing before installing the new cells, because I think it's possible there is too much noise in the circuit or something like that, since every ±5mV corresponds to ±1°C, it's twice as susceptible to noise and ADC inaccuracies as the previous sensors (which use 10mV per 1°C).

So it's possible they end up being less accurate instead of more accurate, hopefully not but anyway you should try them out a bit. The fact that the reading you gave above was off by 50mV from what the datasheet implied we should expect is sketchy.

Alternatively I might be misreading the datasheet, which would be nice! It sometimes mentions VDD=2.7V whereas we are using VDD=3.3V, which maybe makes their charts useless? But that would be surprising since in that case they give no formula for converting voltage to temperature.

While you're testing, you should calibrate the sensors at multiple different temperatures, because then we can actually make a linear regression of our own which will maybe apply better to our supply voltage. I'll open an issue for that.

hrldcpr commented 8 years ago

See heatseeknyc/hardware#7