PIR Sensor on BS2 PBASIC 2.0
lowellbert
Posts: 1
Hello there.
I am building a project that uses the PIR Sensor www.parallax.com/Store/Sensors/ObjectDetection/tabid/176/ProductID/83/List/1/Default.aspx?SortField=ProductName,ProductName
The Sensor is going to be controlling a fan, when the sensor is triggered the fan will turn on, (basically when a person enters the room).
When the person leaves i want it to turn off.
Where i need help is writing the source code. i am still a little new at writing code and any help would be greatly appreciated
I am using
BS2
PBasic 2.0
I am building a project that uses the PIR Sensor www.parallax.com/Store/Sensors/ObjectDetection/tabid/176/ProductID/83/List/1/Default.aspx?SortField=ProductName,ProductName
The Sensor is going to be controlling a fan, when the sensor is triggered the fan will turn on, (basically when a person enters the room).
When the person leaves i want it to turn off.
Where i need help is writing the source code. i am still a little new at writing code and any help would be greatly appreciated
I am using
BS2
PBasic 2.0
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Also, from Resources choose Nuts and Volts Columns which is another great resource for sample programs and all kinds of circuit diagrams. Download and look at #6 which is on controlling things like DC fans with a Stamp using an external switching transistor. If you plan to control an AC fan, you'll need a solid state relay (SSR) which behaves a lot like an LED and there are plenty of examples in "What's a Microcontroller?" and other tutorials of controlling an LED. The PIR sensor is not very different from other sensors that provide a switch closure or logic level on/off signal. Most of the code examples for using pushbuttons or other switches will work with a PIR. The modulated IR detector also works much like the PIR, just slower.
I went and bought a real nice home intrusion PIR unit. It blew me away for about $45.00. It was blue tooth as well. I could be all the way across the room in the kitchen, with a light ficture overhang in front of me (all the PIR could see was a very narrow view of the kitchen, and all I had to do was wave my hand and it would go off.
That, of course would spoil the best part. Exploration, knowledge, and curiosity. Explore both points of view is what Mike would say.