Need help making an up down counter to replace a rotary switch.

Discussion in 'The Projects Forum' started by Brian1, Oct 31, 2010.

  1. Brian1

    Thread Starter New Member

    Oct 30, 2010
    First I am not experienced in IC circuitry but have an understanding of different gates and basic electronics. Need some help on making a circuit that can take a place of a rotart 5 position switch. The requirements is power relays to make the 5 different positions and also have a 7 segment display showing current switch position 1 to 5 using an up and down momentary buttons. I have been playing with Yenka software and made a circuit that of course works the way I need it to. The single LEDs on the 4028 should actually be a SPST relay.

    Maybe I am over thinking this.

    In the Yenka software when powered it jumps from 0 to 1 with the use of the 74132 IC of pin Q0 on the 4028 chip. So this will display 1 on the 7 segment display and sends the Q1 to output on the 4028 chip. I press the Up button and it displays 2 and and Q2 output is active on chip 4028. Now pressing up again and again till it hits what would be displayed as the number 6 on the display will again power the 74132 gates to cause it to go back 1 back to 5.

    Now I have prototype this circuit on a breadboard with a regulated 5v power supply but it will not change up or down pressing either up or down button. I made it simply as in Test Image #1 and not used any of the 74132 gates, 74266 gates or the 4511 and 4028 chip. Just connected leds to the out Q1,Q2 ,Q4, and Q8 on the 74192 and press up or down buttons and no change to the outputs. Here is where I am at a lost.

    I have no problem starting from scratch again but as to the result is the following. Power on and start on #1 display and activate #1 relay. I would try a PIC circuit but have no programming knowledge on that. Display 1 to 5 and activate the correct relay for the output.

    Power up and display 1 on the 7 segment display and activate 1 of the 5 relays.
    Press UP button and display 2 on the 7 segment display and activate the next relay.
    Same UP till you hit display 5 on the 7 segment display.
    Press UP again will result a return back to 5 on the Display and its connected relay.
    Press Down button will be the oppisite but once you Hit 1 on the display and press Down again will cause it to return to 1 on the display and its connected relay.

    If someone can make me a circuit that works I be extremely grateful for it and pay well for it.

    Thank you to all that can help me out.
  2. MMcLaren

    Well-Known Member

    Feb 14, 2010
    Hi Brian,

    Could you use something like this PIC microcontroller based circuit?

    The PIC debounces the switch inputs and drives both the 7-segment display and the MIC5841 serial-to-parallel relay driver IC. The 'K' connection on the MIC5841 connects the suppression diodes inside the IC to your +V source for the relays.

    Lots of other options too. Let us know what you're lookin' for.

    Cheerful regards,

    Mike McLaren
    Micro Application Consultants
  3. eblc1388

    Senior Member

    Nov 28, 2008
    You are doing the pin logic level incorrectly. Try this:

    Edit: just noticed you have use 74192 instead of the 74HC192. You can use 1K instead of 10K for the three resistors then.

    Last edited: Nov 1, 2010
  4. john-louis

    New Member

    Oct 27, 2010
    Agreed, though on your origional cct you have 2 XNOR gates, thus the output will be 0 to the chip normally until you press your button and the inputs to the XNOR both = 0 (or 1).
    Your method of trapping the erronious outputs is rather strange, in that you allow them but then simulate button presses to correct them. I would use two AND gates spliced in between the buttons and the IC directly, and operate the AND gates based upon the binary output from the IC in order to enable and disable them, currently holding "UP" will cause it to oscillate.
    - A x
  5. Brian1

    Thread Starter New Member

    Oct 30, 2010
    I like the simpleness of that. But programming is nothing I have done yet. But again like it.

    Had to quickly make the circuit again since i had to reinstall OS. So Reset news to be ground even if is not being used? Is that what i am seeing? Yes to the 74HC192. Brain was quicker than the fingers.
  6. MMcLaren

    Well-Known Member

    Feb 14, 2010
    You did say you'd pay for a working design, right? Please tell me what you want (we'll write the program for you).

    Regards, Mike McLaren