Project Prop Build - Feasibility and "how should I do this" questions :)

Hi there! First post here, as I mostly use reddit for my tech support kind of things these days, but as I'm getting to the stage in my projects where I'm likely to be using actual code whatnot I figure a dedicated community would be a better place to learn!

So - the project.

Essentially, the end result is going to be an LED ring of 8x 5050 RGB leds, and a small speaker, and a button or two, all powered by a single (or two if needed) 18650 30Q batteries. Oh and a power switch I guess.

When turned on, the LED strip should glow continuously. When the main button is pressed, the speaker should play a sound (not sure how to program this sound file...). Possibly the LED strip could flicker or flash a pattern at the same time, before going back to the regular glow.

I think all of this should be relatively straightforward? I mean I don't know what the code I would use would be, but I am pretty sure it's all doable?

Now to the slightly more complicated part - I was originally going to have a separate 'battery indicator' led module (like this), to have a battery remaining readout on the prop too.

This should be the easy solution, I think? However I then thought... I'm using an RGB addressable set of LED's already, so if it was possible could I just have the arduino read the voltage level of the battery... and then have the LED ring glow green/yellow/red depending on remaining charge?

This prob will be worn, so it'd need to be fairly robust, so the fewer resisters and solder connections I have the better... The casing will be 3D printed so I can design it to be pretty sturdy from knocks etc.

Would appreciate any help with this, as this would be my first arduino project.

Edit:
It would also need to have a charging port. Was going to use a TP4056 for that. And the arduino I plan to use is the Pro Mini 3.3v 8mhz, so I believe that means I don't need any kind of 5v converter to run everything.

Sounds quite straightforward with a DF Player Mini for the sound part. A single LiPo should do.

wvmarle:
Sounds quite straightforward with a DF Player Mini for the sound part. A single LiPo should do.

Would this mean I'd need a DF Player Mini on top of the Arduino? I'm working on a per-unit budget of about £15, and at the moment with the Arduino+Battery+speaker+led ring I'm on about £14.50 and it seems those DF Players are more expensive than an arduino... I had thought you could play a simple wav file straight from the arduino? (I meant wav originally not mp3, though either is fine)

I think that you need to shop better and look into using an ATtiny chip for the controller.

There's few pins but you don't need many if those leds are WS28xx leds.

If you need more pins, make a minimal duino using an ATmega168P or ATmega328P running on internal clock, you need 2 bypass capacitors and a reset circuit plus whatever you connect to the IO pins is all. You can solder directly to the chip pins if you're good and fast or you can solder wires to a socket and stick the chip in that. It won't cost you $5 for those parts.

GoForSmoke:
I think that you need to shop better and look into using an ATtiny chip for the controller.

High-Low Tech – Programming an ATtiny w/ Arduino 1.6 (or 1.0)

There's few pins but you don't need many if those leds are WS28xx leds.

If you need more pins, make a minimal duino using an ATmega168P or ATmega328P running on internal clock, you need 2 bypass capacitors and a reset circuit plus whatever you connect to the IO pins is all. You can solder directly to the chip pins if you're good and fast or you can solder wires to a socket and stick the chip in that. It won't cost you $5 for those parts.

May I ask why? It seems like the ATTiny is just inferior with no benefits? It has way less memory so I'd have to buy external storage in order to store any sound file, and it's not even cheaper than the pro-mini to start with.

nirurin:
May I ask why? It seems like the ATTiny is just inferior with no benefits? It has way less memory so I'd have to buy external storage in order to store any sound file, and it's not even cheaper than the pro-mini to start with.

Unless you plan on simply doing tones, you will need something to store the wave files. The Arduiono on its own will not do a good job of playing complex sounds and it will not have the memory you need.

Romonaga:
Unless you plan on simply doing tones, you will need something to store the wave files. The Arduiono on its own will not do a good job of playing complex sounds and it will not have the memory you need.

It only needs to play a 2-second sound file. Should be possible to fit that into 30kb of space?

If not, then it would be cheaper to go for a PiZero instead of an arduino

nirurin:
May I ask why? It seems like the ATTiny is just inferior with no benefits? It has way less memory so I'd have to buy external storage in order to store any sound file, and it's not even cheaper than the pro-mini to start with.

