MikroElektronika
Ambient 4 click
Ambient 4 click
SKU:MIKROE-3199
Couldn't load pickup availability
Share
The influence of the light source type on the measurement accuracy is quite reduced. The sensor is capable of converting the light intensity from any type of light source, including daylight, fluorescent light, LED light, incandescent light, and so on. It also features a flickering filter, reducing the 50/60 Hz flickering influence. Its low power consumption, compact size, high sensitivity, and a high level of integration, make this sensor an ideal solution for both the IoT light-sensing applications, but also for portable or handheld devices which utilize an accurate light intensity sensing, such as the TFT/LCD screens, keypad backlight, cell phones, digital cameras, and similar.
How does it work?
As mentioned previously, Ambient 4 click uses the BH1721FVC, a 16-bit digital light sensor with the I2C serial interface, from ROHM Corporation. This sensor has many features that make it a perfect solution for small designs such as the Ambient 4 Click board™. One of these features is certainly its high level of integration, that allows a minimal number of external components, leaving room for an additional I2C level translator IC, labeled as PCA9306, a reliable I2C level translator from Texas Instruments, proven in many designs. This allows a high number of microcontrollers (MCUs) to be interfaced with Ambient 4 click. The BH1721FVC sensor is also immune to flickering and its accuracy is not influenced by the light source type. It is calibrated so its spectral response is closely matched to a spectral response of the human eye.
The BH1721FVC sensor of Ambient 4 click can operate in two modes: it can be operated in Low-Resolution mode and High-Resolution mode. While operating in the Low-Resolution mode, the measuring resolution is 8 lx per step. When operated in a High-Resolution mode, the accuracy is 1 lx per step. When sensing very low amounts of light, it is mandatory to use High-Resolution mode, since it is not possible to obtain valid results in Low-Resolution mode. The resolution can be also fine-tuned by changing the measurement time. This is used to increase the sensitivity of the sensor, as well as to reduce the influence of the optical window if one is mounted over the sensor. Increasing of the measurement time allows light amount down to 0.25 lx to be detected. The Low-Resolution mode, in general, allows much shorter measurement times, while high resolution will use longer to place the conversion data on the 16-bit output register.
As mentioned already, the spectral response of the sensor is closely matched to the response of the human eye. This means that the sensor outputs highest results for the light spectrum range between 500nm and 650 nm, which includes most of the light energy in the visible light spectrum: this is a color range from cyan to orange. The datasheet of the BH1721FVC offers a more accurate representation of the spectrum response, as well as for other operating parameters.
The sensitivity of the sensor is also affected by the incidence angle of the light rays. The BH1721FVC datasheet offers an accurate representation of the sensor's field of view (FOV), but a light source with the incidence angle of ±45? will result with the measured ratio of 0.8 times compared to the same light source intensity perpendicular to the surface of the sensor.
Since the sensor output result is 16-bit, it is stored in the LSB/MSB format, in two separate output registers. To obtain a measurement data in proper units (Lux, lx), a data conversion has to be performed by the firmware of the host MCU. The datasheet of the BH1721FVC contains these conversion formulas, although Ambient 4 click comes supported by a library that contains the functions that simplify the use of the Click board™.
The 16-bit light intensity data is present at the I2C interface output. The I2C bus lines are routed to the aforementioned PCA9306 level translator. This allows interfacing with the wide range of different MCUs, both 3.3V, and 5V. It is worth mentioning that the sensor requires a reset after the power-up sequence, in order to set its internal registers to their defaults. This can be achieved by pulling the DVI line of the sensor to a LOW logic level for at least 1 µs.
An onboard SMD jumper labeled as VCC SEL offers a selection of the voltage at which the logic interface is operated (3.3V or 5V). I2C bus lines are routed to the respective mikroBUS™ pins, while the DVT line is routed to the RST pin of the mikroBUS™.
Specifications
Type | Optical |
Applications | This sensor is an ideal solution for both the IoT light sensing applications, and portable or handheld devices which utilize an accurate light intensity sensing, such as the TFT/LCD screens, keypad backlight, cell phones, digital cameras, and similar |
On-board modules | BH1721FVC, a 16-bit digital light sensor with I2C serial interface, from ROHM; PCA9306, an I2C level translator from Texas Instruments |
Key Features | A high resolution and range of light-intensity that can be measured, a spectral response similar to human eye, low power consumption, compact design ideal for building IoT applications, immune to flickering and fluorescent light sources, independent of the light source type, and more |
Interface | I2C |
Input Voltage | 3.3V,5V |
Compatibility | mikroBUS |
Click board size | M (42.9 x 25.4 mm) |
Pinout diagram
This table shows how the pinout on Ambient 4 click corresponds to the pinout on the mikroBUS™ socket (the latter shown in the two middle columns).
Onboard jumpers and settings
Label | Name | Default | Description |
---|---|---|---|
LD1 | PWR | - | Power LED indicator |
JP5 | VCC SEL | Left | Logic voltage level selection: left position 3.3V, right position 5V |
Software support
We provide a library for the Ambient 4 Click on our LibStock page , as well as a demo application (example), developed using MikroElektronika compilers. The demo can run on all the main MikroElektronika development boards.
Library Description
The library contains all the necessary functions for working with Ambient 4 click.
Key functions:
-
void ambient4_sendCommand(uint8_t cmd)
- Function for send command -
uint16_t ambient4_readData
- Function for read 16bit data -
void ambient4_deviceReset()
- Function for device reset
Example description
The application is composed of the three sections:
- System Initialization - Initializes I2C module and set RST pin as OUTPUT
- Application Initialization - Initialization driver init and power ON chip and set resolution mode
- Application Task - (code snippet) - Read ambient light in [lx] and logs data to USBUART every 1 sec.
void applicationInit() { readValue = ambient4_readData(); IntToStr(readValue, demoText); mikrobus_logWrite(" Ambient light: ", _LOG_TEXT); mikrobus_logWrite(demoText, _LOG_TEXT); mikrobus_logWrite(" lx ", _LOG_LINE); Delay_1sec(); }
The full application code, and ready to use projects can be found on our Libstock page.
Other MikroElektronika libraries used in the example:
- I2C
Additional notes and information
Depending on the development board you are using, you may need USB UART click, USB UART 2 clickor RS232 click to connect to your PC, for development systems with no UART to USB interface available on the board. The terminal available in all MikroElektronika compilers, or any other terminal application of your choice, can be used to read the message.
mikroSDK
This click board is supported with mikroSDK - MikroElektronika Software Development Kit. To ensure proper operation of mikroSDK compliant click board demo applications, mikroSDK should be downloaded from the LibStock and installed for the compiler you are using.




