Changes between Version 1 and Version 2 of DistanceSensor


Ignore:
Timestamp:
2013-09-23 21:58:01 (11 years ago)
Author:
hek
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DistanceSensor

    v1 v2  
    1 x 
     1[[Image(distVera.png, align=right, width=300px)]] 
     2= Distance sensor (HC-SR04) = 
     3 
     4== Software == 
     5You can download the Arduino sketch here:\\ 
     6http://code.mios.com/trac/mios_arduino-sensor/browser/trunk/Arduino/DistanceSensor 
     7 
     8Before downloading the sketch to the Arduino you need to select a unique RADIO_ID (see top of sketch source code). The RADIO_ID must be unique in your radio network and is also used on the Vera side to distinguish between different sensors (1-255).  
     9After updating RADIO_ID and downloading the code you should be ready to go. 
     10Adjust the measure interval by updating SLEEP_TIME define at the top of the sketch file.  
     11 
     12== Wire things up == 
     13Follow the instructions in ConnectingRadioModule to connect radio module. 
     14 
     15The HC-SR04 sends out short ultrasonic pulses and registers when the sound echo comes back. By knowing the speed of sound you can easily calculate the distance.  
     16To connect the HC-SR04 sensor to the Arduino board follow these instructions:\\ 
     17Connect VCC of the HC-SR04 sensor to +5V\\ 
     18Connect Echo to digital pin 5 of the Arduino board\\ 
     19Connect Trig to digital pin 6 of the Arduino board\\ 
     20Connect GND to Arduino ground\\ 
     21 
     22== Hardware - Purchase guide == 
     23 
     24This is the stuff you need to purchase to build the HumiditySensor. Note that I've provided links to the things I bought during the development. You might find it cheaper somewhere else. Also note that you might need to buy like 10x of some items to get the price specified. 
     25 
     261x Cheap Arduino Nano without serial interface and usb connector\\ 
     27http://www.aliexpress.com/item/16Pcs-Lot-Pro-Mini-Module-Atmega328-5V-16M-For-Arduino-Compatible-Nano/710613095.html 
     28 
     298x Dupont cable Female->Female for radio module (and you might need 4 extra cables for your distance sensor)\\  
     30http://www.aliexpress.com/item/New-Female-To-Female-40-pcs-Wire-Cable-Line-1p-1p-Pin-Connector-20cm-2-54mm/1045212486.html 
     31 
     321x NRF24L01+ wireless data transmission module 2.4Ghz\\  
     33http://www.aliexpress.com/item/Free-shipping-NRF24L01-wireless-data-transmission-module-2-4G-the-NRF24L01-5PCS-LOT-upgrade-version-New/603756080.html 
     34 
     351x Distance Sensor HC-SR04\\ 
     36http://www.aliexpress.com/item/Free-shipping-2pcs-Ultrasonic-Module-HC-SR04-Distance-Measuring-Transducer-Sensor-for-Arduino-Samples-Best-prices/690139020.html 
     37 
     38 
     39(You might later need some housing and transformer or battery compartment as well) 
     40 
     41TOTAL SENSOR PRICE: $3,99 + $0.93 + $0,6 + $4,99 + $2,42 = $10,50 
     42 
     43To download code to the cheapest Arduino Nano sensors (that is missing the serial USB port) you need to buy one of following as well. It is only attached while downloading code and can be reused between sensors. 
     44 
     451x Serial to USB adapter to download code to cheap Arduino Nanos\\ 
     46http://www.aliexpress.com/item/Free-Shipping-FT232RL-USB-To-Serial-Adapter-Module-USB-TO-232-For-Arduino-Download-Cable/827218126.html 
     47 
     48[[Image(dist.jpg, width=500px)]]