CONTROLLING OUTPUTS BY USING INPUT FROM BH1750 LIGHT SENSOR

Discussion on projects that are created by users and posted on mikroElektronika website.
Post Reply
Author
Message
Frankenstein
Posts: 1
Joined: 09 Mar 2018 19:35

CONTROLLING OUTPUTS BY USING INPUT FROM BH1750 LIGHT SENSOR

#1 Post by Frankenstein » 09 Mar 2018 19:45

Hello!

I need to use an input from BH1750 sensor to control other devices such as LEDs, motors etc. I think i need to put a condition in my program such as (If LUX reading is greater than a certain level then ACTIVATE a certain pin to control an appliance), but i'm not sure and i don't know where to start. I need to implement this task by using either PIC 16F887A or 18F452.

I really need your help please!

User avatar
strahinja.jacimovic
mikroElektronika team
Posts: 200
Joined: 18 Dec 2017 18:19

Re: CONTROLLING OUTPUTS BY USING INPUT FROM BH1750 LIGHT SEN

#2 Post by strahinja.jacimovic » 14 Mar 2018 09:52

Hi,

I would first suggest checking out the example available on our Libstock page:
https://libstock.mikroe.com/projects/vi ... ith-bh1750

It will be a good starting point for you.

Also, I would suggest reading the datasheet for the sensor:
http://www.mouser.com/ds/2/348/bh1750fvi-e-186247.pdf

As for your dilemma, you can try to add a piece of code which has some kind of IF condition.

For example, if the sensor senses ambient light data and returns a value of let's say 10 lux, then you write a piece of code which states what to do.

Another condition would be let's say, if the luminescence is 20 lux then do something else.

The sensor itself is I2C based.

I hope this helps out.

Kind regards,
Strahinja Jacimovic

Post Reply

Return to “User Projects”