fbpx
Smart Street Lamp
MagicBlocks Project

Smart Street Lamp

Control a bulb with light intensity

What is a smart street lamp?

A smart street lamp can automatically be turned on when it is dark and turned off when it is light. Some smart street lamps can be turned on only when there are people and vehicles.

Connect Your Magicbit with Magicblocks. (if you don’t know how to do it, go through this tutorial)

 

You will need the following nodes.

Double click on the switch node.

Change the value rules as follows and compare elements as numbers.

 

Find the value of LDR where the light should be turned on. (Here it is used as 1000)

Make the following arrangement.

 

Double click on the Analog In node.

  1. Select the pin as LDR
  2. Select the method as Interrupt

 

Double click on the Digital out node

Select the correct device ID.

Then select any LED that you want to control.

Double click on the first template node.

 

Change as follows.

 

Double click on the second template node.

Change as follows.

Deploy the program.

Cover the LDR to see if the LED turns on.

Related Posts
Leave a Reply