Print Page | Close Window

different outputs based on button pushes?

Printed From: the12volt.com
Forum Name: General Discussion
Forum Discription: General Mobile Electronics Questions and Answers
URL: https://www.the12volt.com/installbay/forum_posts.asp?tid=109718
Printed Date: May 07, 2024 at 7:35 AM


Topic: different outputs based on button pushes?

Posted By: sk8rjess
Subject: different outputs based on button pushes?
Date Posted: December 13, 2008 at 6:21 PM

im just getting into working with electronics such as building simple devices and whatnot so dont bash on me too hard!
i even went out to radioshack and bought one of their electronic kits ha.

but ive got a question hopefully someone can help with maybe a diagram or whatnot.

i just need a circuit, that when a certain momentary button is pressed once in five seconds it will have one output. and if its pressed twice in 5 seconds it will have a different output.

im thinking it will be using a 555 timer?



Replies:

Posted By: KPierson
Date Posted: December 13, 2008 at 8:47 PM

The easiest way to do that would be to use a programmable microcontroller.  They greatly simplify time delays and you can do everything you want with one 8 pin chip.  Of course the catch is you have to be able to write a program, download it, and then test it.

If you go with a brand like Atmel AVR you can get the programming software for free, you can build a programmer for less then $3, and you can buy the chip itself for $1.50.  There are great intro to AVR programming sites on the net and this would be a perfect "first" project.



-------------
Kevin Pierson




Posted By: sk8rjess
Date Posted: December 14, 2008 at 8:20 PM
ahh thanks!
i found this one HERE

but it seems its only a temp since its using a breadboard.

do you have a certain one to recommend?
hopefully using parts from radioshack lol.




Posted By: KPierson
Date Posted: December 14, 2008 at 8:41 PM

Radioshack doesn't sell Atmel parts - you'll need to order them from Mouser or Digikey or some other parts place.

To write your program you'll need to download AVRStudio from www.atmel.com.  You can then download a program called PonyProg (https://www.lancos.com/prog.html) to download the .hex file you create to a chip through a parallel port (assuming you have a parallel port).  I built a parallel programmer years ago using only a couple of resistors and it worked great - I'm sure if you are interested you can find the circuit somewhere.

This is a great page to get the programming basics: https://www.avr-asm-tutorial.net/avr_en/beginner/index.html   The program you will need is pretty basic and shouldn't be difficult to write as long as you have some time and patience.

As far as hardware, I would use a Tiny12 or Tiny13.  Both are 8 pin ICs that are more then capable of doing what you want.

If you are interested and need help with the software let me know - it shouldn't take me more then 10 mintues to write something that works.



-------------
Kevin Pierson




Posted By: sk8rjess
Date Posted: December 15, 2008 at 7:21 AM
perfect.
ill look more it this after work.




Posted By: sk8rjess
Date Posted: December 15, 2008 at 7:25 AM
and i might have to buy a programmer.
i only use an dell xps m1730 and it doesnt have a serial port. i'd need a usb interface.




Posted By: KPierson
Date Posted: December 15, 2008 at 8:15 AM
What are you trying to do?

-------------
Kevin Pierson




Posted By: sk8rjess
Date Posted: December 15, 2008 at 10:27 AM

i just need a circuit, that when a certain momentary button is pressed once in five seconds it will have one output. and if its pressed twice in 5 seconds it will have a different output.
and you recommended using the 8bit controller for that but in order to actually program it I will need a controller programmer. if I built on thhen i'd have to use a serial port to program it, and my laptop doesn't have a serial port. so I guess im just going to have to buy a usb programmer since I can't build one.

lol hope that's not confusing?




Posted By: sk8rjess
Date Posted: December 19, 2008 at 7:57 AM
or what about a more simple circuit.. send power when a momentary button is pressed, turn off when its pressed again. just like a motherboards on/off switch





Print Page | Close Window