Postingan

Menampilkan postingan dari Juli, 2018

Arduino spirit Level using gyroscope with LED

Gambar
Arduino spirit Level using gyroscope with 11-LED Parts list: Arduino Nano: https://goo.gl/Gox61E Gyroscope: https://goo.gl/vxP6zG Prototype Breadboard: https://goo.gl/jxEJx5 LED Kit: https://goo.gl/UDemfT Resistor Kit: https://goo.gl/TvFJWz Circuit: Video: Code: #include <Wire.h> //Declaring some global variables int gyro_x, gyro_y, gyro_z; long gyro_x_cal, gyro_y_cal, gyro_z_cal; boolean set_gyro_angles; long acc_x, acc_y, acc_z, acc_total_vector; float angle_roll_acc, angle_pitch_acc; float angle_pitch, angle_roll; int angle_pitch_buffer, angle_roll_buffer; float angle_pitch_output, angle_roll_output; long loop_timer; int temp; void setup() {   pinMode(3,OUTPUT);   pinMode(4,OUTPUT);   pinMode(5,OUTPUT);   pinMode(6,OUTPUT);   pinMode(7,OUTPUT);   pinMode(8,OUTPUT);   pinMode(9,OUTPUT);   pinMode(10,OUTPUT);   pinMode(11,OUTPUT);   pinMode(12,OUTPUT);   pinMode(13,OUTPUT);   Wire.begin();                                                        //Start I2C as master   setup_mpu_

Arduino 220V AC Dimmer (JLCPCB)

Gambar
220V AC Dimmer using Arduino and making PCB order from JLCPCB  Wiring: Convert to PCB using EasyEDA: PCB order on JLCPCB.COM: Parts list: Arduino Nano Triac driver MOC3021 Optocoupler  PC817 Resistor 100K (2pcs) Resistor 470R (2pcs) Resistor 100R 1W Resistor 330R Resistor 10K Capacitor 100nF 400V 7Segment (Common cathode) Triac BT136 Diode bridge 0.5A IR receiver 1838B Terminal connector 2Pin (2pcs)  Push-button switch (2pcs) Download my Gerber File from here: https://drive.google.com/open?id=1DStmUIO0fcXJRmCG-zzzemJQBiqQ22zv Video:  Code: #include "IRremote.h" //-----( Declare Constants )----- int receiver = 9; //-----( Declare objects )----- IRrecv irrecv(receiver);           // create instance of 'irrecv' decode_results results;            // create instance of 'decode_results' //-----( Declare Variables )----- #include <TimerOne.h>           // Avaiable from http://www.arduino.cc/playground/Code/Timer1 volatile int i=0;               // Variable to u