element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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 Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • 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
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • 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
microbit
  • Learn
  • Learning Center
  • STEM Academy
  • microbit
  • More
  • Cancel
microbit
micro:bit Blog [PROJECT] BBC Micro:bit – Ten LED PWM controller – version 1 by Cabe
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join microbit to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Catwell
  • Date Created: 3 Sep 2019 2:27 AM Date Created
  • Views 4650 views
  • Likes 7 likes
  • Comments 5 comments
  • project
  • pwm
  • microbit
  • diy
  • led
  • light show
  • cabeatwell
Related
Recommended

[PROJECT] BBC Micro:bit – Ten LED PWM controller – version 1 by Cabe

Catwell
Catwell
3 Sep 2019

image

The complete and running 10-LED PWM Controller. A messy rat's nest of project wires on this project. It was unavoidable, unfortunately. (Images & video via me.)

 

 

Driving three LEDs was a good start. The real goal is to control a lot of them. My next step on this mission is controlling ten LEDs. I did do it, technically. However, I lost one key functionality, recording the sequences. The issue came down to insufficient memory for storage.

 

However, I was able to control the LEDs with a PWM signal from a 16 Channel 12 Bit PWM Servo Driver board. The project turned into a way to set the PWM range, apply it to the LEDs, and activate each one individually.

  

The software works as follows:

- Power it up.

- It will be in “play” mode, showing a big triangle on the LED screen.

- Press any button to activate individual LEDs.

- Press the “B” button to enter the “calibrate” mode. It will display alternating capital letter “C” and lowercase “c” on the screen.

- In calibrate mode. Move the potentiometer as low as it can go, then as high as it can go. This will set the range that control the flashing speed of the LEDs.

- Press the “A” button to enter the “set” mode. Press a button to light up an LED, and it will fade in and out each LED repeatedly. Then, adjust the potentiometer to change the speed at which it flashes.

 

First, let’s gather all the necessary components you’ll need to build this project.

1x BBC Micro:bit

1x Kitronik Inventor’s Kit

1x Half-Breadboards

1x 16 Channel 12 Bit PWM Servo Driver

10x LEDs of your choice

10x 430ohm Resistors

Project Wires Female - Male

1x 370k Potentiometer (A 500k ohm potentiometer works too.)

1x 10k ohm resistor

1x 5v 2A power supply

 

Video demonstration of the project:

 

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

 

STEP 1

Load the code onto the Micro:bit.

I am providing the hex file you need to drag and drop onto the Micro:bit, and the python code as two separate files. For the below process, just use the hex file.

Plug the MicroUSB cable into the Micro:bit, and plug the other end of the cable to a PC or MAC.

At this point, you are going to copy over the code to the Micro:bit. I am providing the program (code) in this post that needs to be copied over. When the Micro:bit plugs into a computer, it shows up as a USB flash drive. All you have to do is copy the file over to the Micro:bit, like it’s a USB Flash Drive, and the Micro:bit will reset, and the program is active.

You can remove the Micro:bit from the computer at this point. The program will start running, and without the rest of the circuit, it will not function.

●

A little bit about the code:

Here is an odd issue I had with this code. It would not compile with comments!

So, I am including a commented version of the code with the zip file!

 

 

STEP 2

The schematic is fairly straight forward. Wire it up like the drawing. I used a breadboard for the external LEDs and potentiometer.

image

 

STEP 3

Setup

The software works as follows:

- Power it up.

- It will be in “play” mode, showing a big triangle on the LED screen.

- Press any button to activate individual LEDs.

- Press the “B” button to enter the “calibrate” mode. It will display alternating capital letter “C” and lowercase “c” on the screen.

- In calibrate mode. Move the potentiometer as low as it can go, then as high as it can go. This will set the range that controls the flashing speed of the LEDs.

- Press the “A” button to enter the “set” mode. Press a button to light up an LED, and it will fade in and out each LED repeatedly. Then, adjust the potentiometer to change the speed at which is flashes.

 

Conclusion:

This did not turn out exactly as I planned. But, controlling the LEDs with a PWM board does have its merits. I think I may try to use addressable LEDs in the same way. Hopefully, I can figure out a way to store sequences again!

 

Have a story tip? Message me at: cabe(at)element14(dot)com

http://twitter.com/Cabe_Atwell

Attachments:
Microbit 2019 8 31 2019 sequencer 10 leds Cabe Atwell.zip
  • Sign in to reply

Top Comments

  • Catwell
    Catwell over 6 years ago in reply to balearicdynamics +1
    Enrico, It's true. But, I just wanted to do a uniform pairing down the line. Blue LEDs, not used in the setup, were just too dim that way. C
  • balearicdynamics
    balearicdynamics over 6 years ago in reply to Catwell +1
    Cabe, I see. Somewhere I found the values of the correct resistors for different standard colors LEDs just to have the same response with PWM. https://www.evilmadscientist.com/2012/resistors-for-leds/…
  • clem57
    clem57 over 6 years ago +1
    Great little project for the BBC Micro:bit computer.
Parents
  • genebren
    genebren over 6 years ago

    Fun little project. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • genebren
    genebren over 6 years ago

    Fun little project. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
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