dark mode light mode Search Menu
Search

Sphero Light Chaser

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

https://www.sphero.com/

Article about ambient light sensors

https://www.eetimes.com/document.asp?doc_id=1302779