How to Check CNIC Information Online with Pakdata cf
Report for weather pi
1. AIM OF THE PROJECT
WeatherStationwithRaspberrypi andArduino
GENERAL APPLICATIONAND DESCRIPTION OF THE PROJECT
Thisprojectcan be usedtoobserve the temperature difference occurringthroughoutthe day,find
out the max and mintemperature andalsorecordthe effectsontemperaturesdue tonatural
calamities.
WORKING OF THE CIRCUIT/MODEL AND IMAGE OF THE CIRCUIT CONNECTION
1. Environmentrepresentsthe surroundingsfromwhere the temperature will be measured.
2. WeatherModel usesa LM35 temperature sensortomeasure the surroundingtemperature and
sendthe data to ArduinoUnoboard.
3. The ArduinoUno boardtakesin the data, convertsitintoCelsiusscale (FormulaVout/2) and
generatesdigital temperature datatobe sentto RaspberryPi.
4. The Raspberrytakesinthe data andcreatesa server.
5. The serverisbasedon NodeJsandusesthe followinglibraries:
a. ‘express’frameworktogenerate askeletonof the serverfiles.
b. ‘http’libraryto take inhttp requestsfromthe client.
c. ‘serialport’librarytotake data fromthe USB port where the Arduinoisconnected.
6. The clientwhichcan run onmobile ordesktoptakesinthe data fromthe serverand then
generate agraph usingthe library:‘d3.js’.
CIRCUIT/MODEL DESCRIPTION
The 3 terminalsof the LM35 are connectedasfollows:
1. +5v
2. Ground
3. Vout
The 5v and groundterminalsare connectedthrougha5kohmresistor.
The Arduinoisconnectedtothe Raspberrypi through Serial Bus.
The pi isconnectedtoa Wi-Fi networkthroughwhichthe clientcanaccess.
2. SIMPLE BLOCK DIAGRAMOF THE FUNCTIONING OFTHE CIRCUIT/MODEL
IMAGEAND PART NUMBER OF THE COMPONENTSAND THE RESPECTIVE PRICE
COMPONENTS Quantity PRICE ( Rs )
RaspberryPi B+ 1 2899
ArduinoUno 1 550
Male/Female Wires As Reqd 10
Total 3459
ACTUAL IMAGEOF IMPLEMENTED CIRCUIT/MODEL (image of the workingmodel/circuit)
3. The projectcode can be foundat the github link: https://github.com/zairzacse/LIfetemp
CODE (if programmingisinvolved)
Serverside code :
var app = require('express')();
var http = require('http').Server(app);
var SerialPort=require("serialport").SerialPort;
var serialPort=newSerialPort("/dev/ttyACM0",{
baudrate:9600
});
app.use(require('express').static(__dirname));
var tempdata;
serialPort.on("open",function() {
console.log('opened');
serialPort.on('data',function(data){
data = parseInt(data.toString());
if(data>15 && data<=150){
console.log("Datarecievedis:" + data);
tempdata= data ;
}
});
});
app.get("/data",function(req,res){
res.send({value:tempdata});
});
http.listen(1337,function(){
console.log("listningon1337");
4. })
Clientside script:
<script>
var n = 40,a;
random = d3.random.normal(0,0),
data = d3.range(n).map(random);
var margin= {top:20, right:20, bottom:20, left:40},
width= 960 - margin.left- margin.right,
height= 500 - margin.top - margin.bottom;
var color = d3.scale.category10();
var x = d3.scale.linear()
.domain([1,n - 2])
.range([0,width]);
var y = d3.scale.linear()
.domain([0,80])
.range([height,0]);
var line = d3.svg.line()
.interpolate("basis")
.x(function(d,i) { returnx(i);})
.y(function(d,i) { returny(d);});
var svg = d3.select("body").append("svg")
.attr("width",width+margin.left+margin.right)
.attr("height",height+margin.top+ margin.bottom)
.append("g")
.attr("transform","translate("+margin.left+","+ margin.top+ ")");
svg.append("defs").append("clipPath")
.attr("id","clip")
.append("rect")
.attr("width",width)
.attr("height",height);
svg.append("g")