Ashwini kumar sinha
Created May 26, 2019 © MIT

Cellular IOT Based Health Care System And Robot Surgeon

Real time 2*7 hour health care system:- your health data like heart beat , glucose level , and any health related data can be send

IntermediateShowcase (no instructions)10 hours40
Cellular IOT Based Health Care System And Robot Surgeon

Things used in this project

Story

Read more

Schematics

untitled_sketch_2_bb_B7iLrKOprS.png

Code

heart_harvest.py

Python
#
import sys, time, requests, json, max30100

interval=5 if len(sys.argv)==1 else int(sys.argv[1])

print "Starting distance measurement! Press Ctrl+C to stop this script."
time.sleep(1)

while True:
    # Track the current time so we can loop at regular intervals
    loop_start_time = time.time()

    
    heart = mx30.read_sensor()

    if distance:
        print "oxygen and heart data " % (heart)

        # Set the HTTP request header and payload content
        headers = {"Content-Type": "application/json"}
        payload = {"heart ": round(heart * 10) / 10 }

        # Send the HTTP request to Harvest
        print "Sending data %s to Harvest..." % (json.dumps(payload))
        try:
            response = requests.post("http://unified.soracom.io", data=json.dumps(payload), headers=headers, timeout=5)
        except requests.exceptions.ConnectTimeout:
            print "Error: Connection timeout. Is the modem connected?"

        # Display HTTP request response
        if response.status_code == 201:
            print "Response 201: Success!"
        elif response.status_code == 400:
            print "Error 400: Harvest did not accept the data. Is Harvest enabled?"
            sys.exit(1)

        print 


    # sleep until next loop
    time_to_wait = loop_start_time + interval - time.time()
    if time_to_wait > 0:
        time.sleep(time_to_wait)

robothandmovharvest.py

Python
#
import sys, time, requests, json, mpu6050

interval=5 if len(sys.argv)==1 else int(sys.argv[1])

print "Starting distance measurement! Press Ctrl+C to stop this script."
time.sleep(1)

while True:
    # Track the current time so we can loop at regular intervals
    loop_start_time = time.time()

    
    accelerometer_data = sensor.get_accel_data()
    if accelerometer:
        print "oxygen and heart data " % (heart)

        # Set the HTTP request header and payload content
        headers = {"Content-Type": "application/json"}
        payload = {"heart ": round(accelerometer_data * 10) / 10 }

        # Send the HTTP request to Harvest
        print "Sending data %s to Harvest..." % (json.dumps(payload))
        try:
            response = requests.post("http://unified.soracom.io", data=json.dumps(payload), headers=headers, timeout=5)
        except requests.exceptions.ConnectTimeout:
            print "Error: Connection timeout. Is the modem connected?"

        # Display HTTP request response
        if response.status_code == 201:
            print "Response 201: Success!"
        elif response.status_code == 400:
            print "Error 400: Harvest did not accept the data. Is Harvest enabled?"
            sys.exit(1)

        print 


    # sleep until next loop
    time_to_wait = loop_start_time + interval - time.time()
    if time_to_wait > 0:
        time.sleep(time_to_wait)

Credits

Ashwini kumar sinha

Ashwini kumar sinha

29 projects • 71 followers
Ashwini kumar sinha a Robotic lover and electronics hobbyist. Works at EFY-I

Comments