IOT Switch using NodeMcu and Blynk app

The Internet of Things (IoT) is the network of physical devices, vehicles, home appliances, and other items embedded with electronicssoftwaresensorsactuators, and connectivity which enables these things to connect, collect and exchange datacreating opportunities for more direct integration of the physical world into computer-based systems, resulting in efficiency improvements, economic benefits, and reduced human exertions.(that's IOT from wiki)

A simple beginners IOT based switching action is done in this project.

Things we need in this project is:
1. NodeMcu
2. 1 led with 200ohm resister.
3. Arduino IDE and Blynk library
4. Blynk App on your phone.

What's NodeMcu??
NodeMCU is an open source IoT platform.It includes firmware which runs on the ESP8266 Wi-Fi SoC from Espressif Systems, and hardware which is based on the ESP-12 module.The term "NodeMCU" by default refers to the firmware rather than the development kits.(source: https://en.wikiphttps://en.wikipedia.org/wiki/NodeMCUedia.org/wiki/NodeMCU)



First try to install NodeMcu board!!
1. Go to: tools\board\board manager\esp8266 (search online)
else if not found
2. goto file\preferences then look for additional board manager urls. paste "http://arduino.esp8266.com/stable/package_esp8266com_index.json" and repeat step-1 install esp8266 board from there.

Blynk Library:
Search for blynk Library or simply download it from:https://github.com/blynkkk/blynk-library

After downloading it:
1. Decompress and paste the folder in Arduino library present in documents. (e.g. paste it at C:\Users\*****\Documents\Arduino\libraries
2. Start arduino IDE and you can see custom example of BLYNK library at file\examples.
3. Connect nodeMce to PC. choose correct board,in my case-NodeMCU 1.0(ESP 12E module). Select the correct COM port(select the com which appears after connecting nodeMcu).
4. In arduino IDE go to:files\examples\blynk\boards_wifi\esp8266_standalone.
5. 3 things to edit here a-"YourAuthToken", b-"YourNetworkName", c-"YourPassword"
    'b' is your wifi network name (must connceted to internet) and 'c' is password set for that wifi network.  "YourAuthToken"-this will be discussed later after using the blynk app. After getting the authToken replace it and burn the code to nodeMcu.
6. Press reset. Watch connection Status on serial monitor. 

Jobs with the blynk App:
1. Download blynk App





2.Open the app login with FB or other methods.
3.Click on New project. Name the project(e.g. Iotswitch_gg). Choose Device: NodeMCU. Then create.
4.Authtoken is sent to your mentioned Email. Copy the authtoken and replace it in the code in nodeMCU. You can also get the Authtoken in the project setting.
5. Follow the steps in the app.

Hope you get it right!!!
KEEP VISITING MY BLOG.

Blink using 555 timer

Have you imagined a blink circuit without arduino!! It was very common using a 555 timer circuit building a flasher or blink circuit.

#Requirements:

1.555 timer IC
2.Capacitor
3.Resistors
4.Printed Circuit Board
5.Wires
6.Tools for soldering and 5v power Supply

7.Leds

1. See the pin diagram of 555 IC.
2. Theory behind this.
The IC is connected as a astable multivibrator with a duty cycle of about 10%.
In figure 1 the LED will be ON for a short period of time and OFF for a longer period. The duty cycle can be reversed if the LED is connected as shown in figure 2 but the battery consumption will also increase due to the fact that the LED will stay ON for a longer period of time.

3. Circuit diagram.
If you didn't get anything by reading above,you can simply connect the elements according to the circuit diagram given below.
The above circuit diagram is copied from internet you can modify this accordingly. So I have replaced higher value resistors with 10k ohm and lower value resistors with 200 ohm and capacitor of 63V/10 uF.
Actual Circuit:
I suggest that before making the circuit of PCB, you should try it on breadboard for best results and adjust timing of your flasher circuit.
I have also brought out additional output pins from leds. You can use them to power up relays and flash bigger lights.
To vary resistor you can use variable resistor or a 10k potentiometer and also the capacitor also.

for reference:



Keep visiting me!!!



Codes for adding letters to 8X5 leds

Codes for Adding letters to 8X5 LEDs

From the last blog we have written codes to On/Off a LED individually. So here I gonna explain how to display letters on leds.
The trick is simple and that is by blinking a LED each time. The speed is so fast that it appears that all LEDs are ON at same time.

I have used the alphabet patterns or you can say fonts as similar to 16x2 LCD display. So letters will be in 7X5 LEDs matrix.

Example:
So you can blink LEDs row wise(rows first) or column wise. here shows how can you blink LEDs one by one.
Code for Writing 'G' is given below:
void Gi()
{
 int a=timel;//duration for which letter will be displayed
 while( a > 0){
 onled(1,2); onled(1,3); onled(1,4);
 onled(2,1); onled(2,5);
 onled(3,1);
 onled(4,1); onled(4,3); onled(4,4); onled(4,5);
 onled(5,1); onled(5,5);
 onled(6,1); onled(6,5);
 onled(7,2); onled(7,3); onled(7,4); onled(7,5);
 a--;
}}
This code can be used in the last blog I posted using as a function.

For the complete code click on link... and thanks for visiting.

DIY 8x5 LED Matrix display

DIY 8x5 LED Matrix display

If you want to make a 8X5 led matrix display without using any other MUX with arduino,then this article is for you.
Things you needed:
1. bunch of LEDs(check before use)
2. PCB Board(Brown board)

3. Jumper Wires(Male to female)

4. Arduino
5. 100 ohms resistors
6. Soldering Instrument and Hot glue gun

Wiring up/ Circuit connections:
Before you start have brief idea about leds:

  • choose healthy LEDs only
  • do check before soldering on the PCB.
  • these needs min 1.5V and a few mA current. So accompany them with 200 or 100 ohm resistance.
All you need is connect all Anode of leds in a row together and connect all cathode of leds in a column together. The circuit diagram will clear your thoughts.

From the above diagram if the row-x is given Low state and column-y is given High state then the LED belongs to (x,y) will glow.
But in programming or using arduino the state of all other leds should be in opposite in order to Switch them off.
So the idea is to ON one led at a time and make all other leds OFF that time.

Here are some pictures while making the circuit:


  •  Do add resistances(100 ohm or 200 ohms) otherwise the leds may damage due to over current flow. Add female header pins for make it arduino friendly.

CODING:

here is the code:

int row=0,col=0;
int time1=5;
int timex=1;
void onled(int x,int y)//PASSING ROW AND COLUMN VARIABLES TO ON THE RESPECTIVE LED
{
 reset();
 if(x==1){row=2;} if(x==2){row=3;} if(x==3){row=4;} if(x==4){row=5;} if(x==5){row=6;} if(x==6){row=7;} if(x==7){row=8;} if(x==8){row=9;}
 if(y==5){col=19;} if(y==4){col=18;} if(y==3){col=17;} if(y==2){col=16;} if(y==1){col=15;}
 digitalWrite(row,LOW);
 digitalWrite(col,HIGH);
 delay(timex);
}
void reset()//THIS FUNCTION USED TO SUPPLY ANODE WITH gnd AND CATHODE WITH +5V
{
 digitalWrite(2,HIGH);digitalWrite(3,HIGH);digitalWrite(4,HIGH);digitalWrite(5,HIGH);digitalWrite(6,HIGH);digitalWrite(7,HIGH);digitalWrite(8,HIGH);digitalWrite(9,HIGH);
 digitalWrite(15,LOW);digitalWrite(16,LOW);digitalWrite(17,LOW);digitalWrite(18,LOW);digitalWrite(19,LOW);
}

void setup() {
Serial.begin(9600);  

pinMode(2,OUTPUT);pinMode(3,OUTPUT);pinMode(4,OUTPUT);pinMode(5,OUTPUT);pinMode(6,OUTPUT);pinMode(7,OUTPUT);pinMode(8,OUTPUT);pinMode(9,OUTPUT);
pinMode(16,OUTPUT);pinMode(17,OUTPUT);pinMode(18,OUTPUT);pinMode(19,OUTPUT);pinMode(15,OUTPUT);
}

void loop() {
 onled(1,1);//on led of row-1 col-1    
}
The result will look like this:







Displaying letters on this will be in the next blog,till then you can use loops for different new patterns.

16X2 LCD Interface with Arduino

16x2 LCD Interface with Arduino

Its quite inconvenience to use serial monitor of Arduino IDE to display data or any message when a wireless display is needed. Thus a on-board display will be helpful for solving this issue. 16x2 LCD is one of the simplest & cheapest display one can use for this purpose.

Things needed:
- Arduino
-16x2 lcd 
- Connecting wires

About 16x2 LCD :
The LCDs have a parallel interface, meaning that the microcontroller has to manipulate several interface pins at once to control the display.
The interface consists of the following pins:
·         A register select (RS) pin that controls where in the LCD's memory you're writing data to. You can select either the data register, which holds what goes on the screen, or an instruction register, which is where the LCD's controller looks for instructions on what to do next.
·         Read/Write (R/W) pin that selects reading mode or writing mode
·         An Enable pin that enables writing to the registers
·         data pins (D0 -D7). The states of these pins (high or low) are the bits that you're writing to a register when you write, or the values you're reading when you read.
·         There's also a display constrast pin (Vo), power supply pins (+5V and Gnd) and LED Backlight (Bklt+ and BKlt-) pins that you can use to power the LCD, control the display contrast, and turn on and off the LED backlight, respectively.
The process of controlling the display involves putting the data that form the image of what you want to display into the data registers, then putting instructions in the instruction register. The LiquidCrystal Library simplifies this for you so you don't need to know the low-level instructions.

Circuit Diagram
There are generally 16 pin slots on 16x2 LCD module. Here I have used 12 as shown in the figure. After wiring the module connect it and see if the back light is glowing.

Coding Part:
Write or past this code in arduino IDE

// include the library code:
#include <LiquidCrystal.h>
char str1[]="GaneshGadgets";
char str2[]=".blogspot.com";

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

void setup() {
  // set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
}
void loop() {
lcd.setCursor(0, 0);//cursor position
lcd.print("Ganeshgadgets ");
lcd.setCursor(3, 1);
lcd.print(".blogspot.com ");
}
The result will be like this: