Visuino BH-1750 Ambient Light Sensor

In this tutorial you will learn how to use BH-1750 ambient light sensor with Visuino.

The values from the sensor will be displayed in Visuino Instrument for better visualization.

Watch the Video!

This project was made by Visuino user Rafał. Visit his youtube channel here: https://www.youtube.com/@Edappl/videos

STEP 1
What You Will Need
  • Arduino UNO or Arduino Mega (or any other board)
  • BH-1750 ambient light sensor
  • Visuino program: Download Visuino
  • Jumper wires

 

What You Will Need

What You Will Need photo 2

What You Will Need photo 3

What You Will Need photo 4

STEP 2
The Circuit
  • Connect BH-1750 Sensor pin [SCL] to Arduino pin [SCL]
  • Connect BH-1750 Sensor pin [SDA] to Arduino pin [SDA]
  • Connect BH-1750 Sensor pin [VCC] to Arduino pin [5v]
  • Connect BH-1750 Sensor pin [GND] to Arduino pin [GND]

 

 

The Circuit

STEP 3
Start Visuino, and Select the Arduino UNO Board Type

Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

Start Visuino, and Select the Arduino UNO Board Type

Start Visuino, and Select the Arduino UNO Board Type photo 2

STEP 4
In Visuino Add Components
  • Add "Clock Generator" component
  • Add "Clock Multi Source" component
  • Add "ROHM BH1750 Ambient Light Sensor (I2C)" component
  • Add "Map Range Analog" component
  • Add "Packet" component

In Visuino Add Components

In Visuino Add Components photo 2

In Visuino Add Components photo 3

In Visuino Add Components photo 4

In Visuino Add Components photo 5

STEP 5
In Visuino Set Components
  • Select "ClockGenerator1" and in the properties window set "Frequency" to 10
  • Select "MapRange1" and in the properties window set "Input Range" > "Max" to 54612 and "Output Range" > "Max" to 100
  • Double click on "Packet1" and in the Elements window drag "Analog" to the left side and in the properties window set "Visualization" > "Scale" > "Max" to 100

 

Note: you can adjust the MapRange1 output Max and Packet1 Analog1 Scale Max according to your needs

also you can change the "Instrument" to something else

In Visuino Set Components

In Visuino Set Components photo 2

In Visuino Set Components photo 3

In Visuino Set Components photo 4

STEP 6
In Visuino Connect Components
  • Connect "ClockGenerator1" pin [Out] to "MultiSource1" pin [In]
  • Connect "MultiSource1" pin [0] to "LightSensor1" pin [Clock]
  • Connect "MultiSource1" pin [1] to "Packet1" pin [Clock]
  • Connect "LightSensor1" pin [Out] to "MapRange1" pin [In]
  • Connect "LightSensor1" pin [I2C] to Arduino pin [I2C]
  • Connect "MapRange1" pin [Out] to "Packet1" > "Analog1" pin [In]
  • Connect "Packet1" pin [Out] to Arduino serial 0 pin [In]

In Visuino Connect Components

In Visuino Connect Components photo 2

STEP 7
Generate, Compile, and Upload the Arduino Code

Generate, Compile, and Upload the Arduino Code

Generate, Compile, and Upload the Arduino Code

STEP 8
Play

If you power the Arduino module, at the bottom click on the "Serial" Tab > "Instruments", make sure you selected the correct port and click "Connect" button. You should start to see the values from the sensor.

Since the "ClockGenerator1" frequency is 10Hz we are getting values 10x every second, you can adjust the Frequency of the "ClockGenerator1" in the properties window.

Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino: https://www.visuino.eu

Play

icon BH1750-Instruments.zip 9KB Download(0)
License
All Rights
Reserved
licensBg
0