My first IoT project is a room temperature sensor publishing data to cloud.
Google DS18B20 + Raspberry Pi and you fill find many posts about it. I followed one of them
Purchasing the hardware and electronics part was a big difficult in India. The parts are cheap, but finding the correct ones on internet or local shops was a bit challenging for me.
Once I procured all the hardware, the only change in the above circuit diagram is to use 5V rather than 3.3V. With 3.3V, sensor was getting detected, but there was no reading from it.
Data is read by Python function
inputfile = open("/sys/bus/w1/devices/28-031464907dff/w1_slave")
text = inputfile.read()
tempdata = text.split("\n").split(" ")
temp = float(tempdata[2:])
temp = temp / 1000
temp = int(round(temp,precision))
To upload use API provided by data.sparkfun.com
url = "http://data.sparkfun.com/input/<public_key>?private_key=<your_key>&temp=" + temp
result = urllib2.urlopen(url).read()
And that’s it! This is an always on temperature sensor. You can not only publish it to internet, you can also use the reading to take decisions like controlling other IoT things.