Giter VIP home page Giter VIP logo

esproomba's Introduction

ESPRoomba

Inspired by cybrox's implementation using ESP32 as a Roomba controller. Instead of using ESP32 as a dedicated webserver, the ESP32 is made into a CoAP server that any CoAP client can subscribe to (one possibility is to use a nodeJS server as a CoAP client).

Hardware

  1. ESP32 DevKitC
  2. Switching (step-down) Regulator
  3. Bi-Directional Level Converterr
  4. Terminal blocks
  5. Switch

Circuit Connections

  • The Pololu step-down regulator has 5 pins. For this exercise, only 3 pins were used. IN is connected to the unregulated battery of the robot, GND is connected to the GND of the robot and OUT is connected to DevKitC's 5V pin.
  • Instead of using a 3.3V step-down regulator, a 5V version is used instead. This is to allow the level converter to use the same 5V input to the DevKitC as reference voltage (high side).
  • A simple voltage divider can also be used to bring down the UART RX to less than 5V (ESP32 is not 5V tolerant) but a level converter is used instead.
  • IO16 and IO17 are used as UART RX and TX respectively. IO18 is used to pulse the BRC pin low (not fully tested if working).
  • IO16 is connected to Roomba TXD pin (through level converter) and IO17 to Roomba RXD.
  • The 5V and 3.3V pins are used as reference voltages for the high and low sides of the level converter.

CoAP Endpoints

  1. /sc -> for simple commands
    • /sc?mode=start -> put into passive mode
    • /sc?mode=safe -> safe mode
    • /sc?mode=full -> full mode
    • /sc?clean=clean -> send clean opcode
    • /sc?clean=max -> send max opcode
    • /sc?clean=dock -> send seek and dock opcode
    • /sc?clean=spot -> send spot opcode
  2. /sked -> send schedule to Roomba
    • use payload option here in JSON format; days are three letter words (mon, tue, wed, thu, fri, sat, sun), hour under hr key and minute in mn key
    {
       mon: {
         hr: 12,
         mn: 45
       },
       fri: {
         hr: 13,
         mn: 00
       }
     }
    
  3. /obs -> subscribe to Roomba sensors, data is sent every 15ms.
  4. /drive -> to drive left and right wheels using PWM which are sent as payload with the format ${int leftSpeed},${int rightSpeed}

To Do's

  • Make commands handling simpler
  • Add actuator handlers
  • Add simple circuit diagram for connections
  • Implement multicast for CoAP (?)

esproomba's People

Contributors

jayveeangeles avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.