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
  • 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
Smarter Life
  • Challenges & Projects
  • Design Challenges
  • Smarter Life
  • More
  • Cancel
Smarter Life
Blog Smarter Life Challenge: Smart Bicycle Light (update #8)
  • Blog
  • Forum
  • Documents
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ajkahl
  • Date Created: 10 Jan 2014 11:32 AM Date Created
  • Views 1161 views
  • Likes 1 like
  • Comments 4 comments
  • psoc4
  • smarter_life_challenge
  • smarter_life
  • bike_light
Related
Recommended

Smarter Life Challenge: Smart Bicycle Light (update #8)

ajkahl
ajkahl
10 Jan 2014

It's been a while since my last update, I've taken a little break over new year, I did however find some time to write some code. It's pretty much all done bar managing the charging state and some power saving. I've taken my time to do this properly with a clean HPL layer and enough abstraction to make tuning easy.


 

 

The video shows a few different things, first the light coming on in vertical (rear light) mode after some 'movement'. Then it turns off after a timeout, with the lamp simulating daylight the light doesn't come on when it is shaken, similarly the leds would turn off under this light if they were already on. The second part shows the change in primary colour when the PCA is rotated 90 degrees, this is the orientation the light would be if it were mounted on the handlebars of the bike so it flashes white instead of red, there is a fair amount of hysteresis in this, I also use activity on the Z (longitudinal) axis to lock this function out so the are no ugly looking errant changes in mode. The third part shows the double-tap gesture to cycle between a number of flashing modes, there are quite a few, I think I'll cull them down to three or four in the end. There are other flashing modes for the 'front mounted' mode as well not shown in the vid, and of course in both cases the last flash mode is re-called when the light turns on or orientation is changed (a simple oversight you'll find in many flashing bike lights on the market). All of the motion sensing is triggered with a hard-wired interrupt from the ADXL345 running in a low-power, low-bandwidth mode, this way I'm making use of a bunch of it's internal sensing features and allowing for a lower duty cycle (read more sleep) in the PSoC.

 

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

For the purposes of the video I've overridden the hall sensor, so it is behaving as if it were mounted on the bike.

 

I've also shortened the timeouts to about 3 seconds, in production code these would be more like 60-100 seconds. In testing I've come across an interesting tuning dilemma, as a user I would probably find it acceptable for the light to come on for say 30 seconds in a dark room if the bike were 'bumped' but not for longer than that (meaning it's easy to turn on, and the timeout would likely be refreshing if say waiting at a stop light). On the flip side if the motion was severely 'de-bounced' as it were I would probably find it ok if the light took up to 20 seconds of movement to come on and then stayed on for longer than in the previous case (say long enough for a red light). Certainly the middle ground between these two scenarios wouldn't be acceptable, I think the answer is a hybrid of long de-bouncing to turn the light on initially, then have the timeout refresh more sensitive once the light is on. Some real world testing will reveal the balance pretty quickly I think.

 

The last stage of this project is to tick off the USB charging logic and run the stand-alone version of the dev board from the battery.

  • Sign in to reply
  • ajkahl
    ajkahl over 11 years ago in reply to vsluiter

    Hi Victor, thanks. There are also some other subtleties that I haven't demo'd that well, I'll endeavor show these a bit better once I've done the battery handling.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ajkahl
    ajkahl over 11 years ago in reply to DAB

    Thanks, the brightness is an important spec (too bright is as bad as too dim on my mind). Fortunately these LEDs are about right, I'll be able to further tune the spread/lux.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • vsluiter
    vsluiter over 11 years ago

    Very cool demo.

    You certainly made a simple user interface, just as you intended. I think the smartest stuff are the orientation sensing to switch between front or back, and the 'remember last mode'. This demo was not technically the most advanced, but made me badly want to buy a finished product image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 11 years ago

    Hi Anthony,

     

    Good update.

    Those LEDs are certainly bright enough for anyone to see you from a good distance away.

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • 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 © 2025 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