Editor Version ×
Standard

1.Easy to use and quick to get started

2.The process supports design scales of 300 devices or 1000 pads

3.Supports simple circuit simulation

4.For students, teachers, creators

Profession

1.Brand new interactions and interfaces

2.Smooth support for design sizes of over 5,000 devices or 10,000 pads

3.More rigorous design constraints, more standardized processes

4.For enterprises, more professional users

Ongoing

STD Grove - Collision Sensor copy

License:

Mode: Editors' pick

Cloned from Grove - Collision Sensor

  • 545
  • 0
  • 0
Update time: 2018-08-04 11:22:48
Creation time: 2018-08-04 11:22:45
Description
Grove - Collision Sensor ------------------------ ![enter image description here][1] Have you ever been bothered for detecting simple collisions with complex algorithm with an acceleration sensor? The collision sensor is here to simplify the process,. It's also omni directional, stable, and sensitive. Features Wide power supply range DC3.3V to 5V Grove module High sensitive RoHS/WEEE lead-free compliant For more detail, please visit: http://www.seeedstudio.com/item_detail.html?p_id=1132 Demonstration ------------- With Arduino ------------ Based on the output signal will change when a collision happens, we design this demo: each time the sensor detects collision, the LED will light up. Here the LED is as a managed device, and you can refer to the demo to control your device, such as bicycle light. The procedure is as follows: 1. Connect the collision sensor to the Digital port 2 of Grove - Basic Shield using a Grove cable and connect an LED to Pin 13. 2. Plug the Grove - Basic Shield into Arduino. 3. Connect Arduino/Seeeduino to PC by using a USB cable. 4. Copy and paste code below to a new Arduino sketch. And upload it to your Arduino. /****************************************************************************/ // Function: Monitor if there is any collision // Hardware: Grove - Collision Sensor // Arduino IDE: Arduino-1.0 // by www.seeedstudio.com // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2.1 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA // /*******************************************************************************/ #define LED 13 //the onboard LED of Arduino or Seeeduino #define COLLISION_SENSOR 2//collision sensor is connected with D2 of Arduino void setup() { pins_init(); } void loop() { if(isTriggered()) { turnOnLED(); delay(2000); } else turnOffLED(); } void pins_init() { pinMode(LED,OUTPUT); turnOffLED(); pinMode(COLLISION_SENSOR,INPUT); } boolean isTriggered() { if(!digitalRead(COLLISION_SENSOR)) { delay(50); if(!digitalRead(COLLISION_SENSOR)) return true;//the collision sensor triggers } return false; } void turnOnLED() { digitalWrite(LED,HIGH);//the LED is on } void turnOffLED() { digitalWrite(LED,LOW);//the LED is off } 5. Now you can check the status of LED. The LED should light up every time you drum fingers on the table. You can adjust the sensor sensitivity by changing the function delay(50) in code. if(!digitalRead(COLLISION_SENSOR)) { return true;//the collision sensor triggers } return false; With Raspberry Pi ----------------- 1.You should have got a raspberry pi and a grovepi or grovepi+. 2.You should have completed configuring the development enviroment, otherwise follow here. 3.Connection Plug the sensor to grovepi socket D2 by using a grove cable. 4.Navigate to the demos' directory: cd yourpath/GrovePi/Software/Python/ To see the code nano grove_collision_sensor.py # "Ctrl+x" to exit # import time import grovepi # Connect the Grove Collision Sensor to digital port D2 # SIG,NC,VCC,GND collision_sensor = 2 grovepi.pinMode(collision_sensor,"INPUT") while True: try: print grovepi.digitalRead(collision_sensor) time.sleep(.5) except IOError: print "Error" 5.Run the demo. sudo python grove_collision_sensor.py [1]: http://www.seeedstudio.com/wiki/images/thumb/6/66/Grove_%E2%80%93_Collision_Sensor_photo.jpg/400px-Grove_%E2%80%93_Collision_Sensor_photo.jpg
Design Drawing
schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Quantity
1 SEEEDSTUDIO_SCH_FRAME U$1 1
2 220pF C1 1
3 MVS0608.02 U1 1
4 100nF C2,C3 2
5 DNP D1 1
6 S9013 Q1 1
7 1k R1 1
8 3.3k R2 1
9 100K R3 1
10 47k R5 1
11 DNP P1 1
12 SMD-Grove J1 1
13 DNP R4 1
14 PAD-MARK P2,P3,P4,P5 4

Unfold

Project Attachments
Empty
Project Members
Related Projects
Change a batch
Loading...
Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn