It is currently 20 Apr 2018 03:57

All times are UTC + 1 hour




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: 09 Mar 2018 19:45 
Offline

Joined: 09 Mar 2018 19:35
Posts: 1
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!


Top
 Profile  
 
PostPosted: 14 Mar 2018 09:52 
Offline
mikroElektronika team
User avatar

Joined: 18 Dec 2017 18:19
Posts: 200
Hi,

I would first suggest checking out the example available on our Libstock page:
https://libstock.mikroe.com/projects/view/1593/lux-meter-with-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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: