Thermometer Project

matt2466

Member
Hi everyone

I'm about to embark on creating a Digital Thermometer. At the moment I have a 1 x PICAXE-08M and a 1 x DS18B20. I've scanned through this forum and read most of the suggestions and links provided. However I was thinking of interfacing the bluetooth module Promi-ESD to the PICAXE-08M and have the temperature readings transmitted via bluetooth to a mobile phone. Would this be possible?

Would appreaciate it if links to schematics or codes, similar to this project could be provided.

Thanks a million.
 
Last edited:

manuka

Senior Member
That's quite imaginative, but 2.4GHz ranges will be pretty mediocre ( ~10m) unless line of sight! Suggest you first get to know BT/XBee as they're more involved than you may realize -08M/DS18B20 temperature circuitry however is a breeze. Stan
 
do you want to send it through bluetooth so that the mobile phone and forward it as a sms? if so i have just done a hack approach using 08M connecting it directly to the keypad and pressing the buttons. works well and is pretty cheap to set up.
 

matt2466

Member
Thanks for the reply everyone.

Infact this would be the 1st time i'm using a bluetooth module so i'm kind of unfamiliar with the terms "AT commands" or "BT/XBee" are these commands used within the 08M or Bluetooth communication?

I found this link and i'm guessing the schematic and code provided on this page would be usable for my project (just the digital thermometer without the bluetooth module).

Manuka - Yes, my intention would be having both thermometer and mobile device within 10m of each other. Kind of monitoring the user's body temperature.

Mark - Yes, I have actually considered an sms be sent out once a certain temperature has been hit. So it would be DS18B20->08M->Bluetooth->Mobile Device->SMS sent. I would be interested to learn more about what you have done.
 
Last edited:

Andrew Cowan

Senior Member
xBee is the wireless method that rev-ed sells boards to directly interface with PICAXEs. It works on two way 2.4GHz communication.

Andrew
 

hippy

Ex-Staff (retired)
Infact this would be the 1st time i'm using a bluetooth module so i'm kind of unfamiliar with the terms "AT commands" or "BT/XBee" are these commands used within the 08M or Bluetooth communication?
These are commands which are sent to a device to configure and control it, modems, BlueTooth, XBee etc. They'll be sent from a PICAXE to the device ( using SEROUT usually ) and responses will be received back to confirm settings and command actions ( using SERIN but it's not always that simple ).

The AT Commands a particular device uses are usually found in its datasheet. From a PICAXE perspective these could be anything so won't be described in PICAXE documentation except for particular projects which need to use AT commands.
 

matt2466

Member
Hi guys I would like to confirm this - The DS18B20 is a digital thermometer right? Does that mean its output is already binary that the pixace can understand? For example if I want the picaxe to light up an LED when the temp reaches say 30 deg C...can I just write the code using 30 as the value before a gosub to the LED section? Is there a need for any conversion?
 

matt2466

Member
Hi there I have another 2 questions.

1. Should I GND all unsed pins/initialise them to low or leave them hanging? I'm testing the picaxe chip on a breadboard not the axe board.

2. When coding, is it possible to use numbers with decimal points? Eg 36.9 I want the picaxe to do turn on an LED when the DS18B20 senses above 36.9 deg C.

Thanks for the help
 

Andrew Cowan

