Parallax Si1143 Gesture Sensor

/media/uploads/frost1h/28046.png The Si1143 Gesture Sensor is a non-contact gesture recognition for microcontrollers. It measures the light levels of the surroundings by using the three infrared LEDs.

Can be found here: https://www.parallax.com/product/28046

Wiring

  • GND -> 0v
  • Vin -> 3.3v
  • INT -> unconnected
  • SCL -> p27 via resistor
  • SDA -> p28 via resistor

/media/uploads/frost1h/11051635_10152714444548148_1966128503_n.jpg

Hello World

main.cpp

#include "mbed.h"
#include "GestureSensor.h"
 
GestureSensor sensor(p28, p27);
 
DigitalOut led1(LED1);
DigitalOut led2(LED2);
DigitalOut led3(LED3);
 
int main()
{
    int sensor1;
    int sensor2;
    int sensor3;
    
    sensor.baseline(1,5);
    wait(1);
    
    while(1)
    {
        // Read each led sensor
        sensor1 = sensor.sample_left(1);
        sensor2 = sensor.sample_top(1);
        sensor3 = sensor.sample_right(1);
        
        // Can be changed for different sensitivity
        if (sensor1 > 50 || sensor2 > 50 || sensor3 > 50)
        {
            if (sensor1 > sensor2 && sensor1 > sensor3)
            {
                led1=1;
                led2=0;
                led3=0;
            }
            
            else if(sensor2 > sensor1 && sensor2 > sensor3)
            {
                led1=0;
                led2=1;
                led3=0;
            }
            
            else if(sensor3 > sensor1 && sensor3 > sensor2)
            {
                led1=0;
                led2=0;
                led3=1;
            }
        }
        
        else
        {
            led1=0;
            led2=0;
            led3=0;
        }

    }
}

Library

http://developer.mbed.org/users/frost1h/code/GestureSensor/

Video Demo

DipTrace Schematic

/media/uploads/frost1h/2015-03-13_16_58_56-schematics_-_-c__users_frost1h_downloads_28046-si1143-gesture-sensor_-1-.png

Datasheet


Please log in to post comments.