Hi All,
So I am an absolute beginner when it comes to arduino, and I have a massively complex project I need to make, and it was suggested to me that I try using an arduino for the whole thing.
So the general gist:
The modes (controlled by a disguised thumb switch having five positions) are:
Off: default mode, all functions cease
Alarm: In this mode, should anyone move the item without changing the mode within five seconds, it will produce a loud wailing scream and the lights should turn on.
Button: in this mode, pressing on any of the four buttons causes the function of that button to occur (see below)
Unattended: in this mode, the item will, at irregular intervals not less than 30 seconds apart and not more than 2 minutes apart, perform the function of any one of the buttons which won’t last for more than five seconds.
5.Turn on the Lights and leave it on.
The buttons are:
A big sound kind of like the THX sound effect or something similar
Gong sound
Cow Mooing sound
Fairy bells or tinkling, magical kind of sound
Any hints, suggestions, commiseration's, or general finger pointing in any direction is greatly appreciated!!!
I'm sure that's doable. But you would need to get your hands on an Arduino and a few odds and ends and learn the basics first, so that you can then think through the various parts of the project.
You would, for example, want to get it clear how to read that 5-way switch, and how to read the 4 buttons. From there you can get your mind round structuring the logic of the project. There will be a lot of decision points in the code, along the lines of "if this happens AND that happens, do such-and-such; but if this other thing happens and that one does, then do a different-such-and-such". You'll need to get that clear in your head first.
Do you have any programming experience? You'll get loads of help with your code here, provided you go first....
The flavour-of-the-month in the forum right now is the notion of the "state machine" and you might like to look at that meantime. This would be a good place to start. Most folk don't dive into stare machines in time- cobble some code together to start with to do some of the project which is cool, but as the code gets more complex as you add further functions the code gets very unweildy. State machines help keep it all clean.
If you put a lot of effort in up-front, eg with the whole state machine idea, your coding will be a lot easier.
But in parallel with that, probably an idea to get your hands on a Uno and some components, perhaps a Starter Kit, and get your hands dirty.
(Ps, you talk of "the object" and "the lights".... what does that mean? And what does it mean to move it? A tiny nudge, or lift it up, or what?)
Incremental. Break the project into ever smaller pieces until each piece is doable. Then combine the smaller pieces, one at a time, until it becomes what you want.
Details. Pinning down details early makes a big positive difference.
For example...
• Some of the sounds can be generated with the actual thing. For example, do you want the gong sound to be made by an actual gong?
• How loud do you want the sounds? Cranked to 11? Speaking voice volume?
Robin2:
My reading of the first post is that the OP plans to have a 5-way thumb switch and he is just interested in whether anyone moves it.
My reading is that the thumb switch just selects the mode of the item, and there is a separate requirement to detect when the item itself has been physically moved. The fact this mode is called Alarm mode supports that interpretation.
You will find that your project will be easier to accomplish if you define it more precisely.
How big is it and what will it look like?
How heavy will it be? This may affect how you determine if it is moved.
Define your lights. As it is, they could be anything from a tiny LED to a wartime searchlight!
For your sounds, you'll need a loudspeaker. How big will this be? A 12" woofer will make it difficult to move!
Define how much movement will be needed to sound the alarm. In other words, how sensitive to movement must it be. If it will only be sensitive to being picked up, a microswitch in the base will suffice. If you want it to be sensitive to, say, being slid along your desk/table without being picked up, you'll need an accelerometer or infra-red device (think ball-less mouse).
EDIT: If you want it to be sensitive to touch you could use a capacitive sensor.
Define your thumbswitch. Will it be an edgewise rotary switch or a micro joystick (the sort of thing used on old laptops to control the cursor position) ?
Your project can probably be done, depending on the above, and it isn't as massively complex as you believe it to be. I second Coding Badly's advice to go incrementally. "Slowly, slowly catchee monkey."
I sincerely appreciate all of your comments, and I am doing my homework as I type.
I have purchased the arduino uno kit, and i am slowly making my way through all of the applicable tutorials on coding etc.
I have small bits of electronics experience, but nothing this major. But hey, I like to challenge myself!!
So my plan is to narrow down all of the functions and then try and take things one step at a time.
one quick question….. Which part should I start w. first? (i.e. is there a specific order I should do things?)
lights then sound then alarm?
Henry_Best:
You will find that your project will be easier to accomplish if you define it more precisely.
How big is it and what will it look like?
I hope to fit all of the electronics into as small a space as possible(The size of a 16 oz water bottle) but the entire thing will be about 6ft tall, think magicians staff type thing.
How heavy will it be? This may affect how you determine if it is moved.
overall, hopefully less than 15lbs?
Define your lights. As it is, they could be anything from a tiny LED to a wartime searchlight!
3 to 4 rgb LEDs
For your sounds, you'll need a loudspeaker. How big will this be? A 12" woofer will make it difficult to move!
as small as possible, but able to be heard from a few feet in a large crowd.
Define how much movement will be needed to sound the alarm. In other words, how sensitive to movement must it be.
If the item is picked up, then the alarm will sound, but I plan to make the base out of steel, so including a pressure switch might be tricky.
Define your thumbswitch. Will it be an edgewise rotary switch or a micro joystick (the sort of thing used on old laptops to control the cursor position) ?
A slide switch? or a rotary sounds like it might work, but something that is very unobtrusive, and easy to hide.
neanabird:
one quick question….. Which part should I start w. first? (i.e. is there a specific order I should do things?)
lights then sound then alarm?
I doubt it makes a huge amount of difference.
To me, it's important to get the design right as early as possible, the philosophy, the approach, whatever you want to call it. Otherwise you run the risk, in a relatively complex project like this, of getting part A right in isolation but find it prevents you doing part B without undoing half of part A.
Also, I strongly advise getting Blink Without Delay under your belt asap. Blink (with delay) is one of the things you are likely to learn first in any tutorials, and it tends to lead to "ah, i'll just do this with delay()" approach in everything. That's one of the things that will scupper you later, when A works with delay() but you then can't do B at the same time.
Edit.... This is a very useful video. It shows Blink Without Delay being used to time 2 things independently.
neanabird:
6) Define your thumbswitch. Will it be an edgewise rotary switch or a micro joystick (the sort of thing used on old laptops to control the cursor position) ?
A slide switch? or a rotary sounds like it might work, but something that is very unobtrusive, and easy to hide.
Using a slide or rotary switch will mean that switching, say, from the first position to the last will mean that every intermediate position will be passed through and, therefore, you'll need some method of 'blanking' the intermediate connections. You don't want the alarm going off, even for a short while, when you're just trying to switch on the LEDs. That might would give the game away.
Does the magician wear gloves during the act? If so, you can hide a small magnet in one and use hall effect sensors to detect where the wand is being touched. Nobody examining the wand will see any sort of switch or contact, nor be able to change the settings. No gloves? Then how about a 'magic' ring with a magnet hidden inside it? Or simpler still, use an ordinary ring to bridge two contacts. The contacts will be visible, but can be disguised.
EDIT: Obviously, you'll not be able to use the magnet/hall sensor if the tube is iron or steel.
neanabird:
If the item is picked up, then the alarm will sound, but I plan to make the base out of steel, so including a pressure switch might be tricky.
A tilt/trembler switch would probably do the trick. What is the tube made of?
#2) is to pay particular attention to item #6, read that carefully.
#3) pay particular attention to item #7, read that carefully and refer to it until you have it down pat.
once you have mastered that, I would offer that lighting LED's particularly the blink without delay, will be of vital importance for your.
If you can light LED's in the order that you want to do other things, well, you know you can because you did !
This comes from the fact that you have 1 of two problems. either software or hardware. if you are familiar with the hardware, then the only problem is the software.
once you get the software to work with hardware you know, then swapping out the hardware allows you to know your software is right and that the only problem is the stuff you changed.