element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Smart Security and Surveillance
  • Challenges & Projects
  • Design Challenges
  • Smart Security and Surveillance
  • More
  • Cancel
Smart Security and Surveillance
Forum Sentinel Box - Part V - Concept vs Perfect Build
  • News
  • Projects
  • Forum
  • DC
  • Leaderboard
  • Files
  • Members
  • More
  • Cancel
  • New
Join Smart Security and Surveillance to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 1 reply
  • Subscribers 50 subscribers
  • Views 83 views
  • Users 0 members are here
  • bluetooth
  • security-challenge
  • lit
  • vite
  • REACT
  • javascript
  • MAX32630FTHR#
Related

Sentinel Box - Part V - Concept vs Perfect Build

saramic
saramic 13 days ago

The competition ends tomorrow and I have fallen in a heap a week ago. I need to re-group on what I can achieve with my abilities, and be content with that. It will not be the perfect build I was hoping for, it may only partly touch on the concept I am aiming for, but such is life.

Recap

The idea is to build a smart lock box for digital devices to help control digital addiction, more on the idea can be found in part I and coding with LPSDK and accessing a fingerprint scanner in part II, and mechanical stepper motors and vault lock mechanisms in part III and Bluetooth and BTStack in part IV:

  • Sentinel Box - Part I - the plan
  • Sentinel Box - Part II - back to C
  • Sentinel Box - Part III - Stepper Motor and Vault lock mechanism
  • Sentinel Box - Part IV - Bluetooth and BTStack

Perfect Build

Looking back honestly, I have learnt an enormous amount across this challenge. I attempted a fully hermetic Rust build, maybe next time. I did, with the help of the amazing Element 14 community, get to successfully drive a stepper motor, fingerprint scanner and connected Bluetooth all for the first time. My final piece was a vault mechanism that look great in initial previews and I was genuinely excited about completing.

The perspex work is where the gap between concept and reality opened up. Precision mechanical assembly requires tolerance, and I underestimated it badly. Only today I had been watching Clickspring’s extraordinary series on building an Antikythera mechanism (YouTube) and there is something humbling about watching someone fit-and-file a part to within a tenth of a millimetre with hand tools. My lock mechanism needed that same care. It did not get it. I cut fast, missed a few steps and thought it better try when I had the right tools and patience to actually get it right and build a mechanism that was “square”, worked and worthy of display.

image

The final week did not help. A hectic schedule, a weekend away from home and tools. Even though I was excited about the mechanical build, the perspex was not as forgiving as re-burning a new build onto the MAX32630FTHR.

What I did get started on is expanding the Bluetooth communications layer with the browser. As the theoretical setup would need stepper motor setting, reading a number of finger prints and setting up a consensus framework for who can co-operatively open the lock box, doing this via a web site seemed the way to go. The foundation is super sound:

  • React 19 for a modern frontend
  • Lit 3 hybrid with the React to allow for a custom web component (<sentinel-ble-manager>)
  • shadcn + Radix UI + Tailwind CSS for styling
  • Vite 8 as the build

The part I am most pleased with is that the browser and the firmware speak exactly the same binary protocol. The MAX32630FTHR stores its config in a 100-byte block in INFO flash, and the web console encodes and decodes the identical layout — offsets and all — using DataView and Uint8Array:

view.setUint16(0x00, CONFIG_MAGIC, true)   // magic  0x5B5A ("SB" LE)
view.setUint16(0x02, cfg.vaultSteps, true) // vault_steps
buf[0x04] = enrolledCount                  // fp_count
buf[0x05] = cfg.unlockPolicy               // unlock_policy
buf[0x06] = cfg.relockMinutes              // relock_minutes
// fp_name[10]: 8 bytes each starting at 0x08
// fp_role[10]: 1 byte each starting at 0x58
view.setUint16(CRC_OFFSET, crc, true)      // CRC-16/CCITT over bytes 0x00–0x61

To make sure nothing gets corrupted in transit the browser runs the same CRC-16/CCITT the firmware uses, so a tampered or truncated blob is caught at both ends:

export function crc16(data: Uint8Array): number {
  let crc = 0xffff
  for (const byte of data) {
    crc ^= byte << 8
    for (let i = 0; i < 8; i++) {
      crc = crc & 0x8000 ? ((crc << 1) ^ 0x1021) & 0xffff : (crc << 1) & 0xffff
    }
  }
  return crc
}

It is not the kind of JavaScript you write every day, but it is satisfying when the numbers match on both sides of the BLE link.

image

So the build is not what I imagined. The vault door is not ready, the full orchestration of fingerprint plus Bluetooth plus stepper motor is het to run end-to-end. But the pieces exist. The concept holds. I know now exactly which joints need filing to tolerance and which parts of the stack are solid. That is not failure, that is a prototype.

Next

Well it’s crunch time, next step the full write up at Sentinel box: consensus based lock box.

Source

https://github.com/saramic/sentinel-box

  • Sign in to reply
  • Cancel
  • DAB
    DAB 13 days ago

    Nice update.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube