Things used in this project

Hardware components:
Nova icon lijwm6pmk7
Hologram Nova
×1
Pi 3 02
Raspberry Pi 3 Model B
×1
Grove pi 02 1024x644
Dexter Industries GrovePi
×1
10167 01
DHT22 Temperature Sensor
×1
SeeedStudio Grove Air Quality Sensor
×1
SeeedStudio Grove Touch Sensor
×1
Hologram%20dash
Hologram Global IoT SIM Card
×1
Software apps and online services:
Avatar light%402x
Hologram Data Router
Q8wtlimqnp04fzhtr9v5
IFTTT Maker service
Po2geept51ocefbcdmej
IFTTT Hue service

Schematics

Circuit using the Grove Pi
Here are the sensor connection to the Grove Pi
-Air Quality sensor connected to A0
-DHT22 connected to D4
-Touch sensor connected to D2
Circuit ko9jbew5bb

Code

sendSensorData.pyPython
#Created to demo the Home Monitoring system for the elderly - using Hologram Nova
#This code is based on -
# Hologram sample code -https://hologram.io/docs/reference/cloud/python-sdk/
# and sample code for the Grove sensors - https://github.com/DexterInd/GrovePi/tree/master/Software/Python
import grovepi
import time
import math
import sys
from Hologram.HologramCloud import HologramCloud

#Update your Holgram device key
credentials = {'devicekey': 'XXXXXXXXXXXXXXXX'}
hologram = HologramCloud(credentials, network='cellular')
# Connect the Grove Temperature & Humidity Sensor Pro to digital port D4
sensorDHT22 = 4
# Connect the Grove Air Quality Sensor to analog port A0
air_sensor = 0
grovepi.pinMode(air_sensor,"INPUT")
# Connect the Grove Touch Sensor to digital port D2
touch_sensor = 2

grovepi.pinMode(touch_sensor,"INPUT")
# temp_humidity_sensor_type
# Grove Base Kit comes with the blue sensor.
blue = 0    # The Blue colored sensor.
white = 1   # The White colored sensor.

def send_messages(messages):
    if len(messages) < 1:
        return
    result = hologram.network.connect()
    if result == False:
        print ' Failed to connect to cell network'
    for message in messages:
        response_code = hologram.sendMessage(message)
        print('{} : {}'.format(hologram.getResultString(response_code), message))
    hologram.network.disconnect()

while True:
    try:
        print(grovepi.digitalRead(touch_sensor))
        time.sleep(1)
        if grovepi.digitalRead(touch_sensor) == 1:
           print("touch sensor hit..")
        # This example uses the blue colored sensor.
        # The first parameter is the port, the second parameter is the type of sensor.
           [temp,humidity] = grovepi.dht(sensorDHT22,white)
           if math.isnan(temp) == False and math.isnan(humidity) == False:
               print("temp = %.02f C humidity =%.02f%%"%(temp, humidity))
        # Get sensor value
           sensor_value = grovepi.analogRead(air_sensor)
           if sensor_value > 700:
               print ("High pollution")
           elif sensor_value > 300:
               print ("Low pollution")
           else:
               print ("Air fresh")
           print("sensor_value =", sensor_value)
           #msgSend = ' {} {} {}'.format(str(temp), str(humidity), str(sensor_value))
           #send_messages(msgSend);
       result = hologram.network.connect()
	   if result == False:
		print ' Failed to connect to cell network'
	   else:
		response_code = hologram.sendMessage(str(temp),topics=['SensorVal'])
		print("Message sent to Hologram..")
	   hologram.network.disconnect()
	   time.sleep(.5)

    except IOError:
        print ("Error")

Credits

  ?auto=compress%2cformat&w=60&h=60&fit=min
CJA3D
9 projects β€’ 52 followers
Tinkerer and 3D Printing enthusiast.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login