# Motion Sensor Bat

## Overview

https://youtu.be/n2cuiZ1W8Zs

## Build a Motorized Bat

Build a motion activated flying bat! Add this Halloween decoration to a candy bowl to spook trick-or-treaters. When the motion sensor detects a hand, it actives a fluttering bat with sound effects!

![sensors_hero-clear.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/333/medium640thumb/sensors_hero-clear.jpg?1730165279)

## Motion Activated

A VL53L1X time of flight sensor detects when an object is nearby. Different audio is played depending on the distance, making this an advanced decor that's more than just a typical store-bought Halloween amusement.

You may customize the CircuitPython code to change the distances, servo movement, sound effects and more.

![sensors_hero-sense.gif](https://cdn-learn.adafruit.com/assets/assets/000/133/334/medium640thumb/sensors_hero-sense.jpg?1730165433)

## PropMaker RP2040

This dev-board is our favorite go-to that’s designed for making prop projects. It’s got the RP2040 chip with a built-in audio amplifier and accelerometer!

A 2200mAh lipo battery will provide several hours of use and can be recharged over USB.

![sensors_hero-board.jpg](https://cdn-learn.adafruit.com/assets/assets/000/133/335/medium640/sensors_hero-board.jpg?1730165601)

![](https://cdn-learn.adafruit.com/assets/assets/000/133/366/medium800thumb/sensors_hero-top.jpg?1730211458)

## Parts
### Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier

[Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier](https://www.adafruit.com/product/5768)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. By picking a feather and stacking on a FeatherWing you can create advanced projects quickly. One popular combo is our [Feather M4](https://www.adafruit.com/product/3857)...

In Stock
[Buy Now](https://www.adafruit.com/product/5768)
[Related Guides to the Product](https://learn.adafruit.com/products/5768/guides)
![Video of a white hand pressing a button to briefly turn an LED strip into white lights. Also wired up to the microcontroller are a servo motor and a speaker.](https://cdn-shop.adafruit.com/product-videos/640x480/5768-09.jpg)

### Continuous Rotation Micro Servo

[Continuous Rotation Micro Servo](https://www.adafruit.com/product/2442)
Need to make a _tiny_ robot? This little micro servo rotates 360 degrees fully forward or backward, instead of moving to a single position. You can use any servo code, hardware, or library to control these servos. Good for making simple moving robots. Comes with five horns and...

In Stock
[Buy Now](https://www.adafruit.com/product/2442)
[Related Guides to the Product](https://learn.adafruit.com/products/2442/guides)
![Demo Video of the Continuous Rotation Micro Servo with a "t" shaped propeller connected to the gear and spinning.](https://cdn-shop.adafruit.com/product-videos/640x480/2442-02.jpg)

### Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm

[Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm](https://www.adafruit.com/product/3967)
The&nbsp; **Adafruit VL53L1X Time of Flight Distance Sensor** (also known as VL53L1CX) is a&nbsp;_Time of Flight_&nbsp;distance sensor that has a massive 4 meter range and LIDAR-like precision. The sensor contains a very tiny invisible laser source and a matching sensor....

In Stock
[Buy Now](https://www.adafruit.com/product/3967)
[Related Guides to the Product](https://learn.adafruit.com/products/3967/guides)
![Top view of Adafruit VL53L1X Time of Flight Distance Sensor hooked up to an OLED display. A white manicured hand waves at the sensor, and the OLED displays the distance.](https://cdn-shop.adafruit.com/product-videos/640x480/3967-05.jpg)

### Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

[Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt](https://www.adafruit.com/product/4227)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

In Stock
[Buy Now](https://www.adafruit.com/product/4227)
[Related Guides to the Product](https://learn.adafruit.com/products/4227/guides)
![Mini Oval Speaker with Short Wires ](https://cdn-shop.adafruit.com/640x480/4227-06.jpg)

### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
![Angled shot of STEMMA QT / Qwiic JST SH 4-pin Cable.](https://cdn-shop.adafruit.com/640x480/4210-00.jpg)

### Lithium Ion Cylindrical Battery - 3.7v 2200mAh

[Lithium Ion Cylindrical Battery - 3.7v 2200mAh](https://www.adafruit.com/product/1781)
Need a big battery for your project? This lithium-ion battery contains a 2200mAh and a protection circuit that provides over-voltage, under-voltage, and over-current protection. Yet, it is slim and easy to fit into many project cases.  
  
This cell can provide 2 **C** of...

In Stock
[Buy Now](https://www.adafruit.com/product/1781)
[Related Guides to the Product](https://learn.adafruit.com/products/1781/guides)
![Lithium Ion Cylindrical Battery - 3.7v 2200mAh with JST PH connector](https://cdn-shop.adafruit.com/640x480/1781-04.jpg)

### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

Out of Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
![Small, black, SPDT slide switch.](https://cdn-shop.adafruit.com/640x480/805-03.jpg)

### 1.25mm Pitch 2-pin Cable Matching Pair - 40cm long

[1.25mm Pitch 2-pin Cable Matching Pair - 40cm long](https://www.adafruit.com/product/4720)
When 0.1" is too big, and JST PH's too chunky, these ultra-slim 1.25mm connectors are a reliable alternative. These are only 1.25mm pitch, but have a nice clicky connection.

These cables are&nbsp;nice and long, 40cm in fact. They've&nbsp;got both small form factor and are a...

In Stock
[Buy Now](https://www.adafruit.com/product/4720)
[Related Guides to the Product](https://learn.adafruit.com/products/4720/guides)
![1.25mm Pitch 2-pin Cable Matching Pair](https://cdn-shop.adafruit.com/640x480/4720-04.jpg)

### Part: M2.5x6mm Screws
quantity: 6
M2.5x6mm Screws
[M2.5x6mm Screws](https://amzn.to/3ZvDMvg)

### Part: M2x6mm Screws
quantity: 2
M2x6mm Screws
[M2x6mm Screws](https://amzn.to/47AsYhn)

### Part: 0.65mm Round Silver-Plated Memory Wire
quantity: 1
0.65mm Round Silver-Plated Memory Wire
[0.65mm Round Silver-Plated Memory Wire](https://www.michaels.com/product/beadalon-silver-plated-memory-wire-large-bracelet-10376078?michaelsStore=8744&inv=2)

- [Next Page](https://learn.adafruit.com/motion-sensor-bat/circuit-diagram.md)

## Featured Products

### Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier

[Adafruit RP2040 Prop-Maker Feather with I2S Audio Amplifier](https://www.adafruit.com/product/5768)
The Adafruit Feather series gives you lots of options for a small, portable, rechargeable microcontroller board. By picking a feather and stacking on a FeatherWing you can create advanced projects quickly. One popular combo is our [Feather M4](https://www.adafruit.com/product/3857)...

In Stock
[Buy Now](https://www.adafruit.com/product/5768)
[Related Guides to the Product](https://learn.adafruit.com/products/5768/guides)
### Continuous Rotation Micro Servo

[Continuous Rotation Micro Servo](https://www.adafruit.com/product/2442)
Need to make a _tiny_ robot? This little micro servo rotates 360 degrees fully forward or backward, instead of moving to a single position. You can use any servo code, hardware, or library to control these servos. Good for making simple moving robots. Comes with five horns and...

In Stock
[Buy Now](https://www.adafruit.com/product/2442)
[Related Guides to the Product](https://learn.adafruit.com/products/2442/guides)
### Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm

[Adafruit VL53L1X Time of Flight Distance Sensor - ~30 to 4000mm](https://www.adafruit.com/product/3967)
The&nbsp; **Adafruit VL53L1X Time of Flight Distance Sensor** (also known as VL53L1CX) is a&nbsp;_Time of Flight_&nbsp;distance sensor that has a massive 4 meter range and LIDAR-like precision. The sensor contains a very tiny invisible laser source and a matching sensor....

In Stock
[Buy Now](https://www.adafruit.com/product/3967)
[Related Guides to the Product](https://learn.adafruit.com/products/3967/guides)
### Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt

[Mini Oval Speaker with Short Wires - 8 Ohm 1 Watt](https://www.adafruit.com/product/4227)
Hear the good news! This wee speaker&nbsp;is&nbsp;a&nbsp;great addition to any audio project where you need 8 ohm impedance and 1W or less of power. We particularly like this&nbsp;speaker&nbsp;as it is&nbsp;small and comes with nice skinny wires with a connector on the end. It has a handy...

In Stock
[Buy Now](https://www.adafruit.com/product/4227)
[Related Guides to the Product](https://learn.adafruit.com/products/4227/guides)
### STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long

[STEMMA QT / Qwiic JST SH 4-pin Cable - 100mm Long](https://www.adafruit.com/product/4210)
This 4-wire cable is a little over 100mm / 4" long and fitted with JST-SH female 4-pin connectors on both ends. Compared with the chunkier JST-PH these are 1mm pitch instead of 2mm, but still have a nice latching feel, while being easy to insert and remove.

<a...></a...>

In Stock
[Buy Now](https://www.adafruit.com/product/4210)
[Related Guides to the Product](https://learn.adafruit.com/products/4210/guides)
### Lithium Ion Cylindrical Battery - 3.7v 2200mAh

[Lithium Ion Cylindrical Battery - 3.7v 2200mAh](https://www.adafruit.com/product/1781)
Need a big battery for your project? This lithium-ion battery contains a 2200mAh and a protection circuit that provides over-voltage, under-voltage, and over-current protection. Yet, it is slim and easy to fit into many project cases.  
  
This cell can provide 2 **C** of...

In Stock
[Buy Now](https://www.adafruit.com/product/1781)
[Related Guides to the Product](https://learn.adafruit.com/products/1781/guides)
### Breadboard-friendly SPDT Slide Switch

[Breadboard-friendly SPDT Slide Switch](https://www.adafruit.com/product/805)
These nice switches are perfect for use with breadboard and perfboard projects. They have 0.1" spacing and snap in nicely into a solderless breadboard. They're easy to switch no matter what size fingers you have, but not so easy that they'll get flipped by accident. Work great as...

Out of Stock
[Buy Now](https://www.adafruit.com/product/805)
[Related Guides to the Product](https://learn.adafruit.com/products/805/guides)
### 1.25mm Pitch 2-pin Cable Matching Pair - 40cm long

[1.25mm Pitch 2-pin Cable Matching Pair - 40cm long](https://www.adafruit.com/product/4720)
When 0.1" is too big, and JST PH's too chunky, these ultra-slim 1.25mm connectors are a reliable alternative. These are only 1.25mm pitch, but have a nice clicky connection.

These cables are&nbsp;nice and long, 40cm in fact. They've&nbsp;got both small form factor and are a...

In Stock
[Buy Now](https://www.adafruit.com/product/4720)
[Related Guides to the Product](https://learn.adafruit.com/products/4720/guides)

## Related Guides

- [Adafruit VL53L1X Time of Flight Distance Sensor](https://learn.adafruit.com/adafruit-vl53l1x.md)
- [Adafruit RP2040 Prop-Maker Feather](https://learn.adafruit.com/adafruit-rp2040-prop-maker-feather.md)
- [Audio Synthesis with CircuitPython synthio](https://learn.adafruit.com/audio-synthesis-with-circuitpython-synthio.md)
- [Haunted Air Blaster](https://learn.adafruit.com/automated-air-blaster.md)
- [Prop-Maker Feather Talking Adabot Clock](https://learn.adafruit.com/prop-maker-feather-talking-adabot-clock.md)
- [Zelda Echoes Of Wisdom Tri Rod](https://learn.adafruit.com/zelda-tri-rod.md)
- [PropMaker Jack O'Lantern](https://learn.adafruit.com/propmaker-jack-o-lantern.md)
- [Ahsoka Lightsaber Prop-Maker RP2040 retrofit](https://learn.adafruit.com/lightsaber-retrofit.md)
- [Lightsaber Prop-Maker RP2040](https://learn.adafruit.com/lightsaber-rp2040.md)
- [Talking HAL 9000 with RP2040 Prop Maker Feather](https://learn.adafruit.com/hal-9000-rp2040-prop-maker.md)
- [Soundbox RP2040](https://learn.adafruit.com/soundbox-rp2040.md)
- [Color Sensing Music Player](https://learn.adafruit.com/color-sensing-music-player.md)
- [Halo Energy Sword RP2040](https://learn.adafruit.com/halo-energy-sword-rp2040.md)
- [Tiny TARDIS Pendant](https://learn.adafruit.com/tiny-tardis-pendant.md)
- [Adafruit Metro M7 1011 with AirLift](https://learn.adafruit.com/adafruit-metro-m7-with-airlift.md)
