Skip to main content
Help centerContent

Play a playlist when someone comes near

Plug a USB motion sensor into the player and choose what plays when someone stands in front of the screen.

With a small motion sensor plugged into the player, a screen can switch to a chosen playlist when someone walks up to it, then go back to its normal content when they leave. It suits a product display, a shop window or a reception desk.

How it works

The sensor plugs into a USB port on the player and acts like a keyboard. When it sees movement, it presses the F12 key, and keeps pressing it about once a second while the movement lasts. The CastWize player listens for that key. Nothing is sent over the internet to start playback, so the switch is immediate.

Any USB device that sends F12 when it detects someone will work. The sensor we use is a Raspberry Pi Pico board with a small PIR motion sensor, described below. It works with the Android, Windows, Mac, Linux and Raspberry Pi players.

What you need

  • A Raspberry Pi Pico (Pico H, with pins already fitted, is easiest) and a USB cable for it.
  • A mini PIR motion sensor with three pins: VCC, GND and OUT.
  • Three jumper wires.
  • A player running a recent CastWize Player version. Studio warns you on the screen's settings if the player is too old to use the sensor.

Steps: build the sensor

  1. Wire the sensor to the Pico. Follow the labels printed on your sensor, as the pin order can differ:
    • Sensor VCC to Pico pin 36, 3V3(OUT).
    • Sensor GND to Pico pin 38, GND.
    • Sensor OUT to Pico pin 20, GP15.
    Don't use pin 40 (VBUS, 5 V) or pin 37 (3V3_EN).
  2. Install CircuitPython on the Pico, then copy the CastWize sensor program onto it as code.py. Email [email protected] for the program file.
  3. Test it: plug the Pico into USB power, wave at the sensor and watch the Pico's green light. It lights up while the sensor sees movement. Give the sensor a few seconds after power-up first.

Steps: set up the screen

  1. Plug the sensor into a USB port on the player and point it at where people will stand.
  2. In Studio, open Screens and click the screen.
  3. Turn on the Motion sensor switch.
  4. Under On motion, play, choose the playlist to show when someone comes near.
  5. Under Start playing, choose how long someone must stay before it starts: Right away, or after 2, 3, 5 or 10 seconds. A short wait stops people who just walk past from starting it.
  6. Under Keep playing for, enter how many seconds it keeps playing after the last movement. New movement starts the count again.
  7. Under When nobody is there, show, choose what the screen shows the rest of the time: What's playing (above), Another playlist, Black screen or A logo (an image from your Media Library, centred on black).
  8. Click Publish.

How do I know the sensor works?

Wave in front of it, then look at the Motion sensor section of the screen's settings in Studio. It shows Last motion detected with how long ago. The player reports this when it checks in, so it can take about 15 seconds to show up.

What plays when motion starts?

The chosen playlist, full screen, from its first slide. When the hold time runs out with no new movement, the screen goes back to its idle content. The motion playlist is downloaded to the player in advance, so it starts straight away.

Can I use it on a video wall?

No. The motion sensor setting isn't available on screens that are part of a video wall.

Will the F12 key do anything else?

On the CastWize player, no: while the motion setting is on, the player takes the key itself. Don't plug the sensor into a computer you use for other work, as F12 has other uses in many programs.

Setting up a screen for the first time? Start with Pair a screen.

Still stuck? Email [email protected] with the screen's name and what you see on it.

Ready to put your first screen up?

$5 per screen per month, everything included. First screen free for 30 days, no credit card required.