Postingan

Menampilkan postingan dari Oktober, 2015

Knock Sensor using arduino and piezo element

Gambar
This is a simple knock sensor using arduino UNO and piezo element. the delay time can change from program code. the sensitivity also can change by two ways: 1-change the value of resistor from 0.5 to 1.5 mega ohm OR 2-change the number that written after " threshold= " const int sensorPin=0; const int ledPin= 13; const int threshold= 50; void setup() { pinMode(ledPin, OUTPUT); } void loop() { int val= analogRead(sensorPin); if (val >= threshold) { digitalWrite(ledPin, HIGH); delay(5000); digitalWrite(ledPin, LOW); } else digitalWrite(ledPin, LOW); }

Light level meter using arduino and LDR

Gambar
This is a simple Light level meter using arduino UNO and LDR. You can change the sensitivity by change the number that written after "Light /" in programming code. for making this project you don't need to use light sensor module(only LDR and 10K resistor). int led[10] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; int adjust = 0; int Light, i; void setup() { for (i=0;i<10; i++) pinMode(led[i], OUTPUT); Serial.begin(9600); } void loop() { Light = analogRead(adjust); Serial.println(Light); Light = Light / 50; Serial.println(Light); if (Light == 0) { for(i = 0; i < 10; i++) { digitalWrite(led[i], LOW); } } else { for(i = 0; i < Light; i++) { digitalWrite(led[i], HIGH); } for(i = i; i < 10; i++) { digitalWrite(led[i], LOW); } } delay(100); }

Super mario music using arduino and piezo buzzer

Gambar
You can play music of super Mario using arduino and piezo buzzer. i find it in arduino site. #define NOTE_B0  31 #define NOTE_C1  33 #define NOTE_CS1 35 #define NOTE_D1  37 #define NOTE_DS1 39 #define NOTE_E1  41 #define NOTE_F1  44 #define NOTE_FS1 46 #define NOTE_G1  49 #define NOTE_GS1 52 #define NOTE_A1  55 #define NOTE_AS1 58 #define NOTE_B1  62 #define NOTE_C2  65 #define NOTE_CS2 69 #define NOTE_D2  73 #define NOTE_DS2 78 #define NOTE_E2  82 #define NOTE_F2  87 #define NOTE_FS2 93 #define NOTE_G2  98 #define NOTE_GS2 104 #define NOTE_A2  110 #define NOTE_AS2 117 #define NOTE_B2  123 #define NOTE_C3  131 #define NOTE_CS3 139 #define NOTE_D3  147 #define NOTE_DS3 156 #define NOTE_E3  165 #define NOTE_F3  175 #define NOTE_FS3 185 #define NOTE_G3  196 #define NOTE_GS3 208 #define NOTE_A3  220 #define NOTE_AS3 233 #define NOTE_B3  247 #define NOTE_C4  262 #define NOTE_CS4 277 #define NOTE_D4  294 #define NOTE_DS4 311 #define NOTE_E4  330 #define NOTE_F4  349 #define NOTE_FS4 370 #def

sound level detector using arduino and microphone

Gambar
You can make a simple sound level detector without using sound detector module for arduino. You can add more LEDs. The sensitivity can change by changing the number that written after "sig>" in program code for each color.   Please subscribe to my YouTube channel here:  https://www.youtube.com/c/EngMousaalkaabi?sub_confirmation=1 Code: #define MIC A0 int sig = 0; void setup() {  pinMode(2, OUTPUT);  pinMode(3, OUTPUT);  pinMode(4, OUTPUT);  pinMode(5, OUTPUT); } void led() {  sig = analogRead(MIC)*50;  if (sig>1)  {digitalWrite(2, HIGH);} else {digitalWrite(2, LOW);}  if (sig>300) {digitalWrite(3, HIGH);} else {digitalWrite(3, LOW);}  if (sig>800) {digitalWrite(4, HIGH);} else {digitalWrite(4, LOW);}  if (sig>950) {digitalWrite(5, HIGH);} else {digitalWrite(5, LOW);} } void loop() {  led(); }

light switch using arduino and LDR

Gambar
You can make a simple DC light switch without using light sensor module, just with LDR and 10K ohm resistor. The sensitivity can change by two ways 1-changing the 10k resistor OR 2-changing "sensor reading" in program code. Code: int sensorReading;//analog pin reading void setup() {   Serial.begin(9600);   pinMode(10,OUTPUT); } void loop() {   sensorReading=analogRead(0);  //get analog reading   if (sensorReading<200)   {     digitalWrite(10,HIGH);   }   else digitalWrite(10,LOW);   Serial.println(sensorReading);   delay(1000); }

DC motion switch without using arduino

Gambar
Following circuit is simple way to using motion sensor module and some other electronic components for making a DC motion switch without using Arduino. Parts list: PIR motion sensor HC-SR501 Transistor 2N2222 or any other NPN transistor 12 Relay Diode 1n4007 Diode 1n4148 Capacitor 220uF 25v Resistor 1k   Some information about motion module: Sensing range: 3meter to 7meters. Working voltage range: DC 4.5-20V Delay time: 10-200S (adjustable) Induction angle: <100 degree cone angle Working temperature: -15-+70 degrees  

Sequential flasher using arduino and 14 LED

Gambar
This is simple flasher with 14 LEDs. you can decrease the flashing speed by changing number "100" in first line of program code to "500" for example. You must protect your LEDs by putting a 150 ohm resistor through GND line. Code: int timer = 100;      int ledPins[] = {   0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13};     int pinCount = 14;       void setup() {   for (int thisPin = 0; thisPin < pinCount; thisPin++)  {     pinMode(ledPins[thisPin], OUTPUT);       } } void loop() {   for (int thisPin = 0; thisPin < pinCount; thisPin++) {     digitalWrite(ledPins[thisPin], HIGH);      delay(timer);                     digitalWrite(ledPins[thisPin], LOW);     }   for (int thisPin = pinCount - 1; thisPin >= 0; thisPin--) {     digitalWrite(ledPins[thisPin], HIGH);     delay(timer);     digitalWrite(ledPins[thisPin], LOW);   } }