LOGIN
Jayant Singh
Electrical and Electronics Engineering student (Project Leader)
 · New DelhiIndia
Edit
Delete
Share
Report
STATUS

Arduino Uno

1st Concept

https://123d.circuits.io/circuits/2036226-smart-streetlight#schematic
Its our initial ardunio model for understanding working principle of smart streetlight.
There is LED (streetlight) in between 2 IR motion sensors . when IR1 will detect motion, then LED will be switch to Max. brightness until the vehicle crosses IR2 .

source code

int ldr= A0;
int led= 9;
int ir1= A1;
int ir2= A2;
int brit= 0; 
void setup() 
{
Serial.begin(9600); 
pinMode(led,OUTPUT);

}
void loop()
{
Serial.println(analogRead(ldr));
brit = analogRead(ldr);
if( brit < 300 ) // at night 
{
  if (digitalRead(A1)==HIGH) // IR1 detect motion 
  {
    do{
  analogWrite(led,255); // max brightness  
  }
    while(digitalRead(A2)==LOW); // vehicle is between IR1 and IR2
    }
 else if(digitalRead(A1)==LOW);
   {analogWrite(led,50); // no motion detected so, low brightness- dim 
   }
 }
 else{ // at daytime
 analogWrite(led,0);  
 }
 }

Arduino Uno
2 likes 
Like
Share
Load 12 previous comments
Jayant Singh
Electrical and Electronics Engineering student (Project Leader)
 · New DelhiIndia
Edit
Delete
Share
Report

Yeah ! we can use Raspberry Pi in our Top-notch model , which can do image processing of number plate and track vehicles also 😃

1 like 
Abhi Verma
Electronics Engineer
 · GhaziabadIndia
Edit
Delete
Share
Report

Tell me whenever you need the code. Or need to develop the schematic.

0 like 
Jatin Mehra
Elecronics and communication engineering student at DTU
 · New DelhiIndia
Edit
Delete
Share
Report

tnx abhi for your support.

0 like 
Abhi Verma
Electronics Engineer
 · GhaziabadIndia
Edit
Delete
Share
Report

My pleasure bro

0 like 
Jayant Singh
Electrical and Electronics Engineering student (Project Leader)
 · New DelhiIndia
Edit
Delete
Share
Report

Abhi Verma Currently I am learning AVR programming for this project. could you please suggest the best method to program AVR (ATmega8) ? any source/link to learn ?

0 like 
Abhi Verma
Electronics Engineer
 · GhaziabadIndia
Edit
Delete
Share
Report

You can use arduino instead. Which powered by atmega328p. And have a huge community.
For atmega8 you will need atmel studio for compiling the code and use an USBasp programmer to upload the hex file to atmega8.
These programmers are easily available online. And comes with a uploader software e.g. Progisp and others.

Writing code for avr is bit different from 8051. e.g. There are different registers for avr. In 8051 we assign a pin or port as i/p by simply writing 1s or 0s to them.
In avr DDRxn register is for assignment and PORTxn is for read and write to port. While PINx is used for pins instead of P1_1 in 8051.
For better understanding and quick learning, read various projects code available on web and try to understand them. You can also experiment the code with avr.
This is the way which taught me.

0 like 
Leave a reply...
DISCOVER
CHAT
ALERTS
-2
DISCUSSIONS
-1
FEED