Hello, I work for a prototyping company. What I have in front of me seems simple and very easy using Arduino and it's many friends. I need to control 6 servos (micro linear Spektrum type) to open and close small doors. 6 doors with 4 commands each as follows. FYI to be controlled via IR or RF remote... doors will be used to control scent and regulate how strong via how much the door is open.. commands from remote will be as follows.
ALL OFF,.. each scent will have three buttons as follows HIGH/MED/LOW ...I have the following hardware..servos, uno board, 12channel flyduino, Xbee pro shield 1.4, Xbee pro S1, digital IR receiver module for Arduino, simple IR remote. I'm not 100% sure I have all the things needed at this point and would really appreciate any advice or input. Thanks, :~ Kaz
each scent will have three buttons as follows HIGH/MED/LOW
You are not going to get very far thinking this way. The scent is. It is as strong as it is.
The device will have the ability to expose more or less of the scent.
Links to some of the devices you list would be useful. I know what a UNO is, but what is a flyduino? How is that related to the XBees? What role are they playing? What is the IR remote for?
Might I suggest that you start simpler. Use some switches. When you can deal with switches for input, then use the IR for input. When the whole thing works wired, then go wireless.
Hello,
This is a link to the Flyduino... http://www.jameco.com/webapp/wcs/stores/servlet/ProductDisplay?search_type=jamecoall&catalogId=10001&freeText=flyduino&langId=-1&productId=2159470&storeId=10001&ddkey=http:StoreCatalogDrillDownView
As for the scent and working aspect of this project, it's been completed and works as designed. However, this step will make the box wireless and controlled via remote like a ceiling fan etc.. I have been messing around with my hardware and have all 6 servos working at set positions with a 10k pot on each channel. I would like to use my IR setup for the wireless end of it. Please remember this is a prototype and is used for the concept only. I will have a complete system custom made for the end product at 1% of the cost of the arduino and much smaller.
I think my next step will be decoding the IR signals form the remote I am using. Function button OFF then High/Med/Low for 6 channels.. The rmote I have will have 2 extra buttons that I will cover for now. My question is in the code it's self as I NO prior experience in C++. I was able to take some examples and build off of them in just a few hours so I proved to myself I can do this with some help.
I may be able to control my servos with this Flyduino board without the uno. If so, the Flyduino is 1/4 the size of the uno and cheaper. It has a XBee header on it so maybe I can use the IR setup on it as well?
Yeah, you can do all of what you are trying to do. I don't know a ton about the motors, and doors, but it should be pretty easy to figure out. There's tutorials all over the place for it, and sample code to match. Just have a look around.
I've been using the IR library here A Multi-Protocol Infrared Remote Library for the Arduino with my arduinos and it's been really easy to get working by just following the sample code. That, and a cheap IR sensor and remote is all you really need.
I also used the tutorial at Overview | IR Sensor | Adafruit Learning System to help with the wiring and a few other things.
For RF, I just got a few of these in today and am just about to sit down to play with them some. Simple RF M4 Receiver - 315MHz Momentary Type : ID 1096 : $4.95 : Adafruit Industries, Unique & fun DIY electronics and kits
They're pretty inexpensive, and should be good for prototyping and playing with. The matching key fob/remote has four buttons that are recognized individually by the receiver so they should be easy to program for what you are doing.
EDIT-just hooked up and tested the RF receiver/remote, and they work great. The range is not as big as I'd wanted, but it's good enough for what I'm doing.
All the elements you need to build your solution seem easily achievable and you should have no problem finding examples of each part. Your only challenge will be to integrate them together, which should be easy enough if you can cope with a couple of hundred lines of code and some simple electronics.
kaz321:
I will have a complete system custom made for the end product at 1% of the cost of the arduino and much smaller.
It seems to me that the cost of the servos, power supply and operating mechanisms will dwarf the cost of the Arduino, even if you use one of the standard boards. You can reduce the cost of the Arduino by using a clone or building your own standalone Arduino, but that's hardly going to make any difference to the overall cost.
Good morning,
Thanks for the input so far. Last night I setup all SIX linear servos inside my box and ran it all nite from 7:30 pm and I just walked in the door 8:30 am ish EST... All still working as planned for my test run for hardware side of things.. First, cost is not an issue right now nut I am trying to keep it on the lower end of the scale in case I need to start from scratch again. My biggest obstacle is my limited knowledge (none) with code. I am pretty smart and will eventually figure it out I'm sure. However, I have many other projects needing my attention and are piling up. If I only had a few hours to talk one on one with someone to go over the basics and help with some code it would be great!
At this time I can decode my IR remote but it seems like all the codes are coming back the same..
I push the power button.. I get 10 ms codes like
56, 54,
60, 56,
60, 52,
58, 52,
56, 54,
etc. the next button will pull the same codes in a different order. How do I tell the servo on door 1 to do its thing when it gets that code? This is my first time playing with this stuff so I don't have the basics to build off of.
I don't really need to use RF for this project the IR will be fine. However, It would be nice to learn about it since I have the hardware already but it's not my number one concern at this time.
I am using micro linear servo SPektrum SPMSA2030LO 2.3 gram and seems to be a perfect match as the UNO has a 3.3v pin needed for the servo already. I have 4 stops for my doors in High/Med/Low Closed/OFF positions.
kaz321:
At this time I can decode my IR remote but it seems like all the codes are coming back the same..
Clearly you haven't got the decoding working yet. You aren't the first person to tackle the problem. Have you looked at other people's working projects to see how they did it?
I have been looking around but all I find are dead ends it seems. When I push a button on the IR remote I get a bunch of codes alot like other posts I read..Only I have know clue what I am looking at. right now I have a 6 channel R/C remote hooked up so I can control it remotely but I would really like to get this thing finished up today. All I need is the right code. I would be willing to barter some hardware plus shipping charges if someone will write this code for me so I can tinker it on my end. I hate to take the easy way out but I don't have much time. seems like it would be a few hours to get this thing working if you knew what you were doing.
See: http://arduino-info.wikispaces.com/IR-RemoteControl
on the http://ArduinoInfo.Info WIKI.
Use the first example to be sure you have all the codes working...
Proposal for writing this code for me
I have a full wood shop and metal shop along with a full stock pile of metals, plastics, wood, fiberglass etc.. I will make a small part for you or barter some extra Arduino hardware I have and will not be using right now.. I will provide all the information needed to write the code upon request and when a deal is made.
I copy and paste the code and I got " IRrecv does not name a type "...this is about the tenth time a copy and past code and it doesn't work
OK, I installed the IR library from shirriff...all works great first time. now what? how do I use the codes and which ones?
I mapped out my remote key pad with what seems to be simple codes like FD807F... now how do I tell the servo to move when that button is pushed?
kaz321:
I mapped out my remote key pad with what seems to be simple codes like FD807F... now how do I tell the servo to move when that button is pushed?
Well, I would first print out the values that you get from
results.value
and store them in constants at the top of the program. Then, use if statements (or a switch case statement) to determine what which button it is and put your servo move code inside the if statements.
there should be some example code for it, but basically you will need to do something like this in your loop():
If(Received_Code == Expected_Code){
MoveServos();
}
The library should only return the code once, and then a blank code to indicate that the button is still pressed, so that should work. Just replace Received_Code with whatever you detect from the receiver, and Expected_code should be the value needed to trigger the action.
MoveServos() is whatever should happen when that button is pressed.
Check out some of the arduino tutorials. You could probably go through the basics in a few hours, and have this up and running very quickly.
EDIT---and what Arrch said. He posted while I was writing. Storing the values as constants is a great idea and can make the code much easier to read.
Sorry guys, maybe a sample code and I can tinker it from here out.
FD00FF is the off button
FD20DF is High, FD906F is Med, FD50AF is Low
remote has 3 buttons across and 7 rows I will use each row for 6 high/med/low channles
power is top left and i will have 2 buttons not in use when finished
Ir is on pin 11
servo 1 thru 6 will start on pin 2 thru pin 8
value positions are as followed
OFF servo is at 0
high 180
med 110
low 70
10 ms for speed travel
when ANY button is pushed it must override current position to all other servos.. example, servo 4 is on med and you call for servo 3 to be in high, servo 4 must close before 3 moves into position
kaz321:
remote has 3 buttons across and 7 rows I will use each row for 6 high/med/low channles
My math might be a little rusty, but that means you have 21 buttons in total, but only know the value of 4 of them.
Sorry guys, maybe a sample code and I can tinker it from here out.
void setup()
{
}
void loop()
{
}
Have at it!
I have the value for all 21 however I didn't want to give more info then needed. all six servos will do the same thing so I was thinking I can just copy and paste the code for the other commands. do you want the other codes? I can draw it in google sketchup and label the buttons. The values I gave you would be used to control the #1 servo in pin 2
kaz321:
I have the value for all 21 however I didn't want to give more info then needed. all six servos will do the same thing so I was thinking I can just copy and paste the code for the other commands. do you want the other codes? I can draw it in google sketchup and label the buttons. The values I gave you would be used to control the #1 servo in pin 2
It sounds like there is an expectation that I am going to be writing the code for you. I wasn't aware this was my project. If I was writing it, I would start by putting all of those values in a constant multidimensional array.
I'm not expecting anyone to write it. I am simply looking for a helping hand if nothing else..I can read what is online and i have three books. I'm in over my head at this point and need some help. I will be looking into classes to help me out with the basics but for now I need to wing it. alot of the terms is what seems to be killing me. I read what is written but it doesn't make sense right now. "constant multidimensional array" ?