theredstealth Posted February 28, 2007 Report Share Posted February 28, 2007 I am come what new the the electronics field. I am looking into making some sort of controller but my knowledge is very limited. Any help would be most appreciated.Anyway, what I am looking to do is make some sort of controller like a volume or channel button on a remote control. So there will be two buttons, if i hit 1 button it will move up 1 selection in a series of four selections, if I hit the other it will go the other direction in the series of selections. There will be 4 possible selection. This will be done to turn on and off two objects. So selection 1 would be both objects off, selection 2 would be object 1 on and object 2 off, selectiion 3 would be both on, and selection 4 would be object 1 off and object 2 on.Is this possible to do?Is there something like this already made?And please dont let my lack of knowledge lead to a false judgement of me, I am a quick and eager learner.Thanks for your help, Tony Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 3, 2007 Author Report Share Posted March 3, 2007 nothing at all? Quote Link to comment Share on other sites More sharing options...
MP Posted March 4, 2007 Report Share Posted March 4, 2007 Tony,I suggest you go through the projects in our projects section to see if there are some elements that can be put together to achieve what you are wanting to do. At the top of the page, you will see a blue button (link) named projects. Click on it and it takes you to an impressive sized library of projects that have been uploaded to this site.MP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 8, 2007 Author Report Share Posted March 8, 2007 Tony,I suggest you go through the projects in our projects section to see if there are some elements that can be put together to achieve what you are wanting to do. At the top of the page, you will see a blue button (link) named projects. Click on it and it takes you to an impressive sized library of projects that have been uploaded to this site.MPI should have thought of that, lolI think I found something that might workSee attached image;Its from the project for the digital volume controller.Ignoring the parts for actual volume control(crossed out in red), I could use the rest of the controller to do what I was thinking of correct? Only I now have the option of 16 outputs instead of the 4 I was looking for.What do you think? Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 12, 2007 Author Report Share Posted March 12, 2007 no comments? Quote Link to comment Share on other sites More sharing options...
MP Posted March 13, 2007 Report Share Posted March 13, 2007 If I understood your original post correctly, you are wanting a device that will send out gray code to a set of LEDs. Gray code is what you send to a stepper motor in half step mode. It looks a lot like binary code. Each time you have a pulse to the stepper controller, you step to the next sequence. Using a 0 for OFF and 1 for ON, visualize 4 LEDs. They are all off to start. Call this 0000, next, 0001, then 0011, then 0010, then 0110, then 0100, and finally 1100. This is what causes a stepper motor to spin.If I am correct that this is what you are actually building, then you only need a stepper controller. Instead of a clocking device to step the sequence, you could just use a switch to send the pulses.Something like this might work better:MP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 14, 2007 Author Report Share Posted March 14, 2007 I think I understand the schmatics, but how does it control which way it steps. The way i see it is that it goes step 1, step 2, step 3, step 4, step 1, ect. in a continious loop. I need it to be controlled from 2 switches, one for stepping up and 1 for stepping down Quote Link to comment Share on other sites More sharing options...
MP Posted March 16, 2007 Report Share Posted March 16, 2007 You are right. It will step 1 through 4...unless you change the direction bit. This is what I though you were looking to build.MP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 16, 2007 Author Report Share Posted March 16, 2007 You are right. It will step 1 through 4...unless you change the direction bit. This is what I though you were looking to build.MPnot exactly, I am wanting it to work like that but the control is not what I want. I need it to be controllered by 2 switches without out having to change the direction of step in the sequence, to where switch 1 always steps up regardless of where it is in the sequence and switch 2 always steps down regraudless of where it is in the sequence.The best example i can think of is like the channel changer buttons on a TV or the seek buttons on a digital radio Quote Link to comment Share on other sites More sharing options...
MP Posted March 17, 2007 Report Share Posted March 17, 2007 Your easiest solution is to use microcontroller. Although this sounds like a big step, it really is not for such a feat. You can even use basic to program the chip. One inexpensive solution is to use an ATMEL chip (around $7) and the free version of BASCOM AVR program. You do not need a programmer since AVRs can be programmed in-circuit. You can use an 8 pin port as output, which means 8 switches. 2 pins on another port can be used for the control buttons. Call then switch A and switch B. Yuo can program the micro so that whenever switch A is pressed, the output port equals the output port + 1. You can progran the micro so that whenever switch B is pressed, the output port equals the output port - 1. Other combinations are also possible. Since you are using a micro, you also have the capability to add an LCD display and to send something to the serial port if you wanted. Since you can program a micro many times, it is easy to make a change in the program should you decide you want to add a feature, etc.MP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 17, 2007 Author Report Share Posted March 17, 2007 that sounds like exactly what I needwhere do I find the parts and schematics? Quote Link to comment Share on other sites More sharing options...
MP Posted March 17, 2007 Report Share Posted March 17, 2007 I recommend the AtTiny2313 for a simple project like this. It has an internal oscillator, so you don't have to buy a crystal or resonator.The data sheet is here: http://www.atmel.com/dyn/resources/prod_documents/doc2543.pdfI am not sure where you live, but Digikey.com has them in prices ranging from $1.30 to $2.25 in qtys of 1 each. You can get the free version of BASCOM AVR at www.mcselec.comThe free version only has limitation on the amount of code that can be written. That limitation is more than what the 2313 is capable of. In other words, you will never need to buy the purchased version when using this chip.The LEDs can be connected to the output ports with a resistor in series. The port iwill output 5 volts when in a high output state. Just use ohm's law to determine the resistor. I use 4K7 for most projects, but you can use a smaller value to get a brighter LED. Just don't exceed the manufacturer's specs for the LED and don't pull more current through the chip than needed to accomplish your goal. The switch can be any momentary switch connected from the input port pin to ground. Also tie a 4K7 resistor from this port pin to the 5 volt buss. This keeps the port in a high state until you press the momentary switch. Then the port is momentarily in a low state, and then high again. You will base your code on this principal.Let me know if you need more information.MP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 18, 2007 Author Report Share Posted March 18, 2007 wow, that helps alot, I really appericate the help. I can already think of a slue of other things I can use this for. How would I go about use it to switch on higher voltage things like for a 12V auto system, would a simple relay work or is there a chip that would do the job??I just hope its half as easy as it sounds, lol, can wait to try it out!! Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 18, 2007 Author Report Share Posted March 18, 2007 After doing some research i developed another question.How do I program the microcontroller? do I need to buy one of those "starter kits" I see in the same product page or is there another way?What package/case should I get? I find the same controller w/ 13 variations(less than half are in stock, lol) I think I have figured it out and have a feeling this is a noob qeustion, but I wanna do it right.And also I do live in the US so getting parets shouldnt be a problem Quote Link to comment Share on other sites More sharing options...
MP Posted March 18, 2007 Report Share Posted March 18, 2007 Download the Bascom AVR program. In the help file, it shows how to make a cable to program the chip from your parallel port. That's what is nice about the AVR. You don't need to buy those expensive programmer boards.You just make your board, add a header to it for the programming cable and you are all set.I recommend you purchase the PDIP package. This is the DIP package with through hole pins.MP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 19, 2007 Author Report Share Posted March 19, 2007 thanks for all the help manIm gonna get started on this ASAP Quote Link to comment Share on other sites More sharing options...
theredstealth Posted March 19, 2007 Author Report Share Posted March 19, 2007 I was looking to place an order and couldnt exactly tell which to gethttp://www.digikey.com/scripts/DkSearch/dksus.dll?KeywordSearchThey only have 2 that are DIP in stock and the only difference I see between them is speed, one is 10 mhz and the other is 20 mhz, or am I completely off? Quote Link to comment Share on other sites More sharing options...
MP Posted March 19, 2007 Report Share Posted March 19, 2007 Yes. There are some different speeds and there are some package types that work at extended temperatures, etc. It does not matter since you will use the internal oscillator. Just get the cheapest dip package available. If you were using an external crystal, you would need to select the proper one. If you want more speed, you can certainly go this route. Just purchase a 10 or 20 mhz resonator. But it is not necessary. This processor executes one instruction per clock cycle. Since the internal oscillator speed is 128 KHZ, this means you can execute 128,000 instructions per second without adding an external oscillator.MP Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.