Sphero Light Chaser

Image by Sphero

Sphero’s newest app enabled robot ball called BOLT makes it easy to have fun and learn. BOLT has an 8×8 matrix that displays messages along with a compass to track direction, infrared sensor to gauge distance, an ambient light sensor, and much more. The robot also is easy to code with either a drag and drop Scratch-like interface or text programming.

BOLT’s ambient light sensor lets you create programs that react to varying light levels. This project lets you chase BOLT around the room with a flashlight. Use the pictures to help guide you through the steps.

Photo by Sphero

First, download the Sphero EDU app from the Apple App Store or Google Play. Open the app then click the Activities link at the top right and select Create. Fill out the Create an Activity page that appears. Next, click the Programs link at the top right and select Create. Fill out the Create a Program popup that appears.

Now to code the Sphero robot!

Add a loop forever block to the start of the program, from the Controls palette at the bottom of the app. Now from the Controls palette drag then nest an if/else block inside of the loop forever block.

Next, you need BOLT to measure the amount of light it senses. Add the luminosity sensor block to the left side of a basic comparator block. Be sure to set it to > (greater than). The number on the right is the lux value for ambient light in the room. You will need to adjust this based on the amount of light in the room.

Now you need to set the conditions for the if/else statement. Under the if, place a matrix block over the default true setting, from the Lights palette. Create or choose an animation to play when the flashlight is shined on the BOLT. Add a speed block (set to -200), from the Movements palette, and a delay block (set to 1s), from the Controls palette.

But what if BOLT doesn’t sense the flashlight? That’s what the else statement is for!

First from the Movements palette, add a stop block under else. This will stop BOLT from rolling if it stops sensing the flashlight. Add another matrix block and create a new animation. Add a spin block from the Movements palette. Set the degrees to 90 and the duration to 1s. Lastly, add one more delay block, from the Controls palette, and set it to something really short like 0.2s.

You’re all done! Place BOLT on the floor and hit START on your program. Grab a flashlight and start chasing BOLT around the room!

Photo by Sphero

Learn More

Sphero official website


Article about ambient light sensors



  • Tim Slavin

    Tim is an award-winning writer and technologist who enjoys teaching tech to non-technical people. He has many years experience with web sites and applications in business, technical, and creative roles. He and his wife have two kids, now teenagers, who are mad about video games.

Also In The December 2018 Issue

Create colourful geometric patterns in SketchUp inspired by the Great Mosque of Cordoba.

Learn how to use animated GIFs to create proper animation loops in Scratch.

Create an electronic obstacle course and test the steadiness of your hands as you navigate through.

What’s allowed in an e-mail address? Let’s break down the syntax.

Throwing your old tech in the trash is bad for the environment. Check out some safer, cleaner alternatives.

New, crafty mods that’ll push your Minecraft design skills to new levels.

Part philosophical paradox, part coding puzzle, quines are sure to tease and challenge your brain!

5 questions with the designer pushing innovation in 3D printed clothes.

All work and no play makes it harder for kids to learn, especially those with anxiety and learning disabilities.

Dive into the nuts & bolts of storing pictures and files on your computer.

A clever AI is creating twisted, surreal art. Math or magic?

Two doors hide a zonk, and one door hides a prize. Can probability & statistics help you pick the right one?

How can you tell if a credit card number is valid or invalid? Meet the Luhn algorithm, one of many checksums helping us keep the internet in order.

Learn about the Destination Dispatch algorithm and create your own robotic lift.

Grab your friends & disconnect from the digital world with these fun science & tech board games.

Interesting stories about computer science, software programming, and technology for December 2018.

Links from the bottom of all the December 2018 articles, collected in one place for you to print, share, or bookmark.

Interested but not ready to subscribe? Sign-up for our free monthly email newsletter with curated site content and a new issue email announcement that we send every two months.

No, thanks!