Senior Member
From manual 1: (although I usually don't do this and have never had problems, it does lower current draw)

Inputs:
An input should be above (0.8 x power supply) to be high, below (0.2 x power
supply) to be low. It is recommended, but not essential, to tie unused inputs
low via a 10k resistor.


Readtemp12 reads a more accurate temperature, although PICAXE does not support decimal places or fractions so it needs converting.

From manual 2:
This command is for advanced users only. For standard ‘whole degree’ data use
the readtemp command.
The temperature is read back as the raw 12 bit data into a word variable (0.125
degree resolution). The user must interpret the data through mathematical
manipulation. See the DS18B20 datasheet (www.dalsemi.com) for more
information on the 12 bit Temperature/Data relationship.
See the readtemp command for a suitable circuit.


Andrew
 
Last edited:

Mycroft2152

Senior Member
Tie all unused inputs to ground. "Floating" inputs can create havoc.

This will also increase battery life.

Myc
 
Last edited:

matt2466

Member
Ok things are not going well for me :confused: I managed to write a simple alternating LED code and successfully downloaded it to my picaxe. Now here is where i'm lost:

1. I should switch the jumper on the proto-board from "prog" to "out" correct?

2. Nothing happened. Both LEDs did not even light up.

3. Used a multimeter to measure the voltage at both anodes, below are the findings:

LED 1 connected to output pin 1(Leg 6) - Voltage fluctuates between 1.2ish ~ 1.3ish

LED 2 connected to output pin 2(Leg 5) - Voltage fluctuates between 0.5ish to 4.5ish

A 330R was connected between the output pins and the LEDs.

I used "high 1" & "low 1" to toogle LED 1 and "high 2" & "low 2" to toogle LED 2 (minus the " ").

Any insights into this would be appreciated.
 

matt2466

Member
init:
low 1
low 2

red_on:
high 1
pause 200
low 1
goto green_on

green_on:
high 2
pause 200
low 2
goto red_on

Hope this helps...Red LED is using output 1 & Green LED is using output 2.
 

eclectic

Moderator
Matt.

I've just tried your prog. on an 08M protoboard.

It works fine.

Some suggestions:

1. Are the LED's connected the correct way?
(Long leg to pin. Short leg towards resistor >> gnd)

2. Have you checked the values of the resistors?

3. Yes, the jumper should go to the "OUT"
Actually, for mine, I've soldered the three pins together.

e.
 

matt2466

Member
Matt.

I've just tried your prog. on an 08M protoboard.

It works fine.

Some suggestions:

1. Are the LED's connected the correct way?
(Long leg to pin. Short leg towards resistor >> gnd)

2. Have you checked the values of the resistors?

3. Yes, the jumper should go to the "OUT"
Actually, for mine, I've soldered the three pins together.

e.
*Smacks head...found the problem!!! My breadboard has some broken connections and as my luck would have it I choose to ground the LEDs in a faulty hole among the thousands of working ones...ok got it working now

Thanks for your help in testing my prog.
 

eclectic

Moderator
*Smacks head...found the problem!!! My breadboard has some broken connections and as my luck would have it I choose to ground the LEDs in a faulty hole among the thousands of working ones...ok got it working now

Thanks for your help in testing my prog.
No problem.

And, I've also tried Prof. Anderson's DS18B20 program on an 08M

It works perfectly.

e
 

westaust55

Moderator
True for the READTEMP command.

Not quite so straight forward with the READTEMP12 command where can get better resolution, if needed, but some simple maths needs to be applied first to convert to an actual degree value
 

westaust55

Moderator
e,

yes, that includes the simple maths I mentioned. PHA has the increment right.

The Picaxe manual 2 page 129 has two errors:
1. The increment is 0.0625 as per the PHA example not 0.125 deg/increment as staed in the manual
2. The comment states "read value into b1" and should read "Read value into w1"
 

matt2466

Member
Hi guys! I've finally completed phase 1 of my project thanks to the help provided in this forum. I managed to use LEDs to simulate events when certain temperature readings are achieved. Somehow I can't get pin 1 to control the LED so I just used pin 0 adn pin 2.

I'm trying to display the temperature readings from the picaxe on my PC using the Programming Editor's inbuilt Terminal function. However do I really need to make use of pin 0 since its reserved as a serial out port? I'm making use of the serout command to send the data to the PC via serial communication.

Thanks again
 

eclectic

Moderator
Hi guys! I've finally completed phase 1 of my project thanks to the help provided in this forum. I managed to use LEDs to simulate events when certain temperature readings are achieved. Somehow I can't get pin 1 to control the LED so I just used pin 0 adn pin 2.

I'm trying to display the temperature readings from the picaxe on my PC using the Programming Editor's inbuilt Terminal function. However do I really need to make use of pin 0 since its reserved as a serial out port? I'm making use of the serout command to send the data to the PC via serial communication.

Thanks again
Matt. A couple of things.

Could you post your latest program?
Then, could you list what you want each pin to "do"?
e
 
Top