Giter Club home page Giter Club logo

mj808's Introduction

keywords:

Magicshine, bicycle front light, MJ808, MJ-808, MJ818, MJ-818, bicycle rear light, CAN bus, MCP2515, MCP2561

0. this all is still under development

front and rear lamps do work together and can be used on a bike. logic unit and auxiliary devices are still WIP.

1. abstract:

this undertaking is an attempt to redesign the MJ808/MJ818 lights by:

  • designing a custom PCB w. driver/controller ICs,
  • writing firmware the above controller IC,
  • encapsulating the above in MJ808's/MJ818's original housing,
  • combining:
  • the rear light (MJ818),
  • the front light (MJ808) and
  • a control unit into an interconnected smart bicycle light system.
  • developing further auxiliary devices which extend functionality of the lights.

2. light system topology (in ascii art)

== and || denote the CAN bus, power lines are omitted.

2.1 - current working setup

front and rear lights are interconnected via the CAN bus; the front light activates the rear light.

(front light) - (rear light)
------------------------------------------------
(mj808) ======  (mj818)

2.2 - WIP setup

front and rear lights are extended in their functionality by other auxiliary devices interconnected via the CAN bus

(front light) - (control unit) - (rear light)
------------------------------------------------
(mj808) ====== (control unit)  ====== (mj818)
                  ||		||
                  ||		||		
                  ||	(future device(s))
                (dynamo)

3. description of the original light

google magicshine mj-818 / magicshine mj-808 for an idea what the lights are and look like.

these are decent made-in-china bicycle lights operated off a 2S2P Li-Lion battery pack.

their functionality, apart from producing light, sucks.

4. motivation

operating mode selection, strobing and high power consumption on the original lights is what i would like to have different.

the only reasonable way to achieve this is to start from scratch.

5. required software for building

  • eagle for PCB layout & schematics,
  • atmel studio (or keil) for the code,
  • atmel ICE or something similar,
  • some cheapo arduino for quick and dirty CAN testing (the arduino acts as an improvised control unit) and
  • SMD soldering equipment and skills.

6. repo structure

  • /datasheets/: contains what the name suggests,
  • /dwg/: AutoCAD drawings & STLs of various sub-components,
  • /eagle designs/: contains subfolders with eagle designs (.brd, .sch & BOMs) of various sub-components
    • cos/: a dynamo thing, WIP,
    • mj808/: the front light,
    • mj818/: the rear light,
    • mj828/: a small handlebar mounted UI (nothing fancy), WIP and
    • drawings for the atmel ICE <-> light PCB programming adapter.
  • /eagle libraries/: contains eagle libraries of electical components used.
  • /gerber/: gerber files for PCB production,
  • /MJ808/: C source code for everything.

7. hardware

look in /datasheets/ for a complete lists of used hardware.

core components:

when chosing components the primary criterium was size, since everything needed to fit into existing housings. maximizing light output to the extreme was not a design factor.

8. software

8.1 general overview

the language of choice is C, written in an object-oriented fashion:

  • common core components translate into an abstract base class (implemented via C-structs),
  • concrete implementations (e.g. mj808 ) translate into derived classes (again C-structs),
  • methods are generally implemented via function pointers (e.g. CAN driver message operations),
  • behaviour is sometimes achieved with OO interfaces,
  • polymorphism is implemented manually via constructors (ctor in mj808_t) and
  • information is hidden by nesting C-structs and placing them into either .c or .h files.

due to memory limitations there are only hints of SOLID and design patterns to be found.

code is commented in a reasonable manner.

8.2 detailed description

TODO

mj808's People

Contributors

ejovrh avatar

Watchers

 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.