Posts

Showing posts from February, 2018

NodeMcu Basics (IoT).

Image
Basics:
Lets begin with Installing the Esp8266 support for the Arduino and see how to blink an LED ( the hello world in the electronics ) check out the video to know step by step tutorial on how to get started with our favourite chip Esp8266

Firstly open the Arduino IDE

Go to files and click on the preference in the Arduino IDE





copy the below code in the Additional boards Manager

http://arduino.esp8266.com/stable/package_esp8266com_index.json

click OK to close the preference Tab.









After completing the above steps , go to Tools and board, and then select board Manager








Navigate to esp8266 by esp8266 community and install the software for Arduino.

Once all the above process been completed we are read to program our esp8266 with Arduino IDE.























For this example I have used NodeMCU esp8266 and if you are using any other vendor wifi chips or generic wifi module please check with the esp8266 Pin mapping which is very essential to make things works.

The reason why I used D7 pin for this exa…

Servo motor to Arduino (Basics)

Image
Servo motors are great devices that can turn to a specified position.
Usually, they have a servo arm that can turn 180 degrees. Using the Arduino, we can tell a servo to go to a specified position and it will go there. As simple as that!
Servo motors were first used in the Remote Control (RC) world, usually to control the steering of RC cars or the flaps on a RC plane. With time, they found their uses in robotics, automation, and of course, the Arduino world.
Here we will see how to connect a servo motor and then how to turn it to different positions.
The first motor I ever connected to an Arduino, seven years ago, was a Servo motor. Nostalgic moment over, back to work!
We will need the following things:
An Arduino board connected to a computer via USB A servo motor Jumper wires There are few big names in the servo motor world. Hitec and Futaba are the leading RC servo manufacturers. Good places to buy them are Servocity, Sparkfun, and Hobbyking.

Step 1: How to Connect The…

Ultrasonic Range Detector Using Arduino and the SR04 Ultrasonic Sensor

Image
Step 1: Connecting the SR04 Ultrasonic Sensor to the Arduino Step 2: Parts List 1               Arduino uno R3, or any Arduino for that matter
1               SR04 Ultrasonic Sensor
1               breadboard
4               Jumper Wires Step 3: Connect Ultrasonic Sensor to Arduino You Need 4 Jumper wires to conect the SR04 Ultrasonic Sensor to the Arduino:

1  From the SR04  VCC pin to the Arduino 5v
1 From the SR04  GND pin to the Arduino GND
1 From the SR04  TRG pin to the Arduino Digital pin 12
1 From the SR04  ECHO pin to the Arduino Digital pin 11


That's All The wiring you need... Easy,  no?

Next Step, load the Software library and sketches. Step 4: Step 4 Download SR04 Library and Install to Arduino IDE

You need to download another Library  to get the Arduino to talk with the SR04 sensor. The sensor I got didn't come with any documentation, so I Googled around until I found a library that works.
I found an optimized library here
Download the library unzip it,  and…

Controlling AC Light Using Arduino With Relay Module

Image
Introduction:
It is a simple project and also very dangerous as we are going to deal with high voltage 220v . Do not attempt if you are a amateur in dealing with high voltage.
I'll answer few basic questions, which hits when you are novice!
Why to use relay for controlling AC light?
AC is alternating current 220v (india) which powers the ac lights. Arduino cannot control high volt n amp, but a relay can do this job, which is the sole design of it. so we are using relay as switch to control high power devices.


What is NO NC and COM in relay?

C = Common Connection

NC = Normally Closed Connection

NO = Normally Open Connection

I have explained NO NC COM elaborately in step 3, refer it -if you feel it bit confusing.
I'm going to use NO Normally Open Connection.
Step 1: Components Needed


1) Arduino UNO
2)5V Relay module 220v
3)Ac light Step 2: Connections


Connect pin 7 arduino to IN 1 relay module
5v to vcc of relay module
gnd to gnd of relay module  Step 3: NC COM NO of Re…

