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
      •  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 – Someone Behind You Sensor - PART 2 - LED Indication
  • 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: 19 Aug 2018 11:35 PM Date Created
  • Views 1317 views
  • Likes 4 likes
  • Comments 1 comment
  • micro:bit
  • project
  • advanced micro:bit projects
  • micro:bit project
  • microbit projects
  • microbit
  • advanced_microbit_projects
  • motion
  • cabeatwell
  • learning
  • stem projects
  • sensor
Related
Recommended

[PROJECT] BBC Micro:bit – Someone Behind You Sensor - PART 2 - LED Indication

Catwell
Catwell
19 Aug 2018

This is Part 2 of the Micro:bit version of the someone behind you sensor.

 

For those who did part 1, this one adds an addressable LEDs to indicate when the PIR motion sensor is triggered. It also has a secondary nightlight mode that turns on the LED strip for approximately 60 seconds.

 

This project is a complete system. So, you do not have to go and build Part 1 if you do not want to.

 

 

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

1x BBC Micro:bit

1x Kitronik Inventor’s Kit

1x PIR Sensor Module

Project Wires Female - Male (aka jumper wires)

1x Addressable LED Strip, I used 30 of the LEDs

9V Power Supply

5V Power Supply with a MicroUSB cable

Construction Paper!

 

If you already have Part 1 done, skip to STEP 6. If not... continue one directly.

 

STEP 1

Lay the Micro:bit and Kitronik Inventor’s Kit on a table. Insert the edge-card end of the Micro:bit into the Inventor’s Kit socket.

imageimage

 

 

STEP 2

Prepare the 9V power supply. I used a 9V power supply from an old device, I think a router. But, there are better versions you could use. Like the one here at element14. You will have to splice the ends into some project wires.

 

I sliced the 9V positive to the LED strip’s positive voltage line. I am using this separate power supply to drive the power hungry LED strip directly. If you don’t do this, you project is going to get really hot, and eventually destroy itself.

imageimage

 

STEP 3

Wire up the PIR sensor, as shown in the picture. I used colors to indicate power (RED), ground (BLACK), and the signal (BLUE).

imageimage

 

STEP 4

Attach the PIR sensor’s GND wire to one of the Kitronik Inventor’s Kit breakout pins labeled 0V, that’s a ground. Connect the signal line to the pin labeled P0. This is an analog input.

Follow the schematic below:

image

 

Connect the PIR Sensor's signal line to pin A0 on the breakout board.

image

 

 

STEP 5

Connect the 9V power supply’s positive leads to the PIR sensor directly. Then plug the 9V power supply’s ground to another of the Kitronik Inventor’s Kit 0V grounds. To complete a circuit like this, you must share grounds between the power supplies.

A side note: Why do we need to do this? The PIR sensor needs an input voltage of between 5V and 20V, the Micro:bit can only provide a 3.3V source to external devices. Also, Part 2 of the project has addressable LEDs, and we will need a beefy power supply for those.

 

Attach the 9V positive power to the PIR Sensor directly:

image

 

Connect the 9V power supply ground, negative, to the 0V pin on the Inventor's Kit breakout board.

image

 

STEP 6

Attach the LED strip’s GND to another 0V pin on the Kitronik’s breakout board. Then connect the CLOCK line (yellow) to PIN 13 on the breakout board. And connect the DATA line to pin 15 on the breakout board.

 

imageimage

 

STEP 7 (Optional)

Roll some construction paper into a tube big enough to house the PIR sensor. Point the white dome of the PIR sensor towards one end of the tube. What this is doing is narrowing the field of view for the PIR sensor. You could leave the PIR sensor outside of the tube, sure, but it has a near 180-degree field of vision. You’ll be triggering it with anyone moving in half the room!

 

imageimage

imageimage

 

 

STEP 8

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 posts that needs to be copied over.

I had to pack it up in a ZIP file called PART 2 Microbit motion project.zip. Unzip it. The file you need is called "PART 2 Microbit motion project.hex"

 

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, "PART 2 Microbit motion project.hex," over to the Micro:bit, like it’s a USB Flash Drive.

The Micro:bit will reset, and the program is active.

 

You could leave it plugged into your computer, or use that 5V USB power adapter to make the project a bit more mobile.

 

 

STEP 9

Test it.

 

It should look like the following. The first half is the multicolor fading. The second part is the nightlight mode.

 

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

 

 

 

Applications of this project are left to your imagination.

 

See Part 1 here.

Attachments:
PART 2 Microbit motion project.zip
  • Sign in to reply
  • genebren
    genebren over 7 years ago

    Nice little project.  PIR sensors are pretty cool devices.  I have worked with multiple PIR sensors and recently built one from scratch for a client that wanted tight integration of the sensor into a single board solution.  I was happy to find available detectors and lenses for under $4.00 in low volumes.  These coupled with an amplifier and microcontroller (already being used in other parts of the design) and you have flexible and programmable PIR detector.

     

    Gene

    • 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