Salah Uddin
Published © MIT

Amazon Smart Medicine Dash Box

The smart medicine dash box allows user to visualize the contents of the medicine in real time (via mobile apps) and notifies when low.

IntermediateFull instructions provided8 hours1,850
Amazon Smart Medicine Dash Box

Things used in this project

Hardware components

Android device
Android device
×1
Seeed Studio Grove - Infrared Reflective Sensor
×4

Software apps and online services

Thinger.io Platform
Thinger.io Platform

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Schematics

Circuit Diagram

Code

Frimware for linkit Smart Dou

Arduino
/*
The Amazon_smart Medicine Dash source code for linkit smart Dou 
  author: Salah Uddin
  email:  akash.bangla@gmail.com
  last update : Feb 24, 2017
*/

#include <YunClient.h>
#include <ThingerYun.h>

//thinger.io credential
#define USERNAME "YOUR USER NAME" 
#define DEVICE_ID "YOUR DEVICE NAME"      
#define DEVICE_CREDENTIAL "YOUR CREDENTIAL"

//intialize the thinger.io
ThingerYun thing(USERNAME, DEVICE_ID, DEVICE_CREDENTIAL);
const int ledPin =  13;

// sensor pin declaration
int ir01 = 8;
int ir02 = 9;
int  ir03 = 10;
int ir04 = 11;

//for counting purpose
int count = 0; 

void setup() {
  pinMode(ledPin, OUTPUT);
  // make the sensors pin an input:
  pinMode(ir01, INPUT);
  pinMode(ir02, INPUT);
  pinMode(ir03, INPUT);
  pinMode(ir04, INPUT);

  // initialize bridge
  Bridge.begin();

 // pin control example (i.e. turning on/off a light, a relay, etc)
 //push data to the cloud
  thing["led"] << digitalPin(ledPin);
  thing["count"] >> outputValue(count);
}

void loop() {
  thing.handle();
  count = digitalRead(ir01)+digitalRead(ir02)+digitalRead(ir03)+digitalRead(ir04);
  
}

Credits

Salah Uddin

Salah Uddin

44 projects • 148 followers
Technology and IoT Hacker, Robot Killer and Drone lover.

Comments