Arduino SFR Ranger Reader


Posted on Feb 6, 2014

This example shows how to read a Devantech SRFxx, an ultra-sonic range finder which communicates via the I2C synchronous serial protocol, using Arduino`s Wire Library. The I2C protocol involves using two wires to send and receive data: a serial clock pin (SCL) that the Arduino pulses at a regular interval, and a serial data pin (SDA) over which


Arduino SFR Ranger Reader
Click here to download the full size of the above Circuit.

data is sent between the two devices. As the clock pulse changes from low to high (known as the rising edge of the clock), a bit of information containing the address of a specific device and a request for data, is transferred from the Arduino to the I2C devices over the SDA line. When the clock pin changes from high to low (the falling edge of the clock), the called upon device transmits it`s data back to the Arduino over the same line. Because the 12C protocol allows for each enabled device to have it`s own unique address, and as both master and slave devices to take turns communicating over a single line, it is possible for your Arduino to communicate with many devices (in turn) while using just two pins of your microcontroller. Attach the SDA pin of your SRFxx to analog pin 4 of your Arduino, and the SCL pin to analog pin 5. Power your SRFxx from 5V, with the addition of a 100uf capacitor in parallel with the range finder to smooth it`s power supply. If using two SRFxxs on the same line, you must ensure that they do not share the same address. Instructions for re-addressing the range finders can be found at the bottom of the code below.




Leave Comment

characters left:

Related Circuits

  • New Circuits

    .

     


    Popular Circuits

    12V 40A Switching Power Supply
    Car Lights Monitor
    Ultrasonic Surveillance Bug circuit
    Basic Circuit Modification of Kodak Disposable Camera
    Worlds first Arduino flashlight ships soon
    clap sensor construction
    Water Level Indicator With 7-Segment Display PCB
    Gas Leakage Sensor Alarm Circuit Engineering Project using 555 Timer and MQ6 SEN 1327 Gas Sensor Module
    A simple AM modulator
    Sound Effects Generator 2 circuit
    DC Analysis of a MOSFET Transistor Circuit
    The Gentle Touch
    The TDA2003 10W Car Radio Audio Amplifier



    Top