Skip to main content

Posts

Showing posts with the label Switch

RGB LED Using Accelerometer and ARM

Hey Folks, In this tutorial, we will learn, how to change the colour of RGB LED using accelerometer of the ARM (FRDM-KL25Z). INTRODUCTION The FRDM-KL25Z is an ultra-low-cost development platform for Kinetis L Series KL1x (KL14/15) and KL2x (KL24/25) MCUs built on ARM® Cortex™-M0+ processor.  The FRDM-KL25Z has been designed by NXP in collaboration with mbed for prototyping all sorts of devices, especially those requiring the size and price point offered by Cortex-M0+ and the power of USB Host and Device. The FRDM-KL25Z is supported by a range of NXP and third-party development software. It is packaged as a development board with connectors to break out to stripboard and breadboard and includes a built-in USB FLASH programmer.               FEATURES NXP KL25Z Kinetis KL2x MCU (MKL25Z128VLK4) High-performance ARM® Cortex™-M0+ Core 48MHz, 16KB RAM, 128KB FLASH USB (Host/Device) SPI (2) I2C (2) UART (3) PWM (TPM) ADC (16 bit) DAC (1x 12bit) Touch Se

Interfacing of Push Button With ATmega16

In this tutorial, we will learn how to interface a switch(push button) with ATMEGA16 using AVR studio. In the previous video, we learnt how to interface LEDs with ATMEGA16 using AVR studio. The push-button is a component that connects two points in a circuit when you press it. The example turns on an LED when you press the button. Here we have connected two push button to PORT C in  PC0 & PC1. And for LEDs connection please refer my previous blog. Components Required:- AVR Controller(Atmega16) LEDs Push Button Connecting Wires USBASP Programmer Dump the following code after connection  and select chip ATMEGA 16. #include<avr/io.h> #include<util/delay.h> void main()  {    DDRB=0b11111111;    int S1;    int S2;      while(1)    {     S1=PINC&0b00000001;     S2=PINC&0b00000010;     if(S1==0b00000001)     {      PORTB=0b00000001;      _delay_ms(100);      }      if(S2==0b00000010)     {      PORTB=0b00000010;      _delay_ms(100);  

16x2 LCD Interfacing with Arduino

In this tutorial, we will learn, how to interface an LCD (liquid crystal display) with ARDUINO.  An LCD screen is an electronic display module having a flat panel display or we can say it’s an electronically modulated optical device that uses the light modulating properties of liquid crystals. We will interface a 16x2(16 columns and 2 rows) LCD. Other variations are also available like 8x1,10x2 etc. It is having a wide range of applications; they are also preferred over the 7-segment display as they are cheap, easily programmable and also have the leverage to display special characters. Now let us interface Components Required 16x2 LCD                   1No. Resistor 560ohms        1No. Potentiometer 10k      1No. Arduino UNO               1No. Few connecting wires Breadboard Follow the image below for circuit connection reference. After making the circuit dump the code given below. #include<LiquidCrystal.h> LiquidCry

Basics of Embedded System Design on AVR

In this tutorial, we will learn how to interface LED with Atmega16 using AVR Studio . An embedded system is built around a processor. The design goals of an embedded system are to reduce size, cost and power consumption and to increase performance and reliability. The microprocessor we are using is ATMEGA16 . The processor has limited internal memory, and if this is not sufficient for a given application external memory devices are used. The hardware also includes any components that facilitate the user-application interaction such as display units, keypad. The light-emitting diodes are used for getting status information, such as power on, check output(high/low). You all must have observed led decoration lights, which can glow in different patterns. First, we will learn to interface a single Led and then 8 LEDs to learn a simple toggling technique. Components Required:- AVR controller(Atmega16) LEDs Connecting wires USBASP Programmer For

Servo Motor Interfacing with Arduino

In this tutorial, we will learn how to interface a servo motor using Arduino UNO. The motor inside the setup of a servo is attached by gears to the control wheel. When the motor rotates, the potentiometer’s resistance changes hence the control circuit can precisely regulate how much movement there is and in which direction. The motor’s speed is proportional to the difference between its actual position and desired position. When the shaft is near the desired position it turns slowly else fast. This is called proportional control. They are controlled by sending PWM (pulse width modulated) signals through the control wire. They are available in many sizes and are of three types Positional rotation  Continuous rotation  Linear The most common type is the positional rotational one. So now we are familiar with the motor let us interface it Components Required: Servo motor 1No Arduino UNO 1No Few connecting wires Breadboard Follow the video below for cir

Multicolor Bulb Using Arduino Project

Since now we are all familiar with RGB LED’s let us show you one of the products made by us (  Karkhana Makerspace ). The below is the video of our product (Mobile Control RGB Bulb) Working description: It is a decoration lamp which can be used to lighten your home according to your mood or occasion. The color selection of the lamp is simply controlled with the help of our app. The concept is the same as I have mentioned in my previous blogs here we are giving instructions wireless via Bluetooth to the controller which drives the lamp. For any detail or query regarding the above project, Contact us at hello@karkhana.club Thinking? Join our hands-on training courses. To know more visit us at  https://karkhana.club/

Interfacing of Multicolor LED with Arduino

In this tutorial, we will learn how to interface an RGB led with Arduino. An RGB led consist of three Led’s namely red, green and blue inside a single package. It is having three pins the longer one(2) is the GND(in the case of the common cathode) and the other three pins represent the three colours. You all must have heard about the RGB colour model, it is a model representing the colours that can be generated with the combination of three basic colours. Now let’s interface the led and have some fun with it. Components required Resistor                         1No.              200 ohms RGB led                         1No.  Arduino UNO                 1No. Few connecting wires Follow the video below for circuit connection reference. After making the circuit connections dump the code given below.   int led1 = 3; int led2 =5; int led3 =6; void setup()  { pinMode(led1, OUTPUT); pinMode(led2, OUTPUT); pinMode(led3, OUTPUT); } void loop()  { digitalWrite

Interfacing of Potentiometer with Arduino

In this tutorial, we will learn how to control the brightness of a LED using potentiometers(Variable Resistor). A potentiometer also known as the pot is a three-terminal resistor with sliding or rotating contact that forms an adjustable voltage divider, they can be also used as a rheostat or variable resistors. Broadly there are two types of potentiometers available.          The Rotary Pot - they use a rotary motion to move the slider around a track that compromises most of a circle, with contacts at either end of the track in the area where part of the circle is missing. They are widely used in appliances with knob control.        The Sliding Pot - - they are those variable resistors that slide in a linear fashion,i.e in a straight line. These controls take up more front panel space but are much easier to use under some circumstances. for example, they are widely used for audio mixers and lighting desks.          Now we know how a pot works let us have som

Getting Started with Switches

Since now we are well acquainted with LED’s let us learn how to control the switching using a push button. In this tutorial, we will learn how to use a push button. A push button is used to get control of the circuit. Components Required Resistors                           2Nos. 330ohms,10k(recommended) Pushbutton                        1No. LED                                  1No. Standard red LED Arduino UNO Breadboard Follow the video to make the circuit. After making the circuit it will look like Now dump the code given below int d=2; // chose the pin which you have connected to the output of push button void setup() { pinMode(2,INPUT); pinMode(13,OUTPUT); } void loop() { d=digitalRead(2); if(d==0) { digitalWrite(13,HIGH); } else { digitalWrite(13,LOW); } } Now the control is in your hands whenever you will press the button the led will be ON and when you release it, LED will go OFF. You can alter the control like