Shop OBEX P1 Docs P2 Docs Learn Events
Beginner to parallax — Parallax Forums

Beginner to parallax

nic21nic21 Posts: 12
edited 2014-11-23 16:39 in General Discussion
Currently I have a project to work on using Parallax chip. I used ping sensors to detect people. When 2 people are detected, a buzzer will sound and the LCD will display text.
So far, I have wired the board.

I have added in the ping library. What other libraries do I need to add? I am a beginner to parallax. Can someone advise how I can proceed? Or what pre-requisite skills do I need?

Comments

  • ValeTValeT Posts: 308
    edited 2014-10-27 04:19
    Welcome to the forums!

    What kind of chip are you using? Are you using the Propeller or the Basic Stamp?
  • mklrobomklrobo Posts: 420
    edited 2014-10-27 05:41
    :lol: Welcome to the forum!
    If you find out how to program each cogs to perform different programs, let ME know!
    Thanks.
  • ValeTValeT Posts: 308
    edited 2014-10-27 07:50
    mklrobo wrote: »
    :lol: Welcome to the forum!
    If you find out how to program each cogs to perform different programs, let ME know!
    Thanks.

    Are you talking about Propeller C?
  • DomanikDomanik Posts: 233
    edited 2014-10-27 08:19
    Hi nic21,
    I recently played with the Ping sensor. Compared to our human eyes it is severely limited in the information it can provide to a computer. Imagine trying to feel your way around with ONLY a giant Q-Tip while you're poking things. It would be hard to know the size (width and height) or any detail of color, texture, temperature, or to even know if the object is moving. The ping can tell you distance to some extent but that seems to change based on the size and inclination of the object.

    I would suggest to start by carefully reading the Ping))) datasheet and understanding the test results. http://www.parallax.com/product/28015. Dig into the "Downloads & Documentation" for all the info on how to use it.

    Next you might want to do your own experiments to develop a really solid piece of code that can tell the difference between a small object and large object roughly the size of a human. The location would need to be monitored for movement while the pinger scans for other large objects. Movement might be a tell-tale sign the object is alive, but not necessarily.

    You might consider this: https://www.sparkfun.com/products/10335. It will allow your ping to pan and tilt in order to scan an object, it needs the two micro servos.

    Also a consideration is to add temperature. The human body is a 10um infrared source. There are lots of IR sensors and only a few can measure temp at a distance. Check out http://www.dfrobot.com/index.php?route=product/product&filter_name=SEN0093&product_id=569#.UxVM0_mSySo.

    Also read the datasheet on the MLX9014 with a 10 or 20 degree angle. A mounted long range temp sensor pointed in the same direction as the Ping might work well to confirm a 98 degree temp.

    But first of all there are good tutorials about getting started with Ping))) on the Learn section of this website. http://learn.parallax.com/activitybot/build-and-test-ping-sensor-circuit

    Good Luck,:smile:

    Dom..
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-10-27 11:54
    nic21 wrote: »
    I have added in the ping library. What other libraries do I need to add? I am a beginner to parallax. Can someone advise how I can proceed? Or what pre-requisite skills do I need?
    If you are using the Propeller you should find everything you need in the OBEX.
    mklrobo wrote: »
    If you find out how to program each cogs to perform different programs, let ME know!
    This has been done many times in Spin.
  • nic21nic21 Posts: 12
    edited 2014-10-28 21:36
    Hi all,
    Thanks for replying. I am using Propeller and Simple IDE. In Simple IDE, I need to add libraries and I have added Ping.
    Do I need to add libraries to display text on LCD? and also the buzzer.
    Is there any source code to download?
  • DomanikDomanik Posts: 233
    edited 2014-10-28 23:01
    nic21,
    The tutorials are your friend, you should go thru all of them for the ActivityBot.
    http://learn.parallax.com/propeller-c-simple-protocols

    This page describes where to find all libs and html files that describe software and has examples.
    http://learn.parallax.com/C/propeller-c-reference

    Dom..
  • T ChapT Chap Posts: 4,223
    edited 2014-10-29 06:13
    Hi Nic. Be aware that the Ping is ok for close proximity within a few feet. Beyond that it is not consistent unless there is a very reflective surface. Human skin is good for a few feet, but clothing is unreliable as a reflective surface. A better bet is the PIR, you can mount it in a way that has a narrow tube added in front of the lens to "view" through, and this is much better for human detection.
  • Mike GreenMike Green Posts: 23,101
    edited 2014-10-29 18:47
    You didn't mention how you're going to connect a buzzer or what kind of LCD you're using. You'll need a little hardware for the buzzer like a MOSFET switching transistor and a diode to keep down back-EMF (the voltage produced by the buzzer coil when the current is cut off repeatedly to make the buzz). The Propeller will just have to provide a high/low voltage at one I/O pin to control the MOSFET. The BlinkLED tutorial shows how to use the high() and low() calls to do this. The LCD may just require a serial character stream and the "fdserial" library and its tutorial should work fine for that.

    An IRF3708 MOSFET should work fine. Use a 1K resistor between the gate and the Propeller I/O pin and a 100K resistor between the gate and ground. You'll need a diode (like a 1N914 or other switching diode) connected across the buzzer with the cathode to +Vcc. The resistor values shown below will also work.

    MOSFET.jpeg
    259 x 194 - 6K
  • nic21nic21 Posts: 12
    edited 2014-11-13 07:00
    I tried with the ping sensors. They work. Now I want to connect 2x16 LCD to the propeller board. I search on the web but I could not find the source code of parallel LCD in C language. The codes are in assembly language.
    What is the library required to add to simple IDE?

    Ca someone advise me?
  • Mike GreenMike Green Posts: 23,101
    edited 2014-11-13 07:58
    As far as I know, there is no library yet for a parallel LCD for SimpleIDE and C. There is a Spin object for a parallel LCD here in the Object Exchange, but you can't easily mix C and Spin, so it only helps as a model for what could be done.
  • Dave HeinDave Hein Posts: 6,347
    edited 2014-11-13 08:27
    You can use spin2cpp to convert a Spin object to C or C++. The object that Mike referenced looks pretty straightforward, so I don't think spin2cpp will have any problems converting it.
  • nic21nic21 Posts: 12
    edited 2014-11-13 20:38
    Hi Mike,
    Thanks. Are the links correct? I cant download anything from there.
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-11-14 13:25
    Are the links correct?
    Works from my end.
  • mklrobomklrobo Posts: 420
    edited 2014-11-14 13:43
    Vale T,
    I was trying to program in anything to get the cogs to work individually. I found examples to work upon
    in the tutorials section. I have found great pieces of code in the forum, immersed in the threads.

    Dave Hein,
    I looked, and have found the examples in spin that illustrate the cog control, as
    you have mentioned.

    - Thanks to all. Looking through the forum for the code you need
    takes time, but more than likely, something is there that may help.:smile:
  • nic21nic21 Posts: 12
    edited 2014-11-18 01:29
    I only manage to get the ping sensors read the distance.
    Now I want to activate a buzzer when both ping sensors detect less than 150cm.
    I do not know what codes to write to activate the buzzer connect in series to p20.
    Can someone advise me?

    int ping1; // Declare distance variable
    int ping2; // Declare distance variable

    int main() // main function
    {

    while(1) // Repeat indefinitely
    {
    ping1 = ping_cm(18); // Get cm distance from Ping)))
    print("%c ping1 = %d%c cm", // Display distance
    HOME, ping1, CLREOL);
    pause(1000); // Wait 1/5 second

    ping2 = ping_cm(19); // Get cm distance from Ping)))
    print("%c ping2 = %d%c cm", // Display distance
    HOME, ping2, CLREOL);
    pause(1000); // Wait 1/5 second
    if ((ping1<150)& (ping2<150))
    {
    //activate buzzer connected at propeller board (p20)
    }

    pause(1000);

    }
  • nic21nic21 Posts: 12
    edited 2014-11-23 16:39
    I only manage to get the ping sensors read the distance.
    Now I want to activate a buzzer when both ping sensors detect less than 150cm.
    I do not know what codes to write to activate the buzzer connect in series to p20.
    Can someone advise me?

    int ping1; // Declare distance variable
    int ping2; // Declare distance variable

    int main() // main function
    {

    while(1) // Repeat indefinitely
    {
    ping1 = ping_cm(18); // Get cm distance from Ping)))
    print("%c ping1 = %d%c cm", // Display distance
    HOME, ping1, CLREOL);
    pause(1000); // Wait 1/5 second

    ping2 = ping_cm(19); // Get cm distance from Ping)))
    print("%c ping2 = %d%c cm", // Display distance
    HOME, ping2, CLREOL);
    pause(1000); // Wait 1/5 second
    if ((ping1<150)& (ping2<150))
    {
    //activate buzzer connected at propeller board (p20)
    }

    pause(1000);

    }
Sign In or Register to comment.