I made my first sensor circuit using the LM358 OPAMP based on the circuit attached (IR SENSOR CIRCUIT DETECTING WHITE SURFACE).
I then connected the output of the sensor circuit to the development board by giving a 12V-500mA supply (in common) to both (i am using 7805 voltage regulators in both the sensor and devt board).
this is the code i was workin upon:
#include#include int main() { DDRA=0x00; //PORT A as input from sensor DDRB=0xFF; //PORT B as output to LEDs while(1) { if(PORTA & 0b00000001 == 0b00000001) { PORTB=0b10101010;//LED blinking _delay_ms(50); PORTB=0b01010101;//LED blinking _delay_ms(50); } else { PORTB=0b00000000;//no LED blinking } } return 0; }
At first the output of the sensor circuit (when not connected to the devt board) showed 4.18V(tested using multimeter). Even on connecting to the devt board the output remains the same 4.18V on bringing a white surface near it but however the LEDs do not blink.
Moreover is it OK giving a 12V-500mA supply common to both the sensor and devt board....or we have to provide supply separately.........
Kindly help me out.........i m totally confused....!!!!!!!!!!