hi welcome to nor doing a tutorial from Robojax my name is Ahmad Shamshiri I'm presenting this
tutorial from Canada. in this tutorial we are going to see how we can use this bh one seven
five zero light lacks sensor to measure the lags or intensity of light and display it on
serial monitor on this one it is written 6 x 2k the range would be from 1.2 to 5
volts villainously if these two points are affected you will see the pin ess chained
to 0 X 5 fee this line is initializing the icrc communication you can get the
code for this by clicking at the link below the video in the description which will take
you to Robo Jack's comm slash learn flash or do we know let's get started with this
you
when you purchase the module it might receive it like that with a pen header well this is actually
B age 1 7 5 0 that's the sensor and this is the bh 1 7 5 0 data sheet from rome semiconductor
measured between 1 to 65,535 lakhs based on I square C communication the maximum operating
voltage is 4.5 volts so that's why we have to regulate it to 3.3 volts this is he typically
three volts and supply current is hundred and twenty micron pair this is the voltage regulator
this 6 X 2 K I held the datasheet XC 6 to 0-6 this is a positive voltage regulator the range would be
from 1.2 to 5 volts maximum current is hundred milli ampere typical it can be used for many
purposes the actual sensor is very tiny and I've put here a voltage regulator that you can feed
in 3.3 volts or 5 volts so it can adjust it and bring it back to 3 volts nominal for this device
so in both cases it can work and then we have we have VCC and ground and then we have a CL and s
DF these 2 pencil for I square C communication to get the register value from this device and
also we have another pen here pin ess using this if you connected to 5 volts you can have
a secondary pin ess of 5 c the default pin ess for SQL C for this modulus 0 X 23 or hex value of 23
let me now explain the wiring if you need the wiring diagram for this you can get it
from Arduino course at Udemy if you want to learn Arduino I have a best seller course on
Udemy where you can learn our dinner from ground up with hundreds of projects all
course material library codes wiring diagram everything available in one place the link
for module new courses below this video in the description the head of the wiring this you see
is connected using grey wire to 3.3 volts or 5 volts in both cases it will work ground is
connected using purple wire to the ground s CL is connected using blue wire to a5 SDA is using
green wire connected to a 4 you may also connect it to SDA RSC L at this point it will work fine
let me now explain the code first you need to download this library of BH one seven five zero
I will provide it as a zip file you can download or you can come to this link which I will provide
you and then click here clone or download download and select downloads app once you downloaded and
saved it as a zip file then on Arduino IDE click on sketch include library add dot zip library
and then point it to where you have saved it for example if it was inside PC downloads tutorial and
if this was the library select it and click open this will include the library make sure to close
our do you know IDE if you have Moulton's you are done click on file example and then bh 1 7 5 0 and
open this test and this is the code include while that each is for I2C communication it is included
by default as part of our Davina IDE this is the library that you have just included and downloaded
and from this class we are creating an instance we call it light meter inside the setup we initialize
the serial monitor 9600 baud and this line is initializing the icrc communication the
only important part is def naughty 600 bot with which must merge here when you click on serial
monitor and at the lower portion on this side and the lower side it must match 9600 baud and
the light meter dot begin is initializing the setup for the light sensor and this will just
printed inside the serial monitor so the loop light meter dot read light level and this will
give us a float value which will be stored in a variable called Lux and here we are printing it
this is just a text and this vortex so this is our value and we are waiting 1000 milliseconds
1000 milliseconds or one second and then the loop will continuously reading the value if you want
to take some action or do something based on amount of light you can do so so you can say
if Laxus for example greater than 500 then this condition if this condition is true then your
action will be between these two open and close and Prentiss and here put the action whatever you
have so let's say turning on a light of turning on a relay or whatever you want to do do it here
hell if that demonstration that could have been uploaded the module is facing up and
here it shows if I do move it his shoes around 2530 lakhs and if I bring my hand
over it issues I was 59 what if I cover it fully so it is around 54 I have another light hair if
I pointed the other way 2300 let me turn the lights off the top light is off now it is 721
and if I face it towards the light 900 so the amount of Lux is shown now I'm using my phone
by turning on the flashlight let's see so ten thousand fourteen thousand around 15,000 Lux
and here if I put it properly no fifty four thousand bucks so this device can be used
in many applications so for example for solar application for to track the solar panel and
also so you can use it to determine the quality of different bulb and put it in a fixed position
and put the light in a fixed position and replace the bulbs and measure the amount
of light and amount of energy this way you will know it perhaps I'm gonna do a video about that
if you do not connect this pin pin and upload the code and here I've uploaded this I square
C scanner code I will provide you just copy and paste it in a sketch and upload it after that if
you just open it if you open the serial monitor you will see that it reads the SQL C pin ess to
be 0 X 23 and according to the datasheet this is a binary value of pin ess when it is low when
it is not connected it will be 23 0 1 0 0 0 1 1 and her if you convert this value that you have
here this one triple 0 1 1 if you convert it you will get the hex value of 23 and health now if I
connect this if I connect here a wire and connect it to this 5 volts worth 3.3 volts doesn't matter
as soon as I connected you will see the pin ess chained to 0 X 5 fee and if I remove it you will
see that it will change in the next reading 23 so 0 5 C and look at this here 1 0 triple 1 0 0
you
one zero triple one zero zero and as you can see the hex value is 5 C this is the 5c and if
I go to binary that's the white binary so this is a hex value when you connect it to 5 volts
you
thank you for watching the tutorial from Robo Jax if you liked this video and learned
something please stamp up as this will help my video in the search algorithm of YouTube
if you have comment or question posted a comment section below I try to answer and reply if you
want to get updates of my upcoming videos make sure to subscribe if you want to learn Arduino
I have a best seller course on Udemy where you can learn or do know from ground up with
hundreds of projects all course material library codes wiring diagram everything available in one
place the link for module new courses below this video in the description actual sensor
is very tiny and they've put here a voltage regulator that you can feed in 3.3 volts or
5 volts so it can adjust it and bring it back to 3 volts nominal for this device so in both
cases it can work and then we have just 2 pend 2 wires we have we have VCC and ground and then we
have a CL and SDF these two points are for ice q RC communication to get the register