Shop OBEX P1 Docs P2 Docs Learn Events
What can a BS2 do? — Parallax Forums

What can a BS2 do?

matt167matt167 Posts: 7
edited 2013-02-26 12:13 in BASIC Stamp
Just got a Basic Stamp Homework board/ kit ( early Christmas present ). I'v wanted for a PLC or microcontroller to mess with for a while. What is the limitation of the BS2?
I'm going thru the book pretty quick, but I arleady want to break off and do my own thing.. I have a slight background with programming in Basic, so the coding is pretty easy for me to pick up/ write. Of course their is trial/ error but that's all the fun

What I really want to do, is create an automatic start/stop for my home built gasoline powered Air compressor. I know I need the electric start kits for the engines ( Dual pump setup )..

Would like it to work like this

Push button to override starter system for initial ( cold start )- it would be cool if I could get some form of tach signal so that it knew when to stop. Press the button and wait for the engines to start, but without choke controls, it would take some cranking

Compressor reaches max pressure of say 120 PSI, trips pressure switch on ( or off depending on what type of switch would work better )

Microcontroller grounds out ignition system ( Magneto ) to kill engines. 2-3 second hold time on that circuit would be enough

Pressure drops below threshold

Normally closed pressure switch opens when pressure drops to say 100 PSI

Microcontroller sends power to the start relay and spins the starter to start the Engine. Hold time for a couple seconds most likely

Process repeats- should be 2 separate circuits for both engines

This should be all timed sequences, so not too complex. A Carbon monoxide sensor could be used to shut the system down, but it's not needed. I do want to have a panel with LED's for all functions. engines running, engine stopping, Up to pressure ect...
Any insight as to if this will work with a BS2?

