Coder Social home page Coder Social logo

smartlock's Introduction

SmartLock

概要

スマートロックを自作する。

要件

UI

  • 解錠・解錠方法(外)
    • BLEビーコンの検知
    • 物理鍵
  • 解錠・施錠方法(内)
    • 物理ボタン
  • 在室判定
    • 物理ボタン

機能

  • BLEビーコンの電波強度検出
  • サーボモータ操作によるサムターン操作
  • FETのスイッチングによるサーボモータの電源操作
  • 物理ボタン(トグルスイッチ)の検出
  • 電池駆動
  • 電池取り換え可能

詳細設計

ソフトウェアアーキテクチャ

@startuml
class Servo{
    int pin
    float last_input
    bool power_on
    bool move(const float input_degree)
    bool on()
    bool off()
    float getLastInputDegree() const
    bool getPowerState() const
}

class Lock{
    Servo servo
    bool locked
    const float kLockDegree
    const float kUnlockDegree
    bool unlock()
    bool lock()
    }

class SmartLockManager{
    Lock lock
    Toggle toggle
    BleTag tag
    mode update()
}

class Toggle{
    bool last_state
    int pin
    bool update()
    bool getState() const
}

class BleTag{
    bool last_state
    bool update()
    bool getState() const
}

SmartLockManager --|> Lock
SmartLockManager --|> Toggle
SmartLockManager --|> BleTag
Lock --|> Servo
@enduml

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.