Kids Project! Smartphone Piyo Piyo


Create a Bird and control it from a smartphone!


How to make


  • Servo Motor SG5010
  • Piezo Speaker
  • Paper Cup
  • Paper

First, Create base for a bird.
Cut circle and make a tiny hole for motor.

Next, Fix it on top of a motor with side tape.

Attach this to a servo.

Create a bird with cup as you like!

Then, put it on a servo.

Fix a cable like this.


Piezo Speaker to io0 and io4.
Servomotor signal to io9. vcc to io10, gnd to io11.
You finished! Open HTML.

How to use

Tilt a smartphone to move and tweet.


<!-- HTML Example -->
  <script src=""></script>
  <script src=""></script>
  <div id="obniz-debug"></div>
  <div id="print"></div>

var speaker;
var servo;
var lastbeta;
var obniz = new Obniz("OBNIZ_ID_HERE")
obniz.onconnect = async () => {

  speaker = obniz.wired("Speaker", {signal:0, gnd:4});
  servo = obniz.wired("ServoMotor", {signal:9,vcc:10, gnd:11});

window.addEventListener("deviceorientation", (event) => {
  if (!speaker) return;
  const beta = event.beta;
  const gamma = event.gamma;
  const alpha = event.alpha;
  if (beta > lastbeta + 1 || beta < lastbeta - 1 ){ - 0) * (7000 - 4000) / (90 - 0) + 4000));
  } else {
  lastbeta = beta;
  servo.angle(parseInt((gamma - (-80)) * (180 - 0) / (80 - (-80)) + 0));


Run Now

The html will be opened to run a program.

You will Get in Few Days

Circuit for Starter “obniz Board” is available on Amazon and other online stores.
You can get it at below

Our products and resellers


Visit our developer’s forum to discuss and discover technologies.



Feel free to contact out support and technical team.

Contact us