Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to do this project with BS ? — Parallax Forums

Is it possible to do this project with BS ?

AndyChenAndyChen Posts: 5
edited 2006-02-21 05:42 in BASIC Stamp
Dear all,

I'm blank with basic stamp (BS).
I have a project to do have no any experience with this before.
I have a scale device (weight indicator) sends data (weight) in fixed string continously via rs232 with specifed baudrate, parity and databit.
I need a module to be a checkweigher (weight checker). If the weight is out of range, it'll turn on a light turn the light off if it's in the range.

Is it possilbe to do this project with BS? what should I have/do ?

Please help me to do this project..


Thanks..

Comments

  • stamptrolstamptrol Posts: 1,731
    edited 2006-02-20 13:55
    Andy,

    This is very possible with a BS2. I have worked on many scale projects, up to a fully automated, legal-for-trade system for large trucks.

    You will just set the stamp to watch the serial data string, extract the weight component of it and do your comparison.

    Your program will be very small: really a short loop with a SERIN command. I usually use the WAIT modifier to watch for the beginning of the weight indicator string ( its ascii 002 on many indicators ), grab the characters with the STR modifier, then look at the weight.

    Regards,
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-02-20 15:52
    AndyChen said...
    I have a scale device (weight indicator) sends data (weight) in fixed string continously via rs232 with specifed baudrate, parity and databit.
    About Parity -- the STAMPs are great for serial data, provided it's:·
    1. 8-N-1 [noparse][[/noparse]8 data bits, no parity, 1 stop bit]
    2. 7-E-1 [noparse][[/noparse]7 data bits, even parity, 1 stop bit.]

    Provided your scale data is one of those two formats, then your project can be done.
  • AndyChenAndyChen Posts: 5
    edited 2006-02-21 02:11
    Thanks Stamrol and PJ Allen,

    So it's very possible to do with BS. But as you know, I'm blank with BS.
    Does this module connect standalone to the scale·(I mean there is no computer connected to module or scale) ?
    How does it work ? I mean I just buy BS2 module, do programming, and relay circuits to lights up LED. that's it?
    How much money should I spent for one complete module ?

    May I contact you privately (email) ?

    Thanks again for your help. Please don't be bored to help me..
    Hopefully I got reply as soon as..
    Thank you..


    Regards,


    Andy
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-21 02:29
    You can "unblank" your slate with lots of free information from Parallax; start with "What's A Microcontroller?" You'll find it on our web site as a free download.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • AndyChenAndyChen Posts: 5
    edited 2006-02-21 02:35
    Thanks.. I'm going to start "unblank" my slate.. But still hopefully all of you never mind to help me..

    Best regards,

    Andy
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-02-21 03:11
    Yup, it should be doable with the BS2, as long as:
    1. The Scale baud rate is 9600 baud or below
    2. It's 8N1, or 7E1
    3. Yes, the BS2, once programmed, is a 'stand-alone' device. It encorporates an on-module eeprom for program storage, an on-module PIC processor with register-RAM for processing. The PBasic language is uses is fairly simple, but has built in SERIN/SEROUT command for doing RS-232 I/O on any pin. It even has an on-module oscillator, so all you have to do to run the device is add 4 AA batteries, or a single 9-volt battery. Oh, and it has an on-module low-dropout voltage regulator too, so it's even pretty forgiving about voltages.

    The program should be something like:

    LEDPin CON 2
    ScaleSerial CON 16 ' 16 if using the 'programming port'
    ScaleBaud CON 16384 ' You want the constant for "9600, Inverted" if using the 'progamming port'. Check the SEROUT documentation
    ScaleValue VAR WORD ' 16-bit word variable. BIT, BYTE, and NIB are also available
    LimitValue CON 1000 ' Or whatever value you decide to put the limit at.

    Main:
    SERIN ScaleSerial, ScaleBaud, [noparse][[/noparse]DEC ScaleValue] ' As long as the Scale is outputting its data with some kind of delimiter, like CR or space or comma, DEC can handle it
    ' There's several modifiers for data for SERIN, like STR, WAIT, so you can handle almost any situation.
    IF ScaleValue > LimitValue THEN
    GOSUB LightLED
    ELSE
    GOSUB OutLED
    END IF
    GOTO MAIN

    LightLED:
    LOW LEDPin
    RETURN

    OutLED:
    High LEDPin
    RETURN
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-02-21 03:13
    The best start you could give yourself would be to purchase one of the BOE (Board Of Education) based kits, WITH a BS2 AND make sure you get a wall-wart power supply. Then add a few components to the bread-board, and try stuff out. In a day or two you could have your full solution. Purchase a Super Carrier board also if you want some prototype board that will look nice in a Radio Shack project box.

    Probably this kit: http://www.parallax.com/detail.asp?product_id=27207· will have everything you need (except for that pesky wall-wart supply, make sure you add $7.00 to get it from Parallax).

    Not bad for $150 or so.
  • AndyChenAndyChen Posts: 5
    edited 2006-02-21 04:35
    Thanks allanlane5,
    I'm going to learn BS2. It sound so interesting. unfortunately, I'm not an electrical technician. I'm just a software programmer. I'll try my best to learn it. and hopefully you all may halp me when I need. Please don't be bored to help me..
    Thank you..
    oh, if BS2 is programmed, can we re-programme it again ? you know, just for trial..

    Best regards,

    Andy
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-02-21 05:19
    Andy -

    Yes, any of the Stamp modules can be programmed and re-programmed many, many times. Just by way of example, let's say you finish this project to your present satisfaction and 6 months from now you want to add something to it. Still no problem. Just take your existing program code (WHICH YOU SAVED SAFELY SOMEWHERE!) and update it with the new routines, and re-program the Stamp with it. Simple as that, and one of the more compelling reason for using the PBASIC Stamp modules!

    So long as you are willing to do your part in reading and learning from what the responders post in answer to your questions, I doubt that anyone will get bored with you, or anyone else. We generally only get "bored" when we make suggestions, or offer answers and the suggestions or answers aren't heeded.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
  • AndyChenAndyChen Posts: 5
    edited 2006-02-21 05:42
    Thanks Bruce Bates and all who spent their time to view and reply my post.
    You know I was wondering there is no body to anwser my question.. But I'm supprised that are many of you responded my post and gave me good information and explanation.

    Thank you.. [noparse]:)[/noparse]

    Best regards,

    Andy
Sign In or Register to comment.