# How to combine Useless boc and Shy Box

**URL:** <https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659>\
**Category:** General Guidance\
**Created:** [February 8, 2022, 11:42am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659 "2022-02-08T11:42:26Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 8, 2022, 11:42am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/1 "2022-02-08T11:42:26Z")

</div>

I want to combine useless box and shy box using only one arduino.

 ![ArduinoCircuit](https://europe1.discourse-cdn.com/arduino/original/4X/d/b/5/db5e759ae7be91dba1199eb360407970c0114ac7.png)

[![](https://europe1.discourse-cdn.com/arduino/original/4X/f/f/9/ff9b30efe235a064d94977fd79cd7fbbe480f99c.jpeg "DIY Useless Box with Arduino") ](https://www.youtube.com/watch?v=cpdjQ0gheDQ)

> **[Arduino: the SHY BOX](https://www.instructables.com/SHY-BOX/)**
>
> Arduino: the SHY BOX: This is a BOX and it just is a little bit shy.
> You too can make a BOX that is shy.
> Learn how to make it in the following instructable.

this is the circuit of useless box and shy box I found online, If it can be put together, how the circuit should be made? do you have to use a selector switch? what about the code?

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [February 8, 2022, 12:19pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/2 "2022-02-08T12:19:55Z")

</div>

Welcome to the forum

> [@ryancoryxy](#):
>
> I want to combine useless box and shy box using only one arduino.

What should the combined box do ?

What programming experience do you have, in particular using the Arduino ?

By the way, a PP3 battery is not suitable for powering your project if that is what you are thinking of using because it cannot supply enough current for more than a few minutes

---

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 8, 2022, 12:37pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/3 "2022-02-08T12:37:09Z")

</div>

I want to make a box with two modes, one is useless box mode and the second is shy box mode. So when it's in shy box mode, only one servo (the one which open the box) is working. But if it's in useless box mode, the censor is not used and both of the servo works (one to open the lid and the other one to press the switch). if you look at this youtube link [DIY Useless Box with Arduino - YouTube](https://youtu.be/cpdjQ0gheDQ)  
[arduino: SHY BOX - YouTube](https://youtu.be/m0waB8EZtJA) , I want two of it to be combined and use only one arduino. I've tried to make both and now I want to try to combine them but I can't think of the circuits, and I've tried to make it but fail many times

---

<div class="post-metadata">

**Author:** ![ToddL1962](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/toddl1962/32/225060_2.png) [@ToddL1962](https://forum.arduino.cc/u/ToddL1962)\
**Post date:** [February 8, 2022, 4:46pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/4 "2022-02-08T16:46:50Z")

</div>

I made a similar project. I called it a "silly" box. You can find full code and documentation here:

> **[GitHub - toddl1962/silly\_box: A useless box with a twist](https://github.com/toddl1962/silly_box)**
>
> A useless box with a twist. Contribute to toddl1962/silly\_box development by creating an account on GitHub.

There is a very detailed wiring diagram and construction document. Code is very well commented. Given that I don't have time to offer support.

---

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 9, 2022, 3:09am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/5 "2022-02-09T03:09:51Z")

</div>

Thank you! I'll definitely try to make it. But may I ask if it's possible to combine useless box and shy box as I explained?

---

<div class="post-metadata">

**Author:** ![LarryD](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/larryd/32/215550_2.png) [@LarryD](https://forum.arduino.cc/u/LarryD)\
**Post date:** [February 9, 2022, 4:01am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/6 "2022-02-09T04:01:13Z")

</div>

There wouldn’t be a reason not to, maybe a switch to select which one runs.

FYI

> [@Share tips you have come across](https://forum.arduino.cc/t/share-tips-you-have-come-across/428745/807):
>
> Project construction life cycle When you start designing an Arduino project from start to finish, you need to have a plan. Once you have decided what you want to make, scale drawings and component selection is a must. For scaled drawings, a 3D computer program like ‘Sketchup Make’ is great but there is a learning curve that you must achieve. There are lots of YouTube Videos you can review to gain the skills needed to draw your scaled drawing. Here we will be making a ‘Useless Box’ designed a…

---

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 10, 2022, 5:09am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/7 "2022-02-10T05:09:23Z")

</div>

okay thank you 😀

---

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 22, 2022, 5:25am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/8 "2022-02-22T05:25:37Z")

</div>

I already make the code for this project but I there's something wrong.. Can someone help me?  
This is the code I've already make :

```cpp
#include <Servo.h>                       

Servo handServo;                         
Servo boxServo;

int switchStatus=0, action=1, vot, randNumber=0;                  
const int ledPin = 13;                    
const int frontSwitchPin = 2;
const int handServoPin = 5;
const int boxServoPin = 6;

void setup()
{
  Serial.begin(9600);
  
  pinMode(ledPin, OUTPUT);                  
  digitalWrite(ledPin,HIGH);
  
  handServo.attach(handServoPin);              
  boxServo.attach(boxServoPin);
  handServo.write(180);                       
  boxServo.write(70);

  //randomSeed(analogRead(0));
}

void loop()
{
  switchStatus = digitalRead(frontSwitchPin); 
  //action = random(1,16);
  
  if (switchStatus == LOW){                   
    
    if (action == 1)
    {
      Serial.println("Action 1");           
      for (int i = 70; i <= 110; i++)
      {
        boxServo.write(i);
        delay(20);
      }
      for (int i = 180; i >= 35; i--)
      {
        handServo.write(i);
        delay(20);
      }
      delay(1000);
      handServo.write(26);
      delay(200);
      for (int i = 26; i <=180; i++)
      {
        handServo.write(i);
        delay(20);
      }
      for (int i = 110; i >= 70; i--)
      {
        boxServo.write(i);
        delay(20);
      }
      action++;
    }
    
    
    else if (action == 2)
    {
      Serial.println("Action 2");         
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(550);
      handServo.write(26);
      delay(550);
      handServo.write(180);
      delay(550);
      boxServo.write(70);
      delay(1500);
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(3000);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 3)
    {
      Serial.println("Action 3");         
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(1000);
      boxServo.write(70);
      delay(2000);
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      handServo.write(26);
      delay(550);
      handServo.write(180);
      delay(500);
      boxServo.write(70);
      action++;
    }
   
    else if (action == 4)
    {
      Serial.println("Action 4");         
      for (int i = 70; i <= 110; i++)
      {
        boxServo.write(i);
        delay(20);
      }
      for (int i = 180; i >= 35; i--)
      {
        handServo.write(i);
        delay(20);
      }
      delay(2000);
      handServo.write(26);
      delay(200);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 5)
    {
      Serial.println("Action 5");      
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(2000);
      handServo.write(65);
      delay(550);
      handServo.write(40);
      delay(200);
      handServo.write(65);
      delay(200);
      handServo.write(40);
      delay(200);
      handServo.write(65);
      delay(200);
      handServo.write(40);
      delay(200);
      handServo.write(65);
      delay(200);
      handServo.write(40);
      delay(200);
      handServo.write(65);
      delay(200);
      handServo.write(40);
      delay(200);
      handServo.write(65);
      delay(2000);
      handServo.write(26);
      delay(400);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 6)             
    {
      Serial.println("Action 6");      
      
      for (int i = 70; i <110; i++)
      {
        boxServo.write(i);
        delay(20);
      }
      delay(1000);
      for (int i = 0; i < 12; i++)
      {
        for (int j = 70; j <= 110; j++){
          boxServo.write(j);
          delay(6);
        }
        delay(200);
      }
      for (int i = 180; i >= 35; i--)
      {
        handServo.write(i);
        delay(30);
      }
      handServo.write(26);
      delay(400);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      delay(1500);
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(3000);
      boxServo.write(80);
      action++;
    }
    
    else if (action == 7)
    {
      Serial.println("Action 7");      
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(400);
      handServo.write(26);
      delay(1000);
      for (int i = 0; i < 6; i++)
      {
        for (int j = 70; j <= 110; j++){
          boxServo.write(j);
          delay(6);
        }
        delay(200);
      }
      delay(500);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 8)
    {
      Serial.println("Action 8");      
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      handServo.write(26);
      delay(2000);
      for (int i = 0; i < 7; i++)
      {
        handServo.write(75);
        delay(100);
        handServo.write(40);
        delay(100);
      }
      delay(500);
      handServo.write(180);
      delay(1000);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 9)
    {
      Serial.println("Action 9");      
      for (int i = 70; i <= 105; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(2000);
      boxServo.write(110);
      for (int i = 180; i >=35; i--)
      {
        handServo.write(i);
        delay(40);
      }
      delay(500);
      handServo.write(26);
      delay(200);
      for (int i = 26; i <=180; i++)
      {
        handServo.write(i);
        delay(40);
      }
      boxServo.write(70);
      delay(2000);
      boxServo.write(100);
      delay(3000);
      boxServo.write(70);
      action++;
    }
  
    
    else if (action == 10)
    {
      Serial.println("Action 10");      
      for (int i = 70; i <= 105; i++)
      {
        boxServo.write(i);
        delay(100);
      }
      delay(1000);
      for (int i = 0; i < 10; i++)
      {
        for (int j = 70; j <= 100; j++){
          boxServo.write(j);
          delay(6);
      }
        delay(100);
      }
      boxServo.write(110);
      delay(100);
      handServo.write(26);
      delay(650);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 11)
    {
      Serial.println("Action 11");      
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      handServo.write(26);
      delay(2000);
      for (int i = 0; i < 3; i++)
      {
        handServo.write(65);
        delay(200);
        handServo.write(40);
        delay(200);
      }
      delay(1500);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      delay(1500);
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      handServo.write(26);
      delay(3000);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 12)
    {
      Serial.println("Action 12");     
      for (int i = 70; i <= 110; i++)
      {
        boxServo.write(i);
        delay(50);
      }
      delay(1000);
      for (int i = 180; i >= 26; i--)
      {
        handServo.write(i);
        delay(50);
      }
      delay(2000);
      handServo.write(26);
      delay(200);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 13)
    {
      Serial.println("Action 13");      
      for (int i = 70; i <= 110; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(2000);
      for (int i = 180; i >= 60; i--)
      {
        handServo.write(i);
        delay(40);
      }
      for (int i = 0; i < 3; i++)
      {
        handServo.write(60);
        delay(200);
        handServo.write(40);
        delay(800);
      }
      handServo.write(26);
      delay(2000);
      handServo.write(180);
      delay(500);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 14)
    {
      Serial.println("Action 14");     
      for (int i = 70; i <= 105; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(4000);
      boxServo.write(110);
      handServo.write(26);
      delay(650);
      handServo.write(180);
      delay(500);
      boxServo.write(100);
      delay(4000);
      boxServo.write(70);
      action++;
    }
    
    else if (action == 15)
    {
      Serial.println("Action 15");    
      for (int i = 70; i <= 105; i++){
        boxServo.write(i);
        delay(6);
      }
      delay(1000);
      for (int i = 0; i < 3; i++)
      {      
        for (int j = 70; j <= 105; j++){
          boxServo.write(j);
          delay(50);
        }
        for (int j = 105; j >= 70; j--)
        {
          boxServo.write(j);
          delay(50);
        }
      }
      for (int j = 70; j <= 110; j++){
        boxServo.write(j);
        delay(50);
      }
      for (int i = 180; i >= 35; i--)
      {
        handServo.write(i);
        delay(40);
      }
      delay(1000);
      handServo.write(26);
      delay(400);
      handServo.write(180);
      delay(400);
      boxServo.write(70);
      action = 1;
    }
    
  }
  
}

```

and this is the circuit :

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/c/b/e/cbeeb3b2ee6f71e813f9395d25ddc88fcc68f344.jpeg)

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [February 22, 2022, 8:17am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/9 "2022-02-22T08:17:31Z")

</div>

> [@ryancoryxy](#):
>
> there's something wrong.

Can you please give us a clue as to what is wrong with how the box works using the sketch that you posted ?

The most obvious problem that I see is that the servos are powered from the Arduino and not an external source

---

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 22, 2022, 8:23am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/10 "2022-02-22T08:23:13Z")

</div>

I forgot to add it to the image but I use 9v battery connect to power port.  
the problem is the servo keeps moving by itself even though I already change the switch

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [February 22, 2022, 8:27am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/11 "2022-02-22T08:27:33Z")

</div>

> [@ryancoryxy](#):
>
> I use 9v battery connect to power port.

Then you have 2 possible problems

1. the 9V PP3 battery that I suspect you are using cannot supply enough current to power your circuit, especially the servos. Can you measure the battery voltage under load ?
2. the current to power the servos, assuming that there is enough to power them, is coming via the voltage regulator on the Arduino which may not be able to handle the required current

---

<div class="post-metadata">

**Author:** ![ryancoryxy](https://avatars.discourse-cdn.com/v4/letter/r/eb9ed0/32.png) [@ryancoryxy](https://forum.arduino.cc/u/ryancoryxy)\
**Post date:** [February 22, 2022, 11:29am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/12 "2022-02-22T11:29:32Z")

</div>

Can someone help me with the code here?

> **[Login | Tinkercad](https://www.tinkercad.com/login?next=%2Fthings%2F7G2iupHL0Zh-amazing-amur%2Feditel%3Fsharecode%3Dz3t9pRRc5oc1BwGL1CPGoEiBFdoasIGHsTDbyr-sorU)**

---

<div class="post-metadata">

**Author:** ![UKHeliBob](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ukhelibob/32/215663_2.png) [@UKHeliBob](https://forum.arduino.cc/u/UKHeliBob)\
**Post date:** [February 22, 2022, 11:53am UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/13 "2022-02-22T11:53:07Z")

</div>

> [@ryancoryxy](#):
>
> Can someone help me with the code here?

It would be easier to help you with the code if you posted it here and described the problems

Did you note my previous comments about power to the project and in particular to the servos ?

---

<div class="post-metadata">

**Author:** ![ToddL1962](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/toddl1962/32/225060_2.png) [@ToddL1962](https://forum.arduino.cc/u/ToddL1962)\
**Post date:** [February 22, 2022, 4:40pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/14 "2022-02-22T16:40:42Z")

</div>

> [@ryancoryxy](#):
>
> I forgot to add it to the image but I use 9v battery connect to power port.  
> the problem is the servo keeps moving by itself even though I already change the switch

If you had looked at my design I referred you to then you would know that a 9V battery is not capable of providing the necessary current for the Arduino and the servos. What will likely happen is that as soon as the servos start to move the Arduino will reset due to the voltage drop of initiating the servo movement. You MUST fix this issue first before trying to debug your code.

---

<div class="post-metadata">

**Author:** ![Paul\_B](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_b/32/216376_2.png) [@Paul\_B](https://forum.arduino.cc/u/Paul_B)\
**Post date:** [February 22, 2022, 9:59pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/15 "2022-02-22T21:59:59Z")

</div>

> [@ryancoryxy](#):
>
> I forgot to add it to the image but I use 9v battery connect to power port.

Interesting but completely **useless** party trick. 🙄

You **need** to provide power for the servos. A 5 V supply such as a "phone charger" connected directly to the servos for development Allow 1 Amp per servo. You can connect the 5 V positive to the "5V" pin of the Leonardo except for when you have it plugged into the PC USB. It **should** be obvious that the ground of the power supply and Arduino should always be connected.

---

<div class="post-metadata">

**Author:** ![Paul\_B](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/paul_b/32/216376_2.png) [@Paul\_B](https://forum.arduino.cc/u/Paul_B)\
**Post date:** [February 22, 2022, 10:03pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/16 "2022-02-22T22:03:15Z")

</div>

![Selection_046](https://europe1.discourse-cdn.com/arduino/original/4X/8/2/4/824bff0a2b85d2f79d55ddf0d0f267e9c25a0af4.png)  
Is that a three position switch?

Otherwise why connect both sides to Arduino pins?

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [August 21, 2022, 10:04pm UTC](https://forum.arduino.cc/t/how-to-combine-useless-boc-and-shy-box/956659/17 "2022-08-21T22:04:04Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
