Visuino BH-1750 Ambient Light Sensor

by RonFrtek in Circuits > Arduino

97 Views, 0 Favorites, 0 Comments

Visuino BH-1750 Ambient Light Sensor

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

What You Will Need

FZEK4WBK3XGYAP0.LARGE.jpg
GY-30 BH1750.jpg
VisuinoAdvrtisemenM5StackCoreS3.jpg
F5OFEUQJJ4ZYFKY.LARGE.jpg
  • Arduino UNO or Arduino Mega (or any other board)
  • BH-1750 ambient light sensor
  • Visuino program: Download Visuino
  • Jumper wires


The Circuit

2024-02-18_17-12-34.jpg
  • 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]



Start Visuino, and Select the Arduino UNO Board Type

select-board-uno.jpg
Visuino-Select-Board-UNO.jpg

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

In Visuino Add Components

2024-02-19_12-40-58.png
2024-02-19_12-41-23.png
2024-02-19_12-41-49.png
2024-02-19_12-42-14.png
2024-02-19_12-44-14.png
  • 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 Set Components

2024-02-19_13-33-29.png
2024-02-19_13-33-50.png
2024-02-19_13-34-54.png
2024-02-19_13-54-11.png
  • 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 Connect Components

2024-02-19_12-40-05.png
2024-02-19_12-40-05f.png
  • 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]

Generate, Compile, and Upload the Arduino Code

FBR42I2KXBU01YW.jpg

Play

2024-02-19_12-34-47.png

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