Comments

  • davejamesdavejames Posts: 4,047
    edited 2012-12-21 14:13
    matt167 - welcome to the Forum!

    I'm sure others will chime in regarding your request...but in the meantime, I'd like to steer you to some sources of information that might answer your general question of "what can a BS2 do?"

    http://www.parallax.com/tabid/272/Default.aspx

    http://www.parallax.com/tabid/440/Default.aspx

    And, you may not know that pretty much all the Stamp related manuals are available for download. If interested, goto to www.parallax.com and look in the store. You'll find numerous manuals dealing with all sorts of stuff.

    Actually, just perusing the various forums here will give you an idea of its capabilites.


    Good success with your project!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-21 15:20
    matt167, Once you start using microcontrollers, you'll wonder how you ever got by without them.

    I don't use Basic Stamps much myself (you're welcome to ask what I do use and why :smile:), but based on your list of tasks you want the BS2 to handle, I think it should be able to meet your requirements just fine.
  • PliersPliers Posts: 280
    edited 2012-12-21 18:59
    Sounds like a great project.
    I spent some time thinking about a control system for my air compressor.
    One item I wanted to do was a compressor performance test. The controller would monitor the time it took to pressurize the air tank.
    If the pump "on time" was too long a warning would be given. I also wanted things like a temperature monitor, vibration alert, wireless remote on/ off, hour meter,email notification.
    Keep us informed of your progress.
    Best regards.
  • stamptrolstamptrol Posts: 1,731
    edited 2012-12-22 04:14
    Hi Matt, welcome to the forums.

    The BS2 is an ideal way to get into control projects. I've used them for many years in industrial controllers and they never disappoint.

    The limitations are almost always in the guy doing the programming! There's usually a way to do what you want with a bit of ingenuity.
    Over time, you'll develop your own skills to solve the problems as they come up.

    I did a similar project on a backup diesel generator. The starting and stopping cycles are the most important. You have to take into account
    what happens if the engine doesn't fire up. How do you know it started? I used a sensor on the crankshaft.

    Stopping a big engine can take longer than you think. Again, having a sensor to confirm that it really stopped is useful.

    The Stamp can do all this with a bit of planning to give you enough inputs/outputs for the external equipment.

    Start the project and ask questions as the problems come up. You'll find lots of help here.

    Cheers,
  • sylvie369sylvie369 Posts: 1,622
    edited 2012-12-22 08:39
    You'll find that when you learn to write the programs and build the circuits needed to interface the BS2 that it can do an amazing variety of things. The two limitations that can "bite" you are the fact that as a processor, it's fairly slow, and that like most processors, it can only do one thing at a time. I don't think either of those limitations will really get in the way of anything you're hoping to do with it. But the latter one presents something you need to think about while you set up your devices. Don't waste time trying to get it to do two things at once: set it up to do one thing and then the other and you'll be just fine.

    The other thing is you need to make sure you've saved your programs properly in a place where you can find them again. You cannot read a program off of the BS2 board back into your computer. That's a fairly common question here on the forums ("how do I...?"), and the answer is "you should have thought of that before you lost the program on your computer". Better to be aware in advance.

    And yes, these forums will give you all the support you need. You're in the right place.
  • matt167matt167 Posts: 7
    edited 2012-12-22 16:18
    Thanks for the quick replies. The doing one thing at once was a concern of mine, and I was thinking that it would be best to run 2 controllers, one for each engine/ pump. After all, I only need to write one program, and it would be saved on a CD and 2 seperate hard drive

    A crankshaft sensor was something I was thinking of. I think the hall effect sensor that Parallax sells will work, along with a magnet affixed to the crankshaft pulley.
    The engines are not large, just 6.5HP single cylinder Honda clone engines, so they should not take more than a few seconds to shut down, but even holding that circuit for 10 seconds would be ok, sensor would be good too, I just don't know how to make it happen that way.
  • matt167matt167 Posts: 7
    edited 2012-12-25 17:33
    Coded this outside of The Editor, so I know it is not formatted correctly, but I did it up quick. Not on my Windows partition right now, and my Linux partition does not have a compiled Linux version


    Main:
    Input 8
    Input 9
    output 10
    Output 11
    Output 12

    Start_Loop:
    If In8 = 1 then contact
    Goto Stop:

    Contact:
    High 10
    High 12
    Pause 3000
    Low 10
    Low 12
    If In9 = 0 Pause 10000 then goto Contact:

    Stop:
    High 11
    Pause 10000
    Low 11

    Loop

    Input 8 would be a compressor pressure unloader/ switch
    Input 9 would be a relay closed by the 12v charging system from the engine to sense if it did not start. Work by sending power from the board to pin 5 when that circuit is completed
    Output 10 would be for the starter motor ( need extra relay also )
    Output 11 would be a ground for the magneto ( also need a relay for )
    Output 12 is really not needed, just added it as an example for a possible lit LED while starting.. Could do 3. Start ( Amber ), Run ( Green ) and Stop ( Red ), but I will probably keep it simple and not use them

    Any insight? This will be my first Pbasic program not from the " What is a Microcontroller " book, so I expect that at least some is bad code.
  • ercoerco Posts: 20,257
    edited 2012-12-25 18:04
    Other than the illegal use of the STOP keyword as a label, the syntax is fine. Now whether it wroks as intended is a completely different matter. :)

    You can always use the label stopp: or sstop: I doubt if I'm the only genius who has resorted to that tactic!

    And BTW, I like the zippy, upbeat name of this thread. A BS2 can do a LOT even though it's nearly 20 years old! Most people will just say "upgrade to the Prop", but a few of us here enjoy pushing the BS2's limits and showing that it's more capable than some people think. I'm still not sure if Chris Savage of Parallax is convinced that I got a BS2 working as a quadrature encoder at 394 pulses per second: http://forums.parallax.com/showthread.php?121179-Reading-Quadrature-Encoders&p=899765&viewfull=1#post899765 :)
  • matt167matt167 Posts: 7
    edited 2012-12-25 18:22
    After I wrote the code and posted it, looking at it I was thinking "STOP" would not work as a label. stopp: would probably be what I would use. Just need it to work is all.

    I will test the program with some Led's and switches to verify that it will do what I need of it.. I Think I'm missing some code, but I will have it figured out, because now I have something I know I can work off of. I probably won't touch the actual compressor until spring.

    Originally, I had a low pressure sensor and a high pressure sensor as inputs, but I think using the unloader with it's built in on/off switch will be easier, as that is one input, with a mechanical reset based on the pressure
  • playinmyblues_nsccplayinmyblues_nscc Posts: 38
    edited 2012-12-28 07:40
    The BS2 is often sold short in other forums. However, you can surprise a lot of people by using the code to the best of your ability. I really suggest working through the StampWorks book or PDF. Once you work through that then you will have a much better idea of what the BS2 can do. As long as you have a BS2 you can order components as listed instead of buying the whole StampWorks kit. Before you start in on the StampWorks book you will need to go through the schematics for the Professional Development Board (PDB - the BS2 version and not the Propeller version) and make an Bill of Materials of all the components. If not, then some of the experiments might not work as expected. Take note of special features of the PDB such as the real-time-clock and the RS232 interface. The audio amp is probably a little easier to build by yourself.
  • ercoerco Posts: 20,257
    edited 2012-12-29 19:33
    Well-said, playinmyblues_nscc! You're new here but it sounds like you're no stranger to electronics projects. Welcome to the forums and we value your insight and input!
  • matt167matt167 Posts: 7
    edited 2013-01-01 15:45
    Sounds like a plan. PDF is downloaded
  • playinmyblues_nsccplayinmyblues_nscc Posts: 38
    edited 2013-02-26 12:13
    matt167, you can check out my latest post about my Luna Mod Looper Basic Stamp 2 Version here: http://forums.parallax.com/showthread.php/144865-Luna-Mod-Looper-Basic-Stamp-2-Version

    I know, it might seem like a little bit of a hijack but, this is "What can a BS2 do?" The next version should have some extra features that I am hoping are workable with the BS2. Check the Conclusion of the Instructable for some ideas I had at the end of making the first prototype. However, I do have some new ideas that came about from building this latest version. I am excited about working on them. Hopefully, some of these features will make it into the device I plan on submitting to the www.instructables.com UP! Contest. Check it out. There are 10 3D printers up for grabs!
Sign In or Register to comment.