Light Meter Gauge Using Arduino

by RonFrtek in Circuits > Arduino

1609 Views, 3 Favorites, 0 Comments

Light Meter Gauge Using Arduino

Light Meter Gauge Using Arduino

In this tutorial we will learn how to make a simple Light meter gauge using BH1750 light sensor and Arduino.

Watch the video!

What You Will Need

GY-30 BH1750.jpg
oled.png
FNLOD2CKEY93G5N.jpg
VisuinoAdvrtisementVersion8.jpg
FMT2X9VKEY93G5P.jpg
FMMM5N5KEY93G5M.jpg
  • Arduino UNO or any other Arduino board
  • BH1750 Ambient Light Sensor (I2C)
  • OLED Display
  • Breadboard
  • Jumper wires
  • Visuino software: Download here

Circuit

2021-02-01_16-11-09.jpg
  • Connect Light Sensor pin [SCL] to Arduino pin [SCL]
  • Connect Light Sensor pin [SDA] to Arduino pin [SDA]
  • Connect Light Sensor pin [VCC] to Arduino pin [5v]
  • Connect Light Sensor pin [GND] to Arduino pin [GND]
  • Connect OLED Display pin [SCL] to Arduino pin [SCL]
  • Connect OLED Display pin [SDA] to Arduino pin [SDA]
  • Connect OLED Display pin [VCC] to Arduino pin [5v]
  • Connect OLED Display pin [GND] to Arduino pin [GND]

Start Visuino, and Select the Arduino UNO Board Type

FCH7XQEK5ADILIH.LARGE.jpg
F311FBVK5AHN5HJ.LARGE.jpg

The Visuino: https://www.visuino.eu also needs to be installed. Download Free version or register for a Free Trial.

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 & Set Components

2021-01-25_20-21-46.jpg
2021-01-25_20-21-30.jpg
2021-01-25_20-21-13.jpg
2021-01-25_20-22-17.jpg
2021-01-25_20-20-52.jpg
2021-01-20_13-55-23.jpg
2021-01-20_13-57-01.jpg
2021-01-20_13-56-48.jpg
2021-01-20_13-56-02.jpg
2021-01-20_13-56-23.jpg

  • Add "ROHM BH1750 Ambient Light Sensor (I2C)" component
  • Add "Clock Multi Source" component and in the properties window set "Output Pins" to 3
  • Add "Map Range Analog" component
    In the properties window set Input Range Max to 2000 <<(This is the Output of the sensor, Increase it if you want) and Output Range Min to 0

In the properties window set Output Range Max to 0 and Output Range Min to -180

  • Add "OLED display" component
Double click on the DisplayOLED1 and in the Elements window:
  • drag "Draw Angled Line" to the left side and in the properties window set Angle to -10, End to 60, X to 64, Y to 63, select angle and click on the pin icon and select Float Sink pin
  • drag "Fill Screen" to the left side
  • drag "Text Field" to the left side and in the properties window set X to 50 and Y to 50
  • drag "Draw Ellipse" to the left side and in the properties window set Height to 124, Width to 124 and Y to 20
Close the Elements window

In Visuino Connect Components

2021-01-25_20-37-53.jpg
light-meter-oled.png
  • Connect "LightSensor1" pin I2C Control to "Arduino" pin I2C In
  • Connect "DisplayOLED1" pin I2C Out to "Arduino" pin I2C In
  • Connect "LightSensor1" pin Out to "MapRange1" pin In
  • Connect "LightSensor1" pin Out to "DisplayOLED1" > Text Field1 pin In
  • Connect "MapRange1" pin Out to "DisplayOLED1" > Draw Angled Line1 pin Angle
  • Connect "MapRange1" pin Out to "ClockMultiSource1" pin In
  • Connect "ClockMultiSource1" pin[0] to "DisplayOLED1" > Fill Screen1 pin Clock
  • Connect "ClockMultiSource1" pin[1] to "DisplayOLED1" > Draw Ellipse1 pin Clock
  • Connect "ClockMultiSource1" pin[2] to "DisplayOLED1" > Draw Angled Line1 pin Clock

Generate, Compile, and Upload the Arduino Code

2020-10-30_13-20-50.jpg

In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

Play

If you power the Arduino module and the display will start to show the light sensor value.

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