Firebase - realtime backend for mobile app and IoT

Post on 15-Apr-2017

1,684 views 0 download

transcript

Game DevFest 2015Jakarta Oct 17 2015 | Surabaya Oct 18 2015

FirebaseRealtime backend for mobile app and IoT

Andri Yadiandri_yadi | a at dycode dot com

httpandriyadime | googlecom+AndriYadi

CEO of

Been coding in awesome languagesFrameworks for 18 years

QBasic Pascal c C++ Java PHP Bash C Visual Basic HTML JavaScript Python Objective-C Swift

NET QtQML Java MEEESE Android SDK iOS SDK Nodejs Arduino

Who am I around Firebase

How dare I am talking herehellip

Irsquom the user of firebase long before Firebase has order amp Limit feature

Irsquove been using it since Jan 2014

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Andri Yadiandri_yadi | a at dycode dot com

httpandriyadime | googlecom+AndriYadi

CEO of

Been coding in awesome languagesFrameworks for 18 years

QBasic Pascal c C++ Java PHP Bash C Visual Basic HTML JavaScript Python Objective-C Swift

NET QtQML Java MEEESE Android SDK iOS SDK Nodejs Arduino

Who am I around Firebase

How dare I am talking herehellip

Irsquom the user of firebase long before Firebase has order amp Limit feature

Irsquove been using it since Jan 2014

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

CEO of

Been coding in awesome languagesFrameworks for 18 years

QBasic Pascal c C++ Java PHP Bash C Visual Basic HTML JavaScript Python Objective-C Swift

NET QtQML Java MEEESE Android SDK iOS SDK Nodejs Arduino

Who am I around Firebase

How dare I am talking herehellip

Irsquom the user of firebase long before Firebase has order amp Limit feature

Irsquove been using it since Jan 2014

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Been coding in awesome languagesFrameworks for 18 years

QBasic Pascal c C++ Java PHP Bash C Visual Basic HTML JavaScript Python Objective-C Swift

NET QtQML Java MEEESE Android SDK iOS SDK Nodejs Arduino

Who am I around Firebase

How dare I am talking herehellip

Irsquom the user of firebase long before Firebase has order amp Limit feature

Irsquove been using it since Jan 2014

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Who am I around Firebase

How dare I am talking herehellip

Irsquom the user of firebase long before Firebase has order amp Limit feature

Irsquove been using it since Jan 2014

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Irsquom the user of firebase long before Firebase has order amp Limit feature

Irsquove been using it since Jan 2014

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Disclaimer

30 minutes wonrsquot be enough to show how cool Firebase is

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

What is Firebase

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Letrsquos see a Real-World demo

Rather than theoritise about it

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Take a photo with DevFest2015

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Shared photo will be automatically shown here httpstoryjepretinJepretgdgdevfest2015

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Firebase delivers that photo object to browser in realtime

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Jepret Cloud Jepret Allegra Jepret Story

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Firebase Firebase

Nodejs + MongoDBDeployed on Microsoft Azure

Architecture

Firebase

Realtime Gallery Allegra Machine Jepret Story app

Jepret Cloud

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

More about Jeprethttpjepretin

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Letrsquos see another demo

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Typical Firebase Demo

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Letrsquos Try something different

todayhellip

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Letrsquos Get Physical

todayhellip

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Letrsquos light up the LED

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

My Setup

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Circuit

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Code

var wpi = require(wiring-pi) wpisetup(gpio)

var ledPin = 26 26 is GPIO pin to LED

wpipinMode(ledPin wpiOUTPUT)

Turn offon the LED directly var ledValue = 1 0 to switch off wpidigitalWrite(ledPin ledValue)

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Letrsquos light up the LED via browser

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Architecture

Raspberry Pi 2 Web app

HTTP(LAN)

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Light up the LED via Firebase

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Architecture

Raspberry Pi 2Web app

Internet

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Firebase data

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

The trick

Raspberry Pi 2

Firebase

ifstate==truewrite1ifstate==falsewrite0

wpidigitalWrite(LED_PIN1)

Firebase

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Codefunction setState(state) ledValue = +state convert truefalse to appropriate integer wpidigitalWrite(ledPin ledValue)

var deviceId = smartlamp1 var myFirebaseRef = new Firebase(ldquohttps[YOUR_FIREBASE]firebaseiocomdevicesrdquo) var deviceRef = myFirebaseRefchild(deviceId)

var myDevParamsRef = deviceRefchild(parameters)myDevParamsRefon(child_changed function(snapshot) consolelog(snapshotkey()) consolelog(snapshotval()) if (snapshotkey() == state) setState(snapshotval()) )

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Now we can turn on the Led from Marshellipor from anywhere connected to internet

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Let there be a lightUsing the same principle now we can turn onoff an AC light bulb

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

AC solid state switch

To RPi2 GPIO 5

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

My Setup

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Let there be a light from App

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Architecture

Raspberry Pi 2Web app Mobile app

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Sending Telemetry

what abouthellip

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Complete Circuit

1 2 3 4

A

B

C

D

4321

D

C

B

A Title

Number RevisionSizeA4

Date 7-Oct-2015 Sheet ofFile DDYCODELayout PCBDemoddb Drawn By

Q1TRIAC

U1

OPTOTRIAC_1

R2

1K

R1

470

LAMP

AC PLUG

GPIO

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Architecture

Raspberry Pi 2 Mobile app

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Bonus AutomationTurn on light bulb automatically using a LDR

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

httpsgithubcomandriyadiFireSmartLamp

All code is here

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

as Summaryhellip

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

WELL DOCUMENTED

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Education

httpedudycodecoid | edudycodecom

a bit of adshellip

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

We contributeEducation

100+ seminars workshops trainings delivered

Delivered to 20+ communities organisations

campuses

Next could be yourshellip Just drop us a message

httpedudycodecoid | edudycodecom

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

We teach

+ + [Obj-C]

+

Education

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

Opening soonhellipEducation

+

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

httpsgithubcomandriyadiFireSmartLamp

Again all code is here

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks

DyCode wwwdycodecom

office at dycode dot com | dycode

Thanks