You did mention a budget?

On eBay an MP3 player module with microSD slot and serial interface runs about $3. It takes 2 pins and has all the sound on the card. The DFPlayer mini uses an older version of what the Catalex module does but is more compact.

A WS2812 led string takes 1 pin. I'm not sure what the led ring you want costs, a 30 led strip isn't real cheap but can be hacked.

A button takes 1 pin. That's 4 pins total without any speakers.

An ATtiny85 runs about $1 and has plenty of room to handle the player, the leds and the button. Code it right and it'll do all 3 at the same time. It is also less than half as long as a 168P/328P.

Sure you could use more controller, it'd just cost more. And maybe you should surf youtube and hear the quality of sound an Uno can generate which is cheesy at best.

Pi Zero will take over a minute to boot up each time you switch it on, and burn through your battery charge very quickly, even if doing nothing.

Have you heard recorded sound samples played back on an ATmega chip? Pretty rubbish, and you would still need an amplifier circuit to drive even a small speaker. DFplayer Mini takes care of all that.

How many do you intend to make for £15 each?

If the sound quality is low, the file can be small. If you never give specs it won't matter anyway.

GoForSmoke:
You did mention a budget?

On eBay an MP3 player module with microSD slot and serial interface runs about $3. It takes 2 pins and has all the sound on the card. The DFPlayer mini uses an older version of what the Catalex module does but is more compact.

A WS2812 led string takes 1 pin. I'm not sure what the led ring you want costs, a 30 led strip isn't real cheap but can be hacked.

A button takes 1 pin. That's 4 pins total without any speakers.

An ATtiny85 runs about $1 and has plenty of room to handle the player, the leds and the button. Code it right and it'll do all 3 at the same time. It is also less than half as long as a 168P/328P.

Sure you could use more controller, it'd just cost more. And maybe you should surf youtube and hear the quality of sound an Uno can generate which is cheesy at best.

Ok so where I am, the Pro Mini is about £2.25 each. The ATtiny85 is about £1.50 each, and the mp3 module is £1.50 each. So they would be more than just a mini.

However it seems that the arduino just isn't sufficient to play any kind of sound (even a simple one), which would mean requiring the mp3 module regardless. In which case the Attiny85 is the better option, as I'd no longer need the on board memory anyway.

PaulRB:
Pi Zero will take over a minute to boot up each time you switch it on, and burn through your battery charge very quickly, even if doing nothing.

Have you heard recorded sound samples played back on an ATmega chip? Pretty rubbish, and you would still need an amplifier circuit to drive even a small speaker. DFplayer Mini takes care of all that.

How many do you intend to make for £15 each?

The current 'order' is 5 units. More may come in future. But obviously I'm also hit with prototyping etc which is why the actual 'build cost' needs to be kept to a minimum. £15 each is a goal, less is better.

You can get 5x pro mini 3.3V for £6~7 or 5x Digispark for £5, and 5x DFPlayer mini for £5~6, on Ali Express.

PaulRB:
You can get 5x pro mini 3.3V for £6~7 or 5x Digispark for £5, and 5x DFPlayer mini for £5~6, on Ali Express.

Deadline for the build is end of september. Aliexpress shipping is 1-2 months. So it goes from either 'fine' or 'way too late'.

I'm mostly sourcing from banggood, which is at least less than a month for delivery.

Another question though - Is a single 18650 actually enough to power one of these speakers (this) ? I have seen some threads that say an arduino has nowhere near enough power to run the speaker (or at least it would be quieter than a piezo buzzer), while others say it's fine. Seems noone came to an agreement by the time the threads ended.

nirurin:
Deadline for the build is end of September.

If a "deadline" is involved, I don't think you should be coming here (let alone reddit). Not because you will not find all the information, but because I think you have much bigger problems. :astonished:

nirurin:
Another question though - Is a single 18650 actually enough to power one of these speakers (this) ? I have seen some threads that say an Arduino has nowhere near enough power to run the speaker (or at least it would be quieter than a piezo buzzer), while others say it's fine. Seems noone came to an agreement by the time the threads ended.

Fixed your link.

