Characteristic Locus
Inheritance System.Object > SI1145
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Foundation.Sensors.Light
Assembly SI1145.dll

Syntax

public class SI1145

Remarks

The SI1145 is a low power infrared, ultraviolet and ambient light sensor with an I2C interface.

  • Ultraviolet / Infrared / ambient light sensor
  • Proximity sensor
  • Independent LED drivers
  • I2C interface up to 3.4 MBps

Purchasing

Examples

The following application reads the sensor output Infrared, Ultraviolet and Visibility once per second and outputs the result on the output console:

using System.Threading;
using Meadow;
using Meadow.Foundation.Sensors.Light;

namespace SI1145_Sample
{
    public class Program
    {
        static IApp _app; 
        public static void Main()
        {
            _app = new App();
        }
    }

    public class App : AppBase<F7Micro, App>
    {
        public App ()
        {
            Console.WriteLine("SI1145 Test");
            var sensor = new SI1145();

            while (true)
            {
                Console.WriteLine(
                    "Sensor reading - " + 
                    "Ultraviolet = " + sensor.Ultraviolet().ToString("f2") +
                    "Infrared = " + sensor.Infrared().ToString("f2") +
                    "Visible = " + sensor.Visible().ToString("f2"));

                Thread.Sleep(1000);
            }
        }
    }
}
Example Circuit

Constructors

View Source

SI1145(II2cBus, Byte)

Create a new SI1145 sensor object.

Declaration
public SI1145(II2cBus i2cBus, byte address = 96)

Parameters

Type Name Description
II2cBus i2cBus
System.Byte address

Address of the chip on the I2C bus (default to 0x60).

Properties

View Source

Infrared

Infrared light level.

Declaration
public double Infrared { get; }

Property Value

Type Description
System.Double
View Source

Ultraviolet

Ultraviolet light level.

Declaration
public double Ultraviolet { get; }

Property Value

Type Description
System.Double
View Source

Visible

Visible + infrared light level.

Declaration
public double Visible { get; }

Property Value

Type Description
System.Double