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

    Precision-envelope-detector
    6V6 6J5 Class A Vacuum Tube (Valve) Amplifier Circuit
    Basic Oscillator (Tone Generator) At 1.8 KHz -alarm circuits
    10.58 to 10.74 mhz vfo oscillator circuit
    Voltage to Frequency Converter Circuit
    Microcontroller
    LED Driver: 6 Channels with Phase Shift Control



    Top