Shop OBEX P1 Docs P2 Docs Learn Events
digital thermometer — Parallax Forums

digital thermometer

karabetkarabet Posts: 17
edited 2009-04-08 03:28 in BASIC Stamp
attachment.php?attachmentid=73736attachment.php?attachmentid=73737
630 x 7 - 104B
630 x 196 - 7K

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-16 19:18
    Karabet, this forum is for testing of posts for avatars and signatures. If this is an actual request for help/support it will go unanswered in this forum. Did you mean to post it in the BASIC Stamp Forum? If so I can move it for you.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • karabetkarabet Posts: 17
    edited 2009-03-17 08:35
    Hi Chris,
    Yes I would like to move it to Basic Stamp forum, what I need is the visual basic source code to read the temperature from DS1620 thermometer. I did saw in Parallax, Resources site in the Nuts & Volts Columns:
    On volume 1 Column #42
    Some thing but I need the complete source code.

    Thanks in advance for your help,
    Karabet
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2009-03-17 15:45
    Moving to BASIC Stamp Forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • sylvie369sylvie369 Posts: 1,622
    edited 2009-03-17 16:07
    What you're looking for, I think, is really simply a way to use Visual Basic to display the values of variables sent from a BS2's serial port to the PC. The fact that in your application, those variables represent the values from a digital thermometer is irrelevant to what you really need to know. Once you have the value from the 1620 read into a variable in your BS2, it doesn't matter anymore (to your programming needs) where that value came from.

    I found this page extremely helpful:

    http://www.theabramgroup.com/basicstamp/

    I think if you follow it carefully, it should be pretty clear how to do what you're trying to do.

    ·
  • karabetkarabet Posts: 17
    edited 2009-03-17 21:11
    Hi,
    This is the Basic Stamp Code that I did used to read it from the DS1620 digital thermometer.
    I am using pin 1, 2 and 3 from DS1620.
    I did try to use the link instruction that you did send it to me but still I don’t get any readings.
    What I want is to read the temperature constantly from the basic stamp by VB application….. Is there anyone that has this visual basic source code? Below is·the Basic Stamp code that I’m using please let me know if it is correct and how I can create the VB application..I mean with the debug window from the Basic Stamp it is working and I can see the readings.

    ' Applied Sensors - DS1620.bs2
    ' Obtain temperature readings from the DS1620.
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    x VAR Byte ' General purpose variable, byte.
    degC VAR Byte ' Variable to hold degrees Celsius.
    ' Note: DS1620 has been preprogrammed for mode 2.
    OUTS=%0000000000000000 ' Define the initial state of all pins,
    'FEDCBA9876543210
    DIRS=%1111111111111111 ' as low outputs.
    FREQOUT 0, 20, 3800 ' Beep to signal that it is running.
    HIGH 1 ' Select the DS1620.
    SHIFTOUT 3, 2, LSBFIRST, [noparse][[/noparse]238] ' Send the "start conversions" command.
    LOW 1 ' Do the command.
    DO ' Going to display once per second.
    HIGH 1 ' Select the DS1620.
    SHIFTOUT 3, 2, LSBFIRST, [noparse][[/noparse]170] ' Send the "get data" command.
    SHIFTIN 3, 2, LSBPRE, [noparse][[/noparse]x] ' Get the data.
    LOW 1 ' End the command.
    degC = x / 2 ' Convert the data to degrees C.
    SEROUT 1, 16780 ,· [noparse][[/noparse]degC]
    DEBUG ? degC ' Show the result on the PC screen.
    PAUSE 100 ' 1 second pause.
    LOOP ' Read & display temperature again.

    Thanks
    Karabet
  • FranklinFranklin Posts: 4,747
    edited 2009-03-18 02:22
    You need to write a program in VB that looks at the serial port and reads what you are outputing with your serout command and then processes it in any way you want.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • karabetkarabet Posts: 17
    edited 2009-03-31 08:44
    Please Help,
    How I can use the Basic Stamp 2 as a digital thermometer by reading its temperature from Visual Basic, I’m using DS1620. is there anyone have an example for this or to let me know how to connect the ports and the pins to the VB program?
    Karabet
  • FranklinFranklin Posts: 4,747
    edited 2009-03-31 21:05
    Show us what you have so far. The stamp will connect as a serial port on the computer and you need to send and receive bytes of data to it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • Rock ManRock Man Posts: 8
    edited 2009-03-31 23:15
    does anyone have a code snippet to read the signal from an lm35 temperature sensor and a bs2? preferably just read/store the value in a variable.
  • FranklinFranklin Posts: 4,747
    edited 2009-03-31 23:21
    Isn't the lm35 an analog output? You might try rctime or get an adc. Also what you just did is called hijacking and you should always start your own post unless you are answering the post you are reading.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • JDJD Posts: 570
    edited 2009-04-01 05:41
    jrockwel,

    The LM35 has an analog output, but could be used with an Analog to Digital Converter (ADC) to then be an input for the BASIC Stamp. The BASIC Stamp series has digital inputs only, so you would need to use an ADC to get the various inputs from the sensor; otherwise you would either get 0 or a 1 when the voltage surpassed the logic high threshold (~1.4 VDC). We have an 8-bit or 12-bit ADC available if you would like, although you can pick one up for cheap almost anywhere.

    There is some sample code for the LM34, which is similar to the LM35, except it gives degrees in Fahrenheit (°F); but could be adapted to Celsius (°C) fairly easy. Please let me know if you would like that code, and I will send it to you. The code simply uses a 2.55 volt reference to give a 0 to 255 value, so in essence it measures 0 to 255 °F. Simple enough for the project I wanted to create.
    Hope this helps


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • Rock ManRock Man Posts: 8
    edited 2009-04-01 16:08
    Joshua,

    I would love to take a look at some sample code. For the record, I made a mistake in my post & I do have the LM34. Should I send you a personal email or can you provide the code via this forum?

    Thanks for your help.

    Jeff.
  • JDJD Posts: 570
    edited 2009-04-01 16:15
    Jeff,

    We like to post·custom code on the forums, but this could be added to the product page also. It was originally written for an LCD screen, but then·modified to work with a PC using DEBUG commands. I left the LCD commands in the code so it could be changed back to SEROUT commands quickly.

    I·hope this helps.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • karabetkarabet Posts: 17
    edited 2009-04-02 09:55
    Hi Stephen,

    this is the code that i use for DS1620:

    ' Applied Sensors - DS1620.bs2
    ' Obtain temperature readings from the DS1620.
    '{$STAMP BS2}
    '{$PBASIC 2.5}
    x VAR Byte ' General purpose variable, byte.
    degC VAR Byte ' Variable to hold degrees Celsius.
    ' Note: DS1620 has been preprogrammed for mode 2.
    OUTS=%0000000000000000 ' Define the initial state of all pins,
    'FEDCBA9876543210
    DIRS=%1111111111111111 ' as low outputs.
    FREQOUT 0, 20, 3800 ' Beep to signal that it is running.
    HIGH 13 ' Select the DS1620.
    SHIFTOUT 15, 14, LSBFIRST, [noparse][[/noparse]238] ' Send the "start conversions" command.
    LOW 13 ' Do the command.
    DO ' Going to display once per second.
    HIGH 13 ' Select the DS1620.
    SHIFTOUT 15, 14, LSBFIRST, [noparse][[/noparse]170] ' Send the "get data" command.
    SHIFTIN 15, 14, LSBPRE, [noparse][[/noparse]x] ' Get the data.
    LOW 13 ' End the command.
    degC = x / 2 ' Convert the data to degrees C.
    SEROUT 0, 16780 , [noparse][[/noparse]degC]
    DEBUG ? degC ' Show the result on the PC screen.

    PAUSE 100 ' 1 second pause.
    LOOP ' Read & display temperature again.

    can you please help me to show this in a simple VB form ?
  • karabetkarabet Posts: 17
    edited 2009-04-05 13:35
    help please !!!!!
  • FranklinFranklin Posts: 4,747
    edited 2009-04-05 17:39
    Well it looks like your code is OK. How do you have this connected nad do you use pull up/down resistors on the data lines?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • karabetkarabet Posts: 17
    edited 2009-04-05 18:24
    what do you mean? yes i use on pin no. 1 from the DS1620 a resistor to connect to pin P0 on the basic stamp
  • Radridz3Radridz3 Posts: 49
    edited 2009-04-07 01:25
    Hey guys I'm not trying to hijack this post. And Kar I cant help with VB.. I have started a post looking for code for a dual Temp Controller using a common hd44780 LCD and a BS2 I've been trying to write the code for weeks and have no luck...Temp sensors Digi DS18s20....Please check Thanks}}}]]]]
  • pwillardpwillard Posts: 321
    edited 2009-04-08 03:28
    You can say it's not a hijack... but well, it is.

    Which Stamp do you have. The low end Stamps do not have built in support for 1-wire which is needed for the Maxim DS18s20. You need a BASIC STAMP *2P* version to get 1-wire, at least that's what I've read.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    There's nothing like a new idea and a warm soldering iron.
Sign In or Register to comment.