New Products
-
Sold out
OAK-FFC IMX577 M12
Vendor:POLOLURegular price Rs. 8,499.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 20A
Vendor:POLOLURegular price Rs. 329.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 25A
Vendor:POLOLURegular price Rs. 439.00Regular priceUnit price / perSold out -
Pololu I²C Isolator, ISO1640
Vendor:POLOLURegular price Rs. 449.00Regular priceUnit price / per -
3pi+ 32U4 OLED Robot Kit with 30:1 MP Motors (Standard Edition Kit)
Vendor:POLOLURegular price Rs. 15,549.00Regular priceUnit price / per -
Conductivity Calibration K 1.0 Set (4 pouches)
Vendor:Atlas ScientificRegular price Rs. 1,599.00Regular priceUnit price / perSold out -
Analog Discovery 3 Pro Bundle
Vendor:DigilentRegular price Rs. 42,569.00Regular priceUnit price / per -
Lighthouse swarm bundle - Crazyflie 2.1+ (250mAh batteries)
Vendor:BitcrazeRegular price Rs. 474,999.00Regular priceUnit price / perSold out -
Loco Swarm bundle - Crazyflie 2.1+ (250mAh batteries)
Vendor:BitcrazeRegular price Rs. 544,999.00Regular priceUnit price / perSold out -
Kopis X8 Cinelifter 5" Kit - Caged (Frame Kit)
Vendor:HolybroRegular price Rs. 28,199.00Regular priceUnit price / per -
Atlas Scientific i3 InterLink
Vendor:Atlas ScientificRegular price Rs. 6,349.00Regular priceUnit price / per -
Sold out
PoE Injector
Vendor:LuxonisRegular price Rs. 2,099.00Regular priceUnit price / perSold out -
Sold out
1-Port VINT Hub Phidget
Vendor:PhidgetsRegular price Rs. 2,699.00Regular priceUnit price / perSold out -
Holybro 1045 Propeller 2 Pair CW+CCW-Black
Vendor:HolybroRegular price Rs. 1,549.00Regular priceUnit price / per -
ACS37220LEZATR-100B3 Current Sensor Large Carrier -100A to +100A, 3.3V
Vendor:POLOLURegular price Rs. 829.00Regular priceUnit price / per -
CT433-HSWF50MR TMR Current Sensor Compact Carrier -50A to +50A, 3.3V
Vendor:POLOLURegular price Rs. 1,039.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Adjustable Current, Blue Edition
Vendor:POLOLURegular price Rs. 409.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Fixed 1A@5V / 660mA@3.3V, Blue Edition (Soldered Header Pins)
Vendor:POLOLURegular price Rs. 489.00Regular priceUnit price / per -
A5984 Stepper Motor Driver Carrier, Fixed 500mA@5V / 330mA@3.3V (Soldered Header Pins)
Vendor:POLOLURegular price Rs. 469.00Regular priceUnit price / per -
T Connector Male-Female Pair
Vendor:POLOLURegular price Rs. 169.00Regular priceUnit price / per -
Pololu Reverse Voltage Protector, 4-60V, 10A
Vendor:POLOLURegular price Rs. 159.00Regular priceUnit price / per -
Pololu Reverse Voltage Protector, 4-60V, 12A
Vendor:POLOLURegular price Rs. 199.00Regular priceUnit price / per -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 10A
Vendor:POLOLURegular price Rs. 179.00Regular priceUnit price / perSold out -
Pololu Ideal Diode Reverse Voltage Protector, 4-60V, 12A
Vendor:POLOLURegular price Rs. 229.00Regular priceUnit price / perSold out -
Pololu Mini Plastic Gearmotor Bracket Pair - Tall
Vendor:POLOLURegular price Rs. 599.00Regular priceUnit price / per