i need some maths help, as i have admitted before my maths is poor, i am trying to do something about it but at the moment i need some help with what is probably simple maths. first off i am not after code (i want a bash at that first). a couple of weeks ago when i first knew about the incubator comp i phoned Honeywell uk to ask about there humidity sensors and sample program
(always worth a try!) i went for honeywell because dad uses sensiron sht71's normally and i wanted something different and more accurate, also i wanted something a bit easier to use than sensiron's software routines which are a bit complicated and voltage dependent.
so i spoke with a nice lady in customer service who told me that honeywell dont actually have a samples program as such but suggested i call my normall supplier and ORDER one from them (
), so i explained my age and that i really wanted to try one of there sensors as i have tried others but on paper there's seemed better more accurate and easier to use and i didnt have £30 to spend on a sensor!
she took my number and address, i thought oh well thats that and hung up. Today a packet turned up with a note that basically said i was very cheeky to ask but she had dug around and found some old obsolete sensors that one of there distributors had tucked away that were customer returns but worked perfect! so ive got a RS bag with 5x HIH-3610 humidity sensors in.
now the hard part! ive looked at the datasheet to see whats what (data sheet here http://rosset.org/linux/datasheet/HIH3610.pdf ),
the good news is i can use the ADC on a pic to read it, the bad news is i dont really understand the maths so here is a screen shot of the relevant page
now my problem with this sheet is things like the section where it say's voltage output vout=Vsupply(0.0062(Sensor RH)+0.16) and things like this because, i am ashamed to admit i have no idea what to do except maybe you do the bits in brackets first, but there are no / or x signs so i dont know if i have to x or / or what! i am slowly trying to learn maths but still have huge amounts to learn. anyway i did a google to try and find out what the actual calculation was. One the sites i came upon (apart from phanderson which again seemed complicated) i came across this site http://vwlowen.co.uk/picaxe/weather-station/page-2.htm
which is basically the same sensor but done with picaxe basic, i dont want to copy the code (i am doing it in C anyway) but i had a look at how he worked out the RH from the ADC reading, and here is a shot of that bit
so i thought i would simply plug my values in and get the equation for my ADC, but i need it checking first to make sure he got it right then to make sure i have it right lol,
now what i was thinking was killing 2 birds one stone and use the pic 30f because it has a great ADC unit and 12 bit's! (you can also make it 10 bit)
anyway doing it his way i get the following (oh forgot to add that the sensor is calibrated at 5V so i was going to use 5V regulated for the sensors and ADC ref)
first he works out the voltage for each ADC step so in my case thats
5V/4096 (12bit) = 0.001220703125
he then rounding off that figure and i was going too but decided against because using just the first 4 digits after the Decimal point makes a big difference in 12bit
then it says because the graph has 0.8V offset he divides that by the mV per ADC to get the number of ADC steps for the offset, now first i did it without rounding it up or down
so for me thats 0.8V/0.001220703125 =655.36 ok i round this to 655steps for the offset but just to show the difference if i had of rounded it to 4 digits like he has it works out like this
0,8V/0.0012=666.6666666666667 0r rounded 667 wich is a big difference so i decided to stick with 655 and live without the .36
so next step
he uses the graph from datasheet and taking offset into account the graph slope is linear (roughly) and is voltage out/%RH
so he gets for Volts per %RH (2.65-0.8)/60 = 0.0308 (rounded )(although it says that a later datasheet say's it's 0.0306)
so the ADC steps per %RH is Volts per %RH / Volts per ADC step
so in my case it's 0.0308/0.001220703125 =25.23136(or rounded 25.23)
then its %RH =ADC reading-655/25.23
to do away with floating point he then x top and bottom by 100 so for me
%RH=ADC(reading)-655(the offset)*100/2523
so is this correct way to do it? like i say i dont need code help (at the moment anyway) just making sure i am on the right track with the figures
so i spoke with a nice lady in customer service who told me that honeywell dont actually have a samples program as such but suggested i call my normall supplier and ORDER one from them (
now the hard part! ive looked at the datasheet to see whats what (data sheet here http://rosset.org/linux/datasheet/HIH3610.pdf ),
the good news is i can use the ADC on a pic to read it, the bad news is i dont really understand the maths so here is a screen shot of the relevant page
now my problem with this sheet is things like the section where it say's voltage output vout=Vsupply(0.0062(Sensor RH)+0.16) and things like this because, i am ashamed to admit i have no idea what to do except maybe you do the bits in brackets first, but there are no / or x signs so i dont know if i have to x or / or what! i am slowly trying to learn maths but still have huge amounts to learn. anyway i did a google to try and find out what the actual calculation was. One the sites i came upon (apart from phanderson which again seemed complicated) i came across this site http://vwlowen.co.uk/picaxe/weather-station/page-2.htm
which is basically the same sensor but done with picaxe basic, i dont want to copy the code (i am doing it in C anyway) but i had a look at how he worked out the RH from the ADC reading, and here is a shot of that bit
so i thought i would simply plug my values in and get the equation for my ADC, but i need it checking first to make sure he got it right then to make sure i have it right lol,
now what i was thinking was killing 2 birds one stone and use the pic 30f because it has a great ADC unit and 12 bit's! (you can also make it 10 bit)
anyway doing it his way i get the following (oh forgot to add that the sensor is calibrated at 5V so i was going to use 5V regulated for the sensors and ADC ref)
first he works out the voltage for each ADC step so in my case thats
5V/4096 (12bit) = 0.001220703125
he then rounding off that figure and i was going too but decided against because using just the first 4 digits after the Decimal point makes a big difference in 12bit
then it says because the graph has 0.8V offset he divides that by the mV per ADC to get the number of ADC steps for the offset, now first i did it without rounding it up or down
so for me thats 0.8V/0.001220703125 =655.36 ok i round this to 655steps for the offset but just to show the difference if i had of rounded it to 4 digits like he has it works out like this
so next step
he uses the graph from datasheet and taking offset into account the graph slope is linear (roughly) and is voltage out/%RH
so he gets for Volts per %RH (2.65-0.8)/60 = 0.0308 (rounded )(although it says that a later datasheet say's it's 0.0306)
so the ADC steps per %RH is Volts per %RH / Volts per ADC step
so in my case it's 0.0308/0.001220703125 =25.23136(or rounded 25.23)
then its %RH =ADC reading-655/25.23
to do away with floating point he then x top and bottom by 100 so for me
%RH=ADC(reading)-655(the offset)*100/2523
so is this correct way to do it? like i say i dont need code help (at the moment anyway) just making sure i am on the right track with the figures