Skip to main content

Posts

Showing posts from May, 2016

Arduino Beginner Experiments: Arduino and Relay

HELLO THERE!!           How are you guys doing? I hope everyone is fine and in good mood always. First of all, I would like to apologize my hiatus for about two weeks. I was actually preparing and presenting my Final Year Project for my degree. Now, that's done( a huge relief) I can continue sharing with you guys on my tinkering with Arduino. Ok, today, I would like to share about Arduino and Relay. The objective of this Experiment is to switch on/off between two channel relays. First things first: The Software and Hardware used in this experiment: Hardware 1.Arduino UNO 2. 2 Channel Relay Software: 1, Arduino IDE     After obtaining all the items, Let's assemble the circuit. Assembling the circuit is fairly simple. As I am using relay exactly as the image above, I will use the image as my reference. The connections from the relay to Arduino are as follows: Relay          Arduino GND-------->GND IN1---------->digital pin8  IN2------

Arduino Beginner Experiments: LDR and Arduino

HELLO THERE!!!       How are you guys? I hope everyone is fine and in a good shape. This week, I would like to share with you guys on controlling LED brightness using LDR(photoresistor/Light Dependent Resistor). Now let's get started,shall we?   OK, first thing's first, Items needed: HARDWARE: 1.Arduino UNO 2.LDR x1 3.LED x1 4. Resistor (220 ohms) x1 SOFTWARE: 1. Arduino IDE After obtaining the items, let's assemble the circuit. The circuit is fairly simple. One leg of the LDR is connected to the 5V while the other leg are connected to the GND and analog pin of Arduino. The sketch below will depict on the assembly of the circuit: The assembly of the circuit After assembling the circuit, let's code it. The code is pretty straightforward, we read the LDR readings and use it to control LED's brightness. The code is shown below: int ldr =  A0; //ldr analog pin int val;//value to keep analog readings i