Beginner to parallax
nic21
Posts: 12
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?
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
What kind of chip are you using? Are you using the Propeller or the Basic Stamp?
If you find out how to program each cogs to perform different programs, let ME know!
Thanks.
Are you talking about Propeller C?
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,
Dom..
This has been done many times in Spin.
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?
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..
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.
What is the library required to add to simple IDE?
Ca someone advise me?
Thanks. Are the links correct? I cant download anything from there.
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.
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);
}
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);
}