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 #4)
  • 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: 24 Nov 2013 8:52 AM Date Created
  • Views 681 views
  • Likes 1 like
  • Comments 4 comments
  • psoc4
  • smarter_life_challenge
  • smarter_life
  • bike_light
Related
Recommended

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

ajkahl
ajkahl
24 Nov 2013

setLED(uint8 R, uint8 G, uint8 B)


 

I've been mucking around with these guys while in search of an elegant LED solution for my light, http://www.adafruit.com/datasheets/WS2812.pdf

 

image

 

They are reasonably well known in the arduino/wearable electronics community and there's some assembler code floating about to drive them on an AVR. The reason assembler is needed is that they are a driver and RGB LED in a single package, controlled by a single manchester-esque encoded data stream, running at ~800kHz. The timings are pretty specific and the often low operating frequencies used by arduinoists just won't cut it under normal circumstances.

 

I figured the psoc4 might be an ideal platform to drive these leds, although my solutions works it could be implemented far more elegantly ie. in HDL where the encoding could be done in hardware without the resource hit, anyway it's a bit of a hack as I mainly wanted to investigate the operating voltage characteristic of the LEDs and just needed something that worked, should I end up using them I'll definitely being learning the intricacies of building verilog components in Creator... They are attractive otherwise for this project in that they would serve well for the dual-mode operation (ie. front white LED, rear RED LED), a small array of them would be light on IO - they are chained, so a single data line can drive as many LEDs as you have memory resources and refresh rate desire to serve. The downside apart from the voltage rating may be that they simply aren't bright enough.

 

image

image

 

As you can see in this grab the 3rd trace down show an encoded 0xFF, followed by a 0 byte. The timings of the LED allow for a 1.2uS period to be divided in to three 0.4uS segments, essentially representing what can be thought of in order as the start bit (1), data bit, and stop bit (0) for each bit of the 3 bytes that specify the RGB level of the LED. The frequency divider in the above circuit provides a signal for the dead time after the data stream (50uS) to allow the LED(s) to latch.

 

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

 

Here's the result. I'm not quite convinced that overall the light output is sufficient, they seem to run ok down below 3V but with some output loss, nominally they are 5V, so I think some extra power circuitry would be needed to drive them consistently throughout the discharge cycle of the battery. I'm going to continue on with some testing of more traditional LEDs and PWM, but may come back to these..

 

Anthony

  • Sign in to reply

Top Comments

  • ajkahl
    ajkahl over 12 years ago in reply to COMPACT +1
    Hi Monte, 1. Thanks yes I found project #100 with the WS281x component... after I had done this... 2. Sorry I should have mentioned the maths in the datasheet is incorrect - as pointed out here: http:…
  • ajkahl
    ajkahl over 12 years ago in reply to COMPACT

    Hi Monte,

     

    1. Thanks yes I found project #100 with the WS281x component... after I had done this...

    2. Sorry I should have mentioned the maths in the datasheet is incorrect - as pointed out here: http://learn.adafruit.com/adafruit-neopixel-uberguide/advanced-coding

     

    So the bit-wise method is within the specified tolerance.

     

    Thanks for the input

     

    Anthony

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • COMPACT
    COMPACT over 12 years ago

    Hi Anthony,

    Here's a couple of hints that may assist (or perplex) you:

    1. Did you know that the PSoC 4 already as a component for the WS281x LED protocol?

    2. Are you absolutely sure that you have interpreted the datasheet correctly with regards to the WS2812 protocol timings?

    What you have described in your blog differs to the specifications provided in the datasheet that you referred.


    Cheers

     

    Very Compact

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

    Good demo of the PSOC; this shows how you can make your own peripherals with the onboard blocks!

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

    Nice update.

     

    It looks like you have the a good handle on the LED drive.

     

    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