Useless box with multiple switches

Hi, I’m Kaelyn, a high school student, and I am currently working on my design and technology class project. With this project, I have chosen an area that is a bit out of my knowledge, and I am feeling a bit out of my depth. Besides that, I am very keen to know, and learn more about it.
This project will be a useless box, similar to the ones that you have on your website, but what makes this useless box of mine different is that it would have multiple switches. When the switches move in a certain patterned sequence, it should open a hidden drawer. I will be using a raspberry pi Pico microcontroller board. I was hoping that you could give me any recommendations on what servos and switches will be best suited for this project’s success.


Hey Kaelyn,
Welcome to the forums!

That sounds like an awesome project idea and is absolutely possible with the Raspberry Pi Pico. I would suggest using something like our PiicoDev Servo Driver as it is daisy chainable and will make your setup a lot smoother.

As for the drawer, you can use a servo to make a locking mechanism for the drawer and use a spring to have it eject once the solenoid unlocks the drawer. I have even seen some setups for hidden drawers use the repelling effect of magnets as a way to pop them out once unlocked. I would also recommend having a latching mechanism that the solenoid can unlock with movement, so that you can just press the drawer back in as it will make things easier. this latching mechanism would have to be mechanical so that you can prevent using relays and 12V inclusions in your project, as that would make things a bit more complex.

For the code, you will need to set up the standard useless box functions where each switch will activate the associated solenoid once it recognises it has been flicked. you will then need to add a function that checks for a pattern of switches being flicked so if it recognises for instance switches 2, 4 and 6 have been switched over, it will activate the servo responsible for the drawer and pop it out for you.

Hope that helps you with a starting point for this project!

Hi All
If you just want to detect 3 0r 4 particular switches have been operated that is easy. Just wire them in series and when all are made operate the unlatching device whatever that may be.
No Micro, no fancy programming , nothing really. Only if all the switches are operated the drawer or whatever would have to open.

But, I think the idea here is to have the switches operated in a particular order. That is a different story. Will think about that.
Cheers Bob

Hi Kaelyn
Don’t like to kill off the use of microcontrollers but the following circuit is posted as an interest Not a micro to be seen.

I have sketched an array of 16 switches of which 4 are the key. They are S2, S7, S13, S14.You will only get an output if all these 4 switches and ONLY these 4 are operated. If any one of the others are operated or any one of these 4 are NOT operated there will be no output.

This does not detect the order of operation, only the fact that the correct 4 and only these are operated.
Cheers Bob

Hi @kaelyn254310 (and @Robert93820 ),

Hah ( Relay logic! ) – with a bit more skull sweat, 4 relays (probably with 2 sets of changeover contacts each, though it might be possible with a single changeover set … needs more thinking) you could make the order mandatory too. And if the right switch is pressed ( now they could/should be push buttons instead of toggle switches) in the wrong order, everything would also clear back the the initial position … a truly devious ‘useless box’.

FYI - way back I built a controller for a theatrical revolve driven by hydraulics, that would allow presetting the target position, direction of revolution, and with a choice of 3 speeds - all triggered on cue by the GO button … all with pushbuttons and relays.
Yes there were micro processors then ( I owned a Z80 based system ) but at that time they were just expensive gadgets (aka nerd toys), and not the ubiquitous device as of here and now.

There was a technical writer who had this catch phrase - “My favourite programming language is solder”

It all comes down to what you want to do, want to learn, and want to play with.



Hi Murray & All
Yes I think it could be done to only respond in a pre-determined order with a DPDT relay for each of 4 buttons and the rest are dummies which do nothing except maybe reset the whole thing as you suggest .

I have to go to Brisbane to-morrow and will be away for the whole week but will have a think about it.
Cheers Bob

Hey Kaelyn,

Assuming you want to stick with the Pico, have you considered using the PiicoDev® Capacitive Touch Sensor CAP1203? PiicoDev means no soldering is needed, it all plugs together.

The sensors are labelled 1, 2 & 3. To open the drawer you would have to enter keys in the correct sequence say 1-3-3-2-1-2. In Python…

code = (1, 3, 3, 2, 1, 2)

You would need some operational rules e.g. if the wrong sequence is entered there would be say a 4 second delay before trying again.

You could add some status LEDs e.g. green = ready for entry, red = incorrect entry and you have to wait for the green to try again.

The sensor will daisy chain to the PiicoDev Servo Driver as suggested by Blayden.

As an alternative to using a servo you could consider using a solenoid. The armature will “shoot” the drawer out. The armature will then withdraw allowing the drawer to be manually pushed back in. Could be easier to build.

Hi Kaelyn,

Welcome to the forum!

Keen to see where this awesome project goes! I’d love to make one, sounds like a great gift!

For hardware recommendations I’d go for the following servo and switch:

Hi @kaelyn254310 ,

If you stick with the piicoDev environment, you could use up to 16 of the PiicoDev Buttons with the Raspberry Pico, the LED Module as a display and as previously mentioned by @Blayden the servo driver for the ‘unlatcher/opener’ device

As before - it all depends on which way you want to go for experimentation and self-learning. (try both :smiley: )


Hi friends . I want a useless box project using a Raspberry Pi Pico and two keys, provided that it has 10 different movements (scenarios). I have a problem with the code and circuit diagram. Can someone help me?
What’s app +972524009018

Hi Moamen,

Welcome to the forums!

We’d be happy to give you a hand with this. If you wouldn’t mind posting up some more information about what you are specifically envisioning for this project, as well as the circuit diagram and code screenshots that would be awesome.

This way everyone can contribute and help you out!


Hi Sophia
I can’t find the code but I have a circuit diagram

Can anyone help me find the code?

@Moamen261768 I’m not sure what you’re looking for - are you asking for help writing the code?
What do you want each button to do? Can describe the intended behaviour?

I want someone to write the code and check the circuit diagram

If you google “product design service” you will find many businesses and individuals who can provide the service you are looking for. However, it is likely that they would all require a detailed design specification in order to be sure that they come up with a solution that meets your expectations. So that would be the starting point for your project. For instance:
How to write a great product specification sheet (for beginners) | Nulab