Interfacing Humidity and Temperature (DHT11) Sensor to Arduino

Image
DTH11 includes both Humidity and Temperature sensor. Hardware Components required:-
1) DTH11 Humidity and Temperature Sensor
2) Arduino UNO
3)Connecting Wires
4) DTH library
You can get the sensor DTH11 Data Sheet from the below link
http://www.micro4you.com/files/sensor/DHT11.pdf



Hardware Connections DTH11 To Arduino
Vcc --- 5v
GND --- GND
Data Pin --- 3rd Pin of Arduino


Step 1: How to Include DHT Library













































Please download the DHT library from the below link.
https://drive.google.com/file/d/0B1paTI5fzcHodno5azFOSVVDT0E/view?usp=sharing
Go to Sketch--> Include Library --> Add Zip File
As shown in the above screen shot please browse the ZIP file and include the library after including the library.
Close the Arduino IDE and open it again then you will find the library included.
 Step 2: Program and Results













Code:
#include<dht.h>
dht DHT;
// if you require to change the pin number, Edit the pin with your arduino pin.
#define…

LDR with Arduino

Image
Step 1: Hardware Required :
Arduino UnoLEDLDR (photoresistor)220 and 10k ohm resistorsWiresBreadboard  Step 2: LED Connection

LED attach to boardResistor (220 ohm) one leg attach to LED long legThe green wire attach to resistor's empty legThe brown wire attach o LED short leg Step 3: LDR Connection LDR attach to boardResistor (10k ohm) attach to LDR one legThe purple wire attach to LDR other (empty) legThe yellow wire attach to LDR and resistor same columnThe white wire attach to resistor empty leg  Step 4: Arduino Connections



The green wire connect to digital 13 from resistor legThe brown wire connect to GND from LED short legThe purple wire connect to +5V from LDRThe yellow wire connect to A0The white wire connect to GND Step 5: Code
 Code:
const int ledPin = 13;
const int ldrPin = A0;
void setup() {
Serial.begin(9600); pinMode(ledPin, OUTPUT); pinMode(ldrPin, INPUT); }
void loop() {
int ldrStatus = analogRead(ldrPin); if (ldrStatus <=300) { digitalWrite(ledPin, HIGH); Serial.pr…

Using a PIR with Arduino

Image
Connecting to a PIR

Most PIR modules have a 3-pin connection at the side or bottom. The pinout may vary between modules so triple-check the pinout! It's often silkscreened on right next to the connection (at least, ours is!) One pin will be ground, another will be signal and the final one will be power. Power is usually 3-5VDC input but may be as high as 12V. Sometimes larger modules don't have direct output and instead just operate a relay in which case there is ground, power and the two switch connections.
The output of some relays may be 'open collector' - that means it requires a pullup resistor. If you're not getting a variable output be sure to try attaching a 10K pullup between the signal and power pins.
An easy way of prototyping with PIR sensors is to connect it to a breadboard since the connection port is 0.1" spacing. Some PIRs come with header on them already, the one's from adafruit have a straight 3-pin header on them for connec…

Arduino Soil Moisture Sensor

Image
Arduino Soil Moisture Sensor When you hear the word Smart Garden, one of the things that pop up to your mind is the automatic measurement of the moisture content of the soil. If you're building a Smart Garden that waters plants automatically and give you the readings of the wetness of the soil, then you will definitely need a Soil Moisture Sensor.
In this Instructable, I'll show you how to interface the Soil Moisture Sensor to an Arduino Uno and read the values on a Serial Monitor.





For this project, you will need :
Arduino UnoSoil Moisture SensorHook up WiresBread Borad.
Step 2: About the Soil Moisture Sensor A typical Soil Moisture Sensor consist of two components. A two legged Lead, that goes into the soil or anywhere else where water content has to be measured. This has two header pins which connect to an Amplifier/ A-D circuit which is in turn connected to the Arduino.
The Amplifier has a Vin, Gnd, Analog and Digital Data Pins. This means that you can get the v…