First Project - Puzzle Box

Hi, guys. Beginner Arduino user here and first time poster. Please forgive me in advance if I've posted here incorrectly.

Currently working on a puzzle box/chest that I'd like to control with my Arduino and I want to know if it would be feasible to do so.

Ideally, my box will have 5 different compartments.
Each compartment will be opened by 5 different servos.
Each servo will be activated by 5 different sensors.

Thinking about using a : Flame detector for one compartment, water/rain detector for another compartment, sound detector (Microphone module) for another compartment and 2 other sensors which I have not decided upon yet.
Possibly a keypad and/or a combination-type system using 3 potentiometers.

My question is this : Will my Arduino Uno be able to run all 5 servos as well as all 5 sensors? Or will I have to get additional equipment to run this kind of setup?

Thanks for the help!

Ideally, my box will have 5 different compartments.
Each compartment will be opened by 5 different servos.

I make that twenty five servos.

That's a Mega, at least.

AWOL:
I make that twenty five servos.

That's a Mega, at least.

My mistake! Poor wording. There are only 5 servos and 5 sensors.

Each compartment is opened by 1 servo and there are a total of 5 compartments.

5 servos and 5 sensors.

A servo on Arduino requires analogWrite() meaning they must be connected to a PWM pin. The UNO has 6 PWM pins (3, 5, 6, 9, 10, 11).
For your sensors, the UNO has 6 analog pins and about 6 more normal digital pins. This should be enough for the 5 various sensors you wish to use.

So you should have enough pins on an UNO for what you want. If you want to power all five servos at the same time, you might want to consider an external 5v power supply as the load current of a small servo can exceed 500mA and an UNO can only really output about 1A.

"A servo on Arduino requires analogWrite() meaning they must be connected to a PWM pin. "

Incorrect!

The Servo.h library supports 12 Servos on an Uno.

A servo signal is a 1-2mS wide pulse repeated at ~ 50 Hz.
Hardly the ~500 Hz PWM signal that can be from a 1/255 to 254/255 wide pulse.

mzise1:
So you should have enough pins on an UNO for what you want. If you want to power all five servos at the same time, you might want to consider an external 5v power supply as the load current of a small servo can exceed 500mA and an UNO can only really output about 1A.

Thanks for this! That was probably going to be my next question.

CrossRoads:
"A servo on Arduino requires analogWrite() meaning they must be connected to a PWM pin. "

Incorrect!

The Servo.h library supports 12 Servos on an Uno.

Thank you for responding! So a total of 5 sensors and 5 servos using just my Arduino Uno (And an external power source) shouldn't be a problem at all?

mzise1:
and an UNO can only really output about 1A.

Also incorrect.

Total current (all pins) is limited to about 450mA on USB supply.
Because of the 500mA fuse and 50mA the Uno draws itself.

On external power, current is mainly limited by the dissipation of the 5volt regulator.
With 9volt on the DC socket, an average total pin current draw of >250mA will eventually shut down the regulator.
Leo..

I have had between 500 and 750 mA @ 8.4v constant load on an Arduino UNO before without thermal overload (it was a clone though), however it is still not ideal.

For the puzzle box I would suggest two 18650 cells in series in a holder connected to a 5V voltage step down regulator good for 5A or so. Have the 5V regulator directly connect to the 5V and GND rail of the Arduino and the red and black wires of each servo.

Also 18650 cells are rechargeable, so I would get a charger as well.

You may want to add a fuse to the circuit as well as decent 18650 cells can supply in excess of 50A each.

mzise1:
I have had between 500 and 750 mA @ 8.4v constant load on an Arduino UNO before without thermal overload (it was a clone though), however it is still not ideal.

That's 1.7-2.6W of power dissipation if you put that much current through the regulator. No regulator can handle that without heat sink, and I'm not aware of any Arduinos with heat sink. Arduinos with buck converter on board may be able to handle that load.

Anyway it's a bad idea. Use a buck converter for those currents, not a linear regulator.

You may want to add a fuse to the circuit as well as decent 18650 cells can supply in excess of 50A each.

A truly decent cell doesn't need a fuse as it'd have protection circuits on board. Mine will cut off when shorted or otherwise overloaded (I don't know at which current), only recovering from this when connected to a charger.

AWOL:
I make that twenty five servos.

That's a Mega, at least.

Ideally, my box will have 5 different compartments.
Each compartment will be opened by 5 different servos.
Each servo will be activated by 5 different sensors.

each compartment with 5 servos = 5 x 5 = 25
each (of 25) servos has 5 sensors = 25 x 5 = 125
we know this is not what the OP means, but yikes that could be a lot of stuff.

===============

questions abound

will it be possible for all servos work at the same time ?

batteries ? is this portable ?

what do the servo's do ? just release a latch ? door to spring open
or close a door after opening? needs power power ways ?

Hi, dave-in-nj!

I hope I can answer your questions.

Because this is my first project, I'm not sure if it's possible for all servos to work at the same time. The small chest is composed of 4 drawers and one larger cupboard-style door.

Each drawer will have a sensor.
For example, drawer 1 will have a flame sensor. When the sensor detects a flame, a servo will move from a locked position to an unlocked position. I'm probably going to cut a small notch in the chest which the servo arm will latch onto. So, to me, it's not necessary for all servos to work at the same time. As long as they unlock when each sensor triggers.

The chest does not need to be portable, so batteries aren't necessary. Although I don't mind using batteries if it's an easier alternative to anything else.

I really appreciate all the help and advice. This project is still in the planning phase so I wanted to check whether it was possible of doing before I got too commited. It sounds like, although the project is possible, I may be in over my head! I'm starting to think about going a little smaller before I leap into this.

From the Arduino side (an Uno or similar is probably enough as you have only five servos and five sensors) it's no problem to control that number of servos, and to keep an eye on that many sensors.