Postingan

Menampilkan postingan dari September, 2015

Distance meter with 6 LEDs using arduino and ultrasonic sensor

Gambar
This is simple distance meter with 6LEDs. you can replace the last red led with a buzzer. distance range: <5 to 30cm ultrasonic module: HC-SR04 NOTE: Ultrasonic module can detect distance range from 2cm to 450cm but in this project i set the distance range from <5 to 30cm. code: #define trigPin 7 #define echoPin 6 #define led 13 #define led2 12 #define led3 11 #define led4 10 #define led5 9 #define led6 8 int sound = 250; void setup() {   Serial.begin (9600);   pinMode(trigPin, OUTPUT);   pinMode(echoPin, INPUT);   pinMode(led, OUTPUT);   pinMode(led2, OUTPUT);   pinMode(led3, OUTPUT);   pinMode(led4, OUTPUT);   pinMode(led5, OUTPUT);   pinMode(led6, OUTPUT);   } void loop() {   long duration, distance;   digitalWrite(trigPin, LOW);   delayMicroseconds(2);   digitalWrite(trigPin, HIGH);   delayMicroseconds(10);   digitalWrite(trigPin, LOW);   duration = pulseIn(echoPin, HIGH);   distance = (duration/2) / 29.1;   if (distance <= 30) {     digitalWrite(led, HIGH);     sound = 25

29 tips to water and energy saving

Gambar
There are many ways to water and energy saving that help to reducing water and electric bill and also help to environment. 29 tips briefly: 1-Using LED lamps rather than CFL or incandescent lamps. 2-Using auto light switch for garden lights. that turn on your garden lamps at night and turn off that in daylight automatically. 3- Using motion sensor switch help to optimizing electric consumption. 4-Solar energy can product all or some power needed in your home 5-Using solar water heater   6-Double glazed windows work as a heat insulator so doesn't allow to heat go outside in winner and doesn't allow to heat come inside in summer. 7-Don't run air conditioner and ceiling fan together because the ceiling fan push the heat air down.   8- Always set your conditioner in auto state then choose suitable temp. that you want. in this state the conditioner stops when arrive to that temp. so help to power saving.  9-New fridge always have an incandescent lamp that consume high power and