Shop OBEX P1 Docs P2 Docs Learn Events
Few (probably dumb) questions — Parallax Forums

Few (probably dumb) questions

AltarCrystalAltarCrystal Posts: 10
edited 2008-05-16 05:25 in BASIC Stamp
Hello, I just happened to stumble upon the BASIC Stamp just yesterday. I won't go into too much detail, but while looking for parts for a project I'm working on in my spare time, I happened upon the light-to-frequency sensor, and the PIR sensors. I blindly picked up one of each, and discovered that I must place these in a BASIC stamp.

Now, my question is, I'm looking at a BS2e right now to connect atleast the light sensor, and upon the lights turning on, a signal will be sent to a much larger program I've been working on, and from there, the program will handle what to do. I don't need to know the intensity of the light, just merely are they on or off. Can this be achived with said chip and the ltf sensor?

Also, all but one computer on my network run linux, and from what I see, many of the editors are meant for windows machines. I do have one computer still running XP that I use for games, but it does NOT have a serial port on it. My question is can I either A) Edit these in linux or B) is there a Serial to USB adapter I can use? I know they exist, but I'm not sure if there is something special with these.

Finally, going along the lines of the light sensor, if I have a PIR connected to a separate (I assume I HAVE to have it connected to a separate chip), can I do the same thing, send a signal to my existing program (Just if movement is detected, nothing fancy) and handle it from there?

The existing program is written in C, and must remain that way (Mostly because the existing libraries are only available in C/C++ for what I'm developing. I do, however, know BASIC, and also some lower-level stuff, so if I have to hack something together, I may be able to swing it.

Thanks! And I'm sure this isn't all I have to ask.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-12 01:52
    Yes, the Stamp can measure the light level and send a signal to the PC when the light is above or below some threshold. For that matter, the Stamp can send some value that corresponds to the light level on the light-to-frequency sensor and send the status of the PIR as well to the PC. Download one or the other Linux editors / compiler interfaces and look through the documentation. Go to the main Parallax web page, choose the Resources tab, then the Downloads link and look on that page for the Linux software.

    One Stamp can handle both sensors and can communicate over a serial port to a Linux program. If your PC doesn't have a standard RS232 serial port you can devote, get a USB to serial adapter, preferably one using the FTDI chip. Not all USB to serial adapters will work for programming a Stamp. A lot of adapters don't implement the handshaking lines (like DTR) properly and that's the source of problems.
  • FranklinFranklin Posts: 4,747
    edited 2008-05-12 02:36
    You don't really need the stamp to use the sensors but it will make it WAY more easy than not. The support on this forum is fantastic and since all the parts are from the same company they will work together well. Happy stamping (and listen to Mike, he knows it all...well most of it)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • AltarCrystalAltarCrystal Posts: 10
    edited 2008-05-12 03:33
    Alright, thanks for the quick response guys! Got another for you. Does anyone know the maximum length serial cable that's been used with a stamp? I read that average ports allow around 10 meters, but it varies greatly. I'm not looking to run this any further than 10 meters, but unless I change my mind.

    EDIT: Also, after looking aroung a bit, I assume I also need a carrier board for the stamp I get? Anything else I should throw in besides serial cables (If I CAN write this in linux, I have a free serial port, but I don't htink any spare serial cables). Also, is there any advantage to the super carrier board over the normal one?

    Post Edited (AltarCrystal) : 5/12/2008 3:53:02 AM GMT
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-12 04:25
    The length of the cable depends on the speed you're trying to handle, the quality of the cable you're using, what voltage levels you're using, and the electrical noise in the environment. If you plan to use the Stamp board's not-quite-RS232 connector, I wouldn't try to run it 10 meters. 2 or 3 meters should be fine. If you use a TTL to RS232 converter like a MAX232, you'll do much better with the longer distance.

    A super carrier board or a Board of Education will give you a voltage regulator, reset button, and serial connector for programming. Neither one provides a MAX232-type TTL to RS232 converter. The super carrier board provides some space for a solder-on/wire-wrap work area. The Board of Education provides a small breadboard area for experimentation and testing instead.

    With just a PIR sensor and a light to freq. sensor, you could run the whole thing off the Stamp's own regulator and a 6-9V power input, but you do need a socket and a programming connector. A Board of Education is handy for experimenting and a super carrier board is handy for a permanent soldered setup.

    Post Edited (Mike Green) : 5/12/2008 4:31:23 AM GMT
  • AltarCrystalAltarCrystal Posts: 10
    edited 2008-05-12 17:32
    Alright, thanks again! Now just gotta wait for the stamp to get here...always the hard part. tongue.gif
  • GICU812GICU812 Posts: 289
    edited 2008-05-16 05:25
    If you just wanted to know if the lights were on or not, a CDS cell would probably be a lot cheaper alternative. Just an idea, in case you needed a few of them or something, CDS cells are just pennys.
  • GICU812GICU812 Posts: 289
    edited 2008-05-16 05:25
    If you just wanted to know if the lights were on or not, a CDS cell would probably be a lot cheaper alternative. Just an idea, in case you needed a few of them or something, CDS cells are just pennys.
Sign In or Register to comment.