Automatic Garden Light And Water Pump
Maybe someone today need everything more easy and effective, included with their garden lamp at home. There are many garden lamp operated manually to turn-on and turn-off. Someone need to turn on in the night and turn off in the morning manually. Garden lamp can not work automatically, when condition is dark garden lamp will turn on and when condition is bright garden lamp will turn off automatically too.
I think it is very important in this day. Someone will not again confuse when they go to leave home who will turn on and turn off garden lamp. To take solution for this problem i think someone can use automatically garden lamp that can work automatically. Garden lamp will turn on when condition is dark, and garden lamp will turn off when condition is bright.
Components
PIC16F877A
This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC® architecture into an 40- or 44-pin package and is upwards compatible with the PIC16C5X, PIC12CXXX and PIC16C7X devices. The PIC16F877A features 256 bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 8 channels of 10-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM functions, the synchronous serial port can be configured as either 3-wire Serial Peripheral Interface (SPI™) or the 2-wire Inter-Integrated Circuit (I²C™) bus and a Universal Asynchronous Receiver Transmitter (USART). All of these features make it ideal for more advanced level A/D applications in automotive, industrial, appliances and consumer applications.
LDR LDR (or Light Dependant Resistor, or Photoresistor) is a variable resistor. Light falling on the sensor decreases its resistance.
Components
PIC16F877A
This powerful (200 nanosecond instruction execution) yet easy-to-program (only 35 single word instructions) CMOS FLASH-based 8-bit microcontroller packs Microchip's powerful PIC® architecture into an 40- or 44-pin package and is upwards compatible with the PIC16C5X, PIC12CXXX and PIC16C7X devices. The PIC16F877A features 256 bytes of EEPROM data memory, self programming, an ICD, 2 Comparators, 8 channels of 10-bit Analog-to-Digital (A/D) converter, 2 capture/compare/PWM functions, the synchronous serial port can be configured as either 3-wire Serial Peripheral Interface (SPI™) or the 2-wire Inter-Integrated Circuit (I²C™) bus and a Universal Asynchronous Receiver Transmitter (USART). All of these features make it ideal for more advanced level A/D applications in automotive, industrial, appliances and consumer applications.
LDR LDR (or Light Dependant Resistor, or Photoresistor) is a variable resistor. Light falling on the sensor decreases its resistance.
Output: This module outputs 5v when the sensor receives no light (the circuit is open) and 0v when exposed to bright light (the circuit is closed). When connected to an input on the Arduino using the TinkerKit Shield, you can expect to read values from 0 to 1023.
Module Description: This module features a Light Dependent Resistor, a signal amplifier, the standard TinkerKit 3pin connector, a green LED that signals that the module is correctly powered and a yellow LED whose brightness changes according to the amount of lightness.
This module is a SENSOR. The connector is an OUTPUT which must be connected to one of the INPUT connectors on the TinkerKit Shield.
LM35
Description
The LM35 series are precision integrated-circuit temperature sensors, whose output voltage is linearly proportional to the Celsius (Centigrade) temperature. The LM35 thus has an advantage over linear temperature sensors calibrated in ° Kelvin, as the user is not required to subtract a large constant voltage from its output to obtain convenient Centigrade scaling. The LM35 does not require any external calibration or trimming to provide typical accuracies of ±¼°C at room temperature and ±¾°C over a full -55 to +150°C temperature range. Low cost is assured by trimming and calibration at the wafer level. The LM35's low output impedance, linear output, and precise inherent calibration make interfacing to readout or control circuitry especially easy. It can be used with single power supplies, or with plus and minus supplies. As it draws only 60 µA from its supply, it has very low self-heating, less than 0.1°C in still air. The LM35 is rated to operate over a -55° to +150°C temperature range, while the LM35C is rated for a -40° to +110°C range (-10° with improved accuracy). The LM35 series is available packaged in hermetic TO-46 transistor packages, while the LM35C, LM35CA, and LM35D are also available in the plastic TO-92 transistor package. The LM35D is also available in an 8-lead surface mount small outline package and a plastic TO-220 package.
Program
#include<htc.h>
void initialize(void)
{
TRISA0=1;
TRISA1=1;
ADCS1 = 0; //select Fosc/8
ADCS0 = 1;
ADCON1=0; // A/D port configuration 0
ADFM = 1; //right justified result
ADON=1; // turn on the AD conversion module
}
/* return a 10-bit result */
unsigned int read_adc(unsigned char channel)
{
channel&=0x07; // truncate channel to 3 bits
ADCON0&=0xC5; // clear current channel select
ADCON0|=(channel<<3); // apply the new channel select
DelayMs(10);
ADGO=1; // initiate conversion on the selected channel
while(ADGO)continue;
return(((ADRESH&0x03)<<8)+ADRESL); // return the 10-bit result
}
void main(void)
{
long int temp,pres;
initialize();
while(1)
{
temp =read_adc(0)*((5.0*100.0)/1023.0);
if (temp>27)
{
PORTD=0x00;
}
else
{
+ comments + 2 comments
where is the full code..........
hai,
can anyone suggest how to work with I2c protocol.
Post a Comment