Skip to main content

Featured Post

Kerala's First 3D Printed Building

Created as a showcase project, AMAZE-28, the single-room summer house, was successfully constructed within 28 days on the grounds of the Kerala State Nirmithi Kendra. The 3D-printed building at the Kerala State Nirmithi Kendra in Thiruvananthapuram. (Photo: Shekunj)  The inauguration of Kerala's inaugural 3D-printed structure, a 380-square-foot single-room summer house, is scheduled to take place on October 10 at the Kerala State Nirmithi Kendra (Kesnik) campus located in PTP Nagar, Thiruvananthapuram.  Conceived as a showcase initiative, the summer house named AMAZE-28 was successfully finished within a mere 28 days. This impressive project was executed by Tvasta, a construction technology startup based in Chennai, founded by alumni of IIT-Madras, who have entered into a memorandum of understanding (MoU) with Kesnik.  AMAZE-28 is perched upon a concrete foundation atop a gentle elevation within the Kesnik campus. Febi Varghese, the Director and Chief Executive Officer of...

How to use the Arduino to generate Pulse-Width Modulation (PWM)

 PWM using Arduino: In this article we will look at Pulse-Width Modulation, how to use the Arduino to generate it, and what it does.

 How to use the Arduino to generate Pulse-Width Modulation (PWM)

You will understand what PWM is, and how to use the Arduino to generate it. We will do this by dimming an LED. An LED is a Light Emitting Diode, and it can only be connected one way. If you connect it in reverse, it will not work at all.

You can distinguish the polarity of an LED in two ways. Firstly, there will be a longer leg and a shorter leg on the LED. The longer leg is positive and the shorter leg is negative. Sometimes however, the leg length may not be easily visible. For instance, if you have cut the legs shorter for a different project, or bent them for a breadboard. In this case, you can use the second method.

The second method is to look at the plastic body of the LED. You will notice one side of it is FLAT. This signifies the NEGATIVE side of the LED.

Components Required

  • Arduino
  • Breadboard
  • LED
  • Jumper Wires (Male to Male)
  • 1x 1k Resistor

 Procedure

In this article we will be wiring a circuit on the breadboard. A breadboard is a very handy prototyping board, which allows you to make non-permanent connections between components very fast, you can change components and connections without needing to bond anything together.

In this article we will be connecting an LED to a pin on the Arduino. If we were to connect it to the 5v output it would shine at full brightness. However we will be using the PWM abilities of the Arduino to “chop” the 5 volts up. Essentially we will turn 5v on and off rapidly, which will make the LED turn on and off. The longer we allow the pulses to be, the brighter the LED will seem. The slower we make them, the dimmer it will seem. 


 Code

//----Begin Code----
//Variables
int pwmVal = 255; //PWM range is 0 - 255. Change this value and reupload to see the difference!
void setup() {
// put your setup code here, to run once:
pinMode(ledPin, OUTPUT); //Set the pin we chose above as OUTPUT. This is actually automatic however I included it to give an example of where you might use this feature.
analogWrite(6, pwmVal); // the 6 is the pin on the Arduino the LED is connected to, pwmVal is the variable containing the value for the PWM duration. analogWrite tells the Arduino this is a PWM pin.
}
void loop() {
// put your main code here, to run repeatedly:
}
//----End Code ----

Comments

Popular posts from this blog

Making LED Fade in and out using Arduino

Hi Friends!!!!!! We have learnt how to blink LED with the help of Arduino, that's great! But now we will learn how to make a LED fade in and out gradually using a function in arduino : analogWrite(); Let's have a look on components, which we are going to need ahead. COMPONENT NEED -  Breadboard (1) Arduino (1) Jumper Wires LED 5mm (1) Resistor1K ohm (1) Power Source 5V (1) Now we place these components to make a proper circuit. CIRCUIT PREPRATION - Black wire - GND Red Wire   - +5V Take the breadboard and arduino. Connect the GND from arduino to -Ve terminal on breadboard. Similarly +5V to the +Ve terminal on breadboard.   Now place the LED on breadboard. Connect the positive terminal of LED to the 9th pin of arduino. Why we connecting the LED to the pin 9 of arduino ???? Because pin 9 of arduino can be used for PWM purpose. We needed PWM (Pulse Width Modulation) because Arduino board can only give digital signal (HI...

Blinking of LED Using Arduino UNO

Hi !!!! Here we are going to learn very very simple use of Arduino, that is blinking of a LED. Here we will do simplest project using Arduino. So, here we go.... COMPONENTS REQUIRED - Bread Board Arduino UNO Jumper Wires Power Source (5V) / Battery Resistor (1K) CIRCUIT PREPA RATION - Take bread board and Arduino. Connect the +5V from Arduino to the +Ve line on Bread Board and GROUND from Arduino to -Ve line on bread board. Red Wire     : +5 V Black Wire  : GROUND     Now put a LED on bread board. Connect the Anode (+ / Longer terminal) of led to the pin 13 of Arduino. Connect Cathode (- / Shorter terminal)  to 1K ohm resistor and connect another terminal of resistor to the GND on breadboard.   Now our circuit is ready to work.  Our next aim is to build the code. Let's make our code. CODE -     To download the complete code -  CLICK HERE -----------------------------...

Introduction to Additive manufacturing and demonstration of part fabrication

  Introduction : Additive Manufacturing  Additive manufacturing uses data computer-aided-design (CAD) software or 3D object scanners to direct hardware to deposit material, layer upon layer, in precise geometric shapes. As its name implies, additive manufacturing adds material to create an object. By contrast, when you create an object by traditional means, it is often necessary to remove material through milling, machining, carving, shaping or other means.  Although the terms "3D printing" and "rapid prototyping" are casually used to discuss additive manufacturing, each process is actually a subset of additive manufacturing.   Additive Manufacturing Processes Binder Jetting   T his technique uses a 3d printing style head moving on x, y and z axes to deposit alternating layers of powdered material and a liquid binder as an adhesive. Directed Energy Deposition  Direct energy deposition additive manufacturing can be used with a wide variety of materials in...