Shop OBEX P1 Docs P2 Docs Learn Events
help me architect an industrial temperature controller — Parallax Forums

help me architect an industrial temperature controller

JasonCJasonC Posts: 3
edited 2010-09-22 17:34 in BASIC Stamp
Hi, I'm new here, pls. be kind. :)

I'm an analog design engineer, and not entirely new to microcontrollers.
In a former life I did C programming and I know a bit of BASIC. And I recently completed a small personal project using an Arduino.

The temperature controller needs to have an IR temp sensor, an LCD readout, 2 push buttons, and one output for the heater (on/off command). It's a one-off project, and thus not super cost sensitive.

Priority is in ease of coding. I'm not a software weenie, my wares are hard. ;) I want to reuse as much code as possible, especially the serial comm stuff. (to the IR temp sensor, and the LCD readout). This is why I'm considering the Stamp over the Arduino, I like the sample code for the below IR module and the LCD readout. It will take me 10x longer writing the serial comm stuff than writing the heater control loop stuff (it's bang-bang and I have analog and digital control system design experience).

So I'm thinking of using this IR temperature module
MLX90614 Infrared Thermometer Module
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/MLX90614/List/0/SortField/4/ProductID/539/Default.aspx

and this LCD readout
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/lcd/List/0/SortField/4/ProductID/50/Default.aspx

and the Basic Stamp 2.

So my first Q is - can the BS2 do serial comm with both the LCD and the IR module?

TIA.

Comments

  • $WMc%$WMc% Posts: 1,884
    edited 2010-09-21 16:16
    JasonC wrote: »
    Hi, I'm new here, pls. be kind. :)

    I'm an analog design engineer, and not entirely new to microcontrollers.
    In a former life I did C programming and I know a bit of BASIC. And I recently completed a small personal project using an Arduino.

    The temperature controller needs to have an IR temp sensor, an LCD readout, 2 push buttons, and one output for the heater (on/off command). It's a one-off project, and thus not super cost sensitive.

    Priority is in ease of coding. I'm not a software weenie, my wares are hard. ;) I want to reuse as much code as possible, especially the serial comm stuff. (to the IR temp sensor, and the LCD readout). This is why I'm considering the Stamp over the Arduino, I like the sample code for the below IR module and the LCD readout. It will take me 10x longer writing the serial comm stuff than writing the heater control loop stuff (it's bang-bang and I have analog and digital control system design experience).

    So I'm thinking of using this IR temperature module
    MLX90614 Infrared Thermometer Module
    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/MLX90614/List/0/SortField/4/ProductID/539/Default.aspx

    and this LCD readout
    http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/lcd/List/0/SortField/4/ProductID/50/Default.aspx

    and the Basic Stamp 2.

    So my first Q is - can the BS2 do serial comm with both the LCD and the IR module?

    TIA.
    '
    Yes
    '
    I would use the BS2P24 or 40 'the 40 has more I/O pins but I don't think you'll them for this little project.
    '
    You could also write a debug window back to the PC through the programming port to help get all the code working.
    '
    Multiple comms aren't a problem.
    This is just a days work for the BS2P
    '
    Do a little research, Experiment ,Ask some more questions if needed
  • JasonCJasonC Posts: 3
    edited 2010-09-21 17:05
    Thanks. So I just use a generic pin or two for each of the serial devices?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-21 17:21
    Yes. The only limitation is that a Stamp can only do one operation at a time, so it can only transmit or receive via one I/O pin at a time. The IR sensor and the LCD would not be a problem since they're passive devices. They only "speak when spoken to" and just wait patiently for commands and data to be sent from the Stamp.
  • JasonCJasonC Posts: 3
    edited 2010-09-22 14:45
    Thanks. Does the BS2 have some kind of real time clock? I need timing with about a half second cadence and it only needs to be accurate to within 5% ish.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-09-22 15:32
    There's no built-in real time clock, but timing on a 1/2 second cycle with about a 5% accuracy is possible depending on what you're trying to accomplish in a cycle. The Stamp's internal clock is controlled by a resonator and this is used for serial I/O timing as well as statements like COUNT, PULSIN, PULSOUT, and PAUSE.

    The PAUSE statement is often used for timing with a resolution of 1ms. Typically, you'd have a loop that takes approximately the same time to execute regardless of what it does and, overall, takes a few milliseconds to execute. You add a PAUSE statement to the loop that uses up the rest of the 500ms loop time with 1ms accuracy.
  • $WMc%$WMc% Posts: 1,884
    edited 2010-09-22 17:34
    Multiple comms aren't a problem.
    '
    Take a look at the StampWorks Manuel
    http://www.parallax.com/Portals/0/Downloads/docs/books/sw/Web-SW-v2.1.pdf
    '
    This has some of the best demo code to get used to the BS2. Its explained very well.
    '
    Don't try to write all of the code at once.
    '
    Start a DEBUG window. Make it work from the example code.
    '
    Now send the data from the IR unit to the DEBUG window
    '
    Next - send the info to the LCD.
    '
    When you get the LCD reading the data you want, Simply remove the DEBUG statement
Sign In or Register to comment.