That looks pretty expensive even for five! I don't recall whether an LM386 will actually work at 3.7 V or whether the sound output at that voltage would be particularly useful. The speaker alone is 8 Ohms, so to drive it directly from an Arduino you must have a capacitor (electrolytic, about 47 µF or so) and a 100 Ohm resistor in series with it. Suggest you try it on your Arduino with the tone() function.

Paul__B:
If a "deadline" is involved, I don't think you should be coming here (let alone reddit). Not because you will not find all the information, but because I think you have much bigger problems. :astonished:
Fixed your link.

That looks pretty expensive even for five! I don't recall whether an LM386 will actually work at 3.7 V or whether the sound output at that voltage would be particularly useful. The speaker alone is 8 Ohms, so to drive it directly from an Arduino you must have a capacitor (electrolytic, about 47 µF or so) and a 100 Ohm resistor in series with it. Suggest you try it on your Arduino with the tone() function.

'Deadline' meaning thats when the first event is that they would use it for. If it's not completely ready by then, they can still use the prop without the extra bells and whistles. It's just the ideal date I'd like to have it finished by.

I honestly didn't see the problem... I can't imagine it takes two months to program an arduino to turn on a light and play a sound. Am I wrong in thinking that?

Looking again at speakers, I think those are that price because they come with an LM386 amplifier unit as well. Which I believe is being used so they can run from a 5v source. If this is a requirement then I'd have to get the amplifiers as well as the speakers? Or does the DFmini have all that taken care of?

Edit: Sorry re-read your message and I see you mentioned the LM386 yourself. I'd have to buy the parts in order to test them myself, and then if they don't work as they should that would be the entire budget wasted before I even started so it's not really an option unfortunately.

Edit 2: Considering the simplicity of what I'm trying to do, I wonder if there's a better option out there. If I drop the complicated part where I'm making the LED's light up based on battery level, all I need is for a sound file to play on a button press, something that can be done with a birthday card.

nirurin:
However it seems that the arduino just isn't sufficient to play any kind of sound (even a simple one), which would mean requiring the mp3 module regardless. In which case the Attiny85 is the better option, as I'd no longer need the on board memory anyway.

What I wrote was that the sound quality is low. How you can get to your conclusion from that and what else was posted tells me that your project has a weak spot somewhere behind the keyboard.

The pro mini for $2.25 gives you more than the chip. Why don't you find out what sounds the chip can make since YOU are the only one who can say what is good enough. There are plenty of old finished projects that do the boop boopen beep.

GoForSmoke:
What I wrote was that the sound quality is low. How you can get to your conclusion from that and what else was posted tells me that your project has a weak spot somewhere behind the keyboard.

The pro mini for $2.25 gives you more than the chip. Why don't you find out what sounds the chip can make since YOU are the only one who can say what is good enough. There are plenty of old finished projects that do the boop boopen beep.

That wasn't in response to what -you- said. It was in response to me figuring out that in order to run a sound file from the ATtiny I would also need an amplifier chip, at which point I may as well just use a DFmini anyway for the same cost.

However for the sake of simplicity and cost, I have instead found a sound chip which can hold a full high sample rate mp3 file and play it back upon a button press, and has a built-in amplifier. Works out significantly cheaper than the previous options too. Surprised noone on here suggested it, but I guess you were restricting your comments to arduino-only solutions.

Not sure why you decided to get hostile and insult me. I'm a total beginner coming to a beginners forum for help, and you decide to go elitist 'oh problem with your project is sat at the keyboard' on me like I'm some sort of idiot for not being a 10 year arduino programming veteran on my first day. I suggest you take a long look at your reasons for coming on this forum before you try and help any other beginners.

To everyone else who helped though, I really appreciate all your advice. It helped me to think through my actual goals for the project and find the solutions that worked best for me. I'll come back again once I've sorted out a much more refined plan of attack, so I don't end up confusing people :slight_smile:

Thanks everyone!

Thanks for telling everyone what this new sound device is. The winners in ease to wire up and get working for me are the Catalex and the DFPlayer Mini, the rest (I tried a few) were not what I'd recommend.

You're short with people yourself but I'm sure that's your privilege.