Connect with us

Small Circuit needed for New Product Design - Help!

Discussion in 'General Electronics Discussion' started by D Hancock, May 23, 2014.

Scroll to continue with content
  1. D Hancock

    D Hancock

    16
    0
    May 23, 2014
    I belong to multiple forums but this is my first on an electronics board. I sat up late last night browsing and I have to compliment all the big brains that live here. In my spare time I enjoy creating new product solutions as it keeps me sane during down time. Anyway this particular idea requires a very simple(?) circuit design. After spending 30 min at radio shack it became obvious..they aren't what they used to be. Ok - let me get right to it. I need a power source (A). I purchased two "2.5mm tact switches" (B) and need a small digital readout LCD screed(C)(?) and last I'll need a reset switch(D). based on the size of the tact switches you may have assumed this design needs to be small; that would be correct. So basically I need the tiny display screen to register which switch is pushed (and how many times. I also need to be able to reset the display counter. I've seen some of the problems/solutions etc. you guys work on so this may seem really ridiculously simple. If you don't have a buddy who's into electronics what do you do? Come here I hope :) So here's my question - since radio shack doesn't have what I need nor where to tell me where to go...any input on this project will help me. I'll post the results of the project as it comes together. Can one of you help me. At this point all I know is what I assume and have shared. I don't know if this simple circuit is correct, where to buy the display screen. Heck all I know is that I purchased the two tact switches so anything you tell me will help get me further down the road. switch design.jpg
     
  2. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    How does your numeric display show which switch has been pressed and how many times? What if both switches have been pressed a different number of times?

    I expect what you actually want is an up / down counter, i.e. one switch counts up and the other counts down, is that correct?

    If so, here is an example of one that is available:

    http://www.ebay.com/itm/Electronic-...906?pt=LH_DefaultDomain_0&hash=item27e4666362


    Bob
     
  3. D Hancock

    D Hancock

    16
    0
    May 23, 2014
    Thanks for the quick reply Bob. Actually both switches will need to count up to 9. Based on my design it would be impossible for both to be pushed at the same time. However if that did occur than each disply digit would increase by one.
     
  4. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Okay. So it is like keeping score.

    Have you picked out an LCD display? Typically these need a separate controller. You can get PIC microcontrollers with LCD controller built in. By the way, this is not a simple circuit.

    Edit: After more research, any micro with enough pins can operate the LCD display, and the ones that have built-in controllers are 100 pins or more, so probably no practical. So you would need a micro with 14 pins for the segments, one for common, and 3 inputs for the buttons. A 20 pin PIC would be minimal.

    Bob
     
    Last edited: May 23, 2014
  5. duke37

    duke37

    5,364
    772
    Jan 9, 2011
    Or you could go for 7 segment led displays.

    You would need a simple contact bounce suppressor on each switch.
    A cmos 4093 will count to ten and drive a seven segment display.

    led displays will take appreciable power.
     
  6. D Hancock

    D Hancock

    16
    0
    May 23, 2014
    Thanks again! However think of me as very capable but ignorant in this area. I read what you said but don't know where to go next to purchase the component? Any recommendations? I may even need to pay someone (if I can find someone) to build this component?
     
  7. duke37

    duke37

    5,364
    772
    Jan 9, 2011
    I doubt if you will be able to buy what you want, you will need to make it. You should decide what you want before you start to buy. We cannot tell you suppliers unless we know where you are. Didn't Tony come from East Cheam?

    You have been given two alternative solutions, one will need programming and the other needs significant power.

    Define what you want. Power supply, size, will you build etc?
     
  8. D Hancock

    D Hancock

    16
    0
    May 23, 2014
    Duke, the size requirements will dictate the screen and power. I have to fit the display and power supply inside a handle approx

    Duke - I'm limited in my direction to some degree by the size of the container the components will go into. Everything (Power, switches, display and board(?)) must fit inside a handle measuring approximately 6" long x 3/4" deep x 1.5" wide. I''m hoping to be able to use one or two small flat 1.5v batteries. The display needs only to be large enough to display two digits. I live in Frisco TX (20 miles from Dallas). Again, I really appreciate the feedback. What are the odds I can take the display from a stop watch counter or something similar? Being unfamiliar with much of these terms I'm not sure if that would even work with the proper 14 micro board?
     
  9. duke37

    duke37

    5,364
    772
    Jan 9, 2011
    It seems that you will need to go the microprocessor route. This is not my area of expertise.
     
  10. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,501
    2,841
    Jan 21, 2010
    I would probably use 3 AA cells, a PICaxe chip, and a pair of 7 segment displays. Added to thsi would be a couple of switches, resistors perhaps a small piece of matrix board and some effort to program the chip.

    The size of your enclosure would not seem to be a problem.
     
  11. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    It would really help if you defined your requirements. But I will describe one way to do what you want, for you to consider.

    All the logic you need can be easily implemented in a 14-pin microcontroller such as a PIC16F610 (surface-mount version: http://www.digikey.com/product-detail/en/PIC16F610-I/ST/PIC16F610-I/ST-ND/1228748 and through-hole version: http://www.digikey.com/product-detail/en/PIC16F610-I/P/PIC16F610-I/P-ND/1228750). It can drive 7-segment LED displays directly if you don't need too much brightness.

    Some suitable displays would be:
    SunLED brand; 10 mm character height; red colour; 27 mcd brightness; SMT (surface-mount technology); USD 1.07
    http://www.digikey.com/product-detail/en/XZFMDK10A/1497-1098-2-ND/4745553

    SunLED 14 mm green 25 mcd SMT USD 1.15
    http://www.digikey.com/product-detail/en/XZFVG14A/1497-1110-2-ND/4745748

    Kingbright 20 mm red 36 mcd THT (through-hole technology); USD 1.96
    http://www.digikey.com/product-detail/en/SA08-21SRWA/754-1680-5-ND/2650436

    Those are all single digit displays.

    Apart from the microcontroller, the displays, and the tact switches, you would only need a dozen or so small components, so those components pretty much determine the board size.

    The circuit should be powered from a battery of around 4.8V. Lower voltages cannot drive LED displays.

    Current consumption would be around 50 mA with the display enabled, or less than 1 mA with the display turned OFF. The microcontroller could include logic to control when the display was enabled - for example it could activate for a second after any pushbutton was pressed; you could add a fourth pushbutton to act as a "display" button (with no other effect).

    50 mA is quite a significant load on the battery. For example, a cellphone battery that's rated for 1000 mAh will supply 50 mA for 20 hours maximum, before requiring a recharge.

    This should give you an idea of the options you have if you chose the LED approach. You could also use an LCD display but as BobK said before, you would need a much bigger micro to drive those; also I think LCDs are generally custom-made for the application, so you might have trouble finding a suitable 2-digit one (or two 1-digit ones). But it's an option you could consider.

    Now how about fronting up with more information on your project, such as quantity required, for a start.
     
  12. D Hancock

    D Hancock

    16
    0
    May 23, 2014
    Gentlemen,

    thanks for the info and direction. Let me further clarify and based on my still very limited understanding. I think based on my size restrictions as well as the conditions the device will be utilized, LCD is the way to go. Kris, sorry for the lack of detailed information. I presented a product design to an associate and he is going nuts over it. He has great connections and feels that if I can deliver a functional prototype it'll be a success. In that case we would need to deliver approx 3,000 units up front. Keep in mind that the circuit we are discussing is only one piece of a larger product. If the product hits the mark then the units required could be off the chart considering the market size. P.S. The product will "help" protect people from a potentially dangerous situation. Once i'm through the prototype and all the paperwork is complete I'll be happy to post pics etc.

    I will have to build as well as program the electronics as well as design and build the rest of the product. Just happy that everything outside of this particular piece has come easy to me to complete :) To further clarify (reference attached image) with the dimensions being 6" long x 3/4" deep x 1.5" wide, I'm hoping either one 3v lithium or two 1.5v Alkalines will work if using a 2 digit .5"(C). The circuit should perform as follows: If B1 or B2 is pushed (impossible to occur at the same time according to my design) the corresponding digit should increase by a count of one until it reaches 9 or a reset button is pushed. As long as this occurs there is no need for an on/off switch as when the product is not in use, again there will be no way for either B1 or B2 to be triggered. Actually I guess there would need to be an off switch because when "reset" wouldn't the display remain displaying 00 eating up the battery? Once the circuit is working at this basic level I'd like to move to a more advance model where for example I could push a button and cycle through different modes. One mode might be to set a timer that would count how many times and which button (B2/B2) was pushed (up to 9 for each of course) during a 30 second cycle. So outside of say a small matrix board are there any major components missing from my design? As I work on this its interesting to note just how many uses I've found for such a simple(?) little circuit. Thanks again for all the help!


    switch design 02.jpg
     
  13. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Are you sure a 0.5" display will be big enough to be readable?

    Can you provide a link to the display you intend to use? It may not be practical to drive it from a 3V battery.

    As for low power mode, the microcontroller can turn off the displays in the right circumstances. For example, if both digits are 0 and no button has been pressed for 5 seconds, it could enter low power mode (current consumption much less than 1 mA) and require a push of the reset button to wake it up. It could also dim the display, or turn it off, a few seconds after any change. You might want to add a "Display" button to make the display light up without affecting the numbers displayed on it.

    If you intend to add features and buttons, you might want to consider using a microcontroller with more pins. Pins can be used for multiple buttons though. The PIC16F610 has 11 input/output pins and one more pin that's input-only. These pins would be allocated as follows:

    7 outputs for the segments
    2 outputs for the digit enables
    1~3 inputs for pushbuttons (multiple pushbuttons can be multiplexed onto a single pin in various ways).

    If you want accurate timekeeping (you mentioned a 30-second period) you may need an external crystal to set the clock frequency. Many small micros, including the PIC series, have internal oscillators that can be calibrated with a basic accuracy of between ±1% and ±5% depending on the supply voltage and the operating temperature. If that's not accurate enough, you will need to allocate one or two pins for an external frequency source such as a crystal or a crystal oscillator. These have an accuracy of around ±100 ppm, or ±0.01%.

    As I said, the main factors determining the board size will be the displays and the tact buttons. The microcontroller also needs some space, and there will be about a dozen small components.
     
  14. D Hancock

    D Hancock

    16
    0
    May 23, 2014
    Kris,

    I found the LCD on the Digi-key link you posted (http://www.digikey.co.uk/product-detail/en/VI-201-DP-RC-S/153-1003-ND/2375). I think the size is fine per the application.

    I thought I was starting to understand the basic requirements but then you said "there will be about a dozen components".

    1) power source (1 or 2 bats)
    2) 2 tact switches
    3) two bounce suppressors (?)
    4) Micro controller
    5) reset switch
    6) small matrix board

    What else would I possibly need?
     
  15. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,501
    2,841
    Jan 21, 2010
    You need to know exactly what microcontroller (or at least the family), the language it uses, how to use that language, a programming environment, and the hardware to burn the program.
     
  16. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    Debouncing can be done by firmware inside the micro.

    There are several important differences between LCD and LED displays.

    LED:
    They glow, so they can be read in darkness
    They have a wide viewing angle
    They are available in 7-segment and "star" styles
    They draw significant power (probably at least 50 mA in your application) while enabled
    They can be driven by any microcontroller with general purpose digital I/O
    They are mechanically sturdy

    LCD:
    They do not glow, but a backlight can be used to make them readable in darkness
    Their viewing angle is not as wide as LEDs
    They are available in standard layouts and custom layouts can be ordered for large quantities
    They draw almost no power (unless a backlight is used)
    They require either a microcontroller with LCD drive built in, or an external driver IC --- Edit: Not necessarily!
    Some modules may include a driver IC which can be easily interfaced to a small micro
    They may require contrast and brightness adjustment to compensate for temperature changes
    They contain glass and can be broken

    The cheapest general purpose microcontroller I can find that includes an LCD driver is the PIC16LF1902 at USD 1.30 from Digikey: http://www.digikey.com/product-detail/en/PIC16LF1902-I/SS/PIC16LF1902-I/SS-ND/2651393

    For mass production, cheaper, smaller and simpler MCUs are available with built-in LCD drivers such as the EM Microelectronics EM6625: http://www.emmicroelectronic.com/Products.asp?IdProduct=178 but these are mask-programmed, i.e. you have to develop and finalise your code, and send it to them, then they manufacture a batch of devices with that code programmed permanently into them.

    EM Microelectronics also make standalone LCD drivers which could be useful.

    If you're using an LCD you will need a printed circuit board for anything beyond a very rough prototype.
     
    Last edited: May 26, 2014
  17. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    That kind of LCD requires 1 pin for each segment + 1 pin for common. It cannot be multiplexed. So you have 15 pins taken up for the display, a 14 pin PIC isn't going to do it. As I mentioned before a 20 pin PIC is minimal, and would have no room for expansion. I am not certain of this, but you may have to drive the two decimal point segments as well, to make sure that they don't display randomly. If that is the case a 28 pin PIC is necessary.

    Here is a good article on what it takes to directly drive that kind of display from a micro:

    http://www.ubasics.com/driving_static_lcds

    I would use a 28 pin PIC for prototyping so you have some options. If your final design can get by with 20 pins, (which I doubt) then you can switch to it for production.

    The programming will not be as trivial as it sounds, since you have to constantly be flipping the polarity of the signals to each segment of the LCD that is on, and not doing so for the other segments.

    Bob
     
  18. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    As far as I can tell, the smallest PIC that has an LCD driver built-in is a 28-pin one anyway.
    Thanks for that link :)

    Edit: I see what you're getting at. With a non-multiplexed display, you don't need any special LCD driver in the microcontroller. You just have to get the code to flip the outputs between 60 and 180 times per second. Given that the code barely needs to do anything else, that wouldn't be a problem. So you could probably use a generic 24-pin or 20-pin device with that particular LCD.

    I would like to get a decision from the OP on LCD vs. LED first though.

    And on that subject, there's another difference I forgot to mention - the required supply voltage. For an LCD a 3V supply could be appropriate, but for an LED display, the supply voltage may need to be significantly higher. It depends on the segment forward voltage.
     
    Last edited: May 26, 2014
  19. BobK

    BobK

    7,682
    1,688
    Jan 5, 2010
    Ah, there is a 28 pin PIC with LCD driver. When I looked, for some reason, I could only find a 100-pin one.

    So, with that new knowledge I would use the PIC16F1902. This would allow driving the LCD display while in sleep mode and waking only on button presses, which would make the battery life excellent.
     
  20. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,271
    Nov 28, 2011
    How about using periodic wake-up to run some code toggle the I/O signals? Executing say 10~15 instructions every 10 ms or so wouldn't require much current. And in any case I expect an inactivity timeout of a few minutes before the whole display turns off would be ok.

    I'm interested in this simple LCD that can be driven from standard GPIO. Yes 15 pins instead of 9 is wasteful but I get the impression that a non-multiplexed LCD will give a clearer display, because with multiplexing, there would be some kind of interference between digits, right? Yes, I just read https://en.wikipedia.org/wiki/Liquid_crystal_display#Passive_and_active-matrix which explains this. Non-multiplexed LCDs are a lot easier to drive and less fussy about the drive voltages. Interesting!
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-