Skip to content

sak007/SmartJar

Repository files navigation

SmartJar

License: MIT version DOI

Telegram Platform Protocol

GitHub issues GitHub closed issues Github pull requests Github closed pull requests

Setup Instructions

Hardware Setup

What You’ll Need For This Project

  1. Jar with a non-conductive body and a conductive lid
  2. 5 Kg Load Cell - Used in the scale to measure load
  3. SparkFun Load Cell Amplifier - Amplifies the load cell signal and communicates with the Pi
  4. 2 Wooden Plates for the Scale - Connect with the load cell to produce a scale
  5. 2 5V 50N Hold Strength Magnets - Holds the jar lid in contact with the jar when powered
  6. 5V Power Adaptor - Powers the magnets through the relay
  7. Relay - Controlled by Pi to connect 5V supply to the magnets
  8. Raspberry Pi
  9. Aluminum Foil and Wire Contact sensors for the Lid on Jar and Jar on Scale
  10. Alarm/LED - Activated by Pi when the lid is forcibly opened or the child took more than the approved quantity.

BOM

  1. Jar - link
  2. Alamscn 5 Kg Load Cell - link
  3. SparkFun HX711 Load Cell Amplifier - link
  4. 50N 5V Magnet - link
  5. 5V Power DC Power Adaptor - link
  6. KeeYees Relay - link

Alternates:

  1. 250N 24V Magnet - link
  2. 24V DC Power Adaptor - link

Schematic

image

Software Setup

Bot

  • Create an account in IBM Watson IoT platform and register your device (ibmcloudpi).

  • Generate api_token for bot.

    • Download and install the Telegram mobile application or desktop application for your system from the following site: https://desktop.telegram.org/
    • Once you login to your Telegram account, search for "BotFather" in Telegram. Click on "Start" --> enter the following command: /newbot
    • Follow the instructions on screen and choose a name for your bot. Post this, select a username for your bot that ends with "bot" (as per the instructions on your Telegram screen)
    • BotFather will now confirm the creation of your bot and provide a TOKEN to access the HTTP API - copy this token.
  • Update the api_token in properties.json

  • Update Device info in properties.json

  • Add orgId, typeId, deviceId and token in device.yaml

  • Add appId, key and token in application.yaml

  • Run bash setup.sh or ./setup.sh to install prerequisites.

  • For Windows, follow this link to install wkhtmltopdf.

  • Run bash startBot.sh or ./startBot.sh from root directory to start the bot.

Jar

  • Update Device info in properties.json
  • Add orgId, typeId, deviceId and token in device.yaml
  • Run bash setup.sh or ./setup.sh to install prerequisites.
  • For Windows, follow this link to install wkhtmltopdf.
  • Run bash startJar.sh or ./startJar.sh from root directory to start the jar.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •