I want to build a 'random' search button

Discussion in 'The Projects Forum' started by sharpy, Apr 30, 2016.

  1. sharpy

    Thread Starter Member

    Aug 7, 2010
    10
    0
    Hello

    I want to build a random search button for my work place.

    I've used these before, there's a push button and a green and red led. Then remotely.... approx 10 metres away in another room is a control panel which can vary the percentage of the button and reset any 'red' activations. Eg 0% button will always go green and 100% will also go red.

    At the push button end the button would need a bleeper that would bleep until the reset button is pressed at the control end.

    Over to you guys, I have the skills to build but little in terms of design.

    Thanks for reading :)
     
  2. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,820
    What does it search?
     
  3. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,993
    745
    More to the reason, Why?
     
  4. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,820
    This reminds me of a visit to Mexico about 15 years ago...

    In Mexico, all searches of by Mexican Customs/Immigration or even company security have to be "random". As we passed through Customs in Altimera, we each had to press a button and either a red or green light turned on. Red light meant search. I was surprised that the none of the seven guys in our group were searched (red light). We all joked that we were too well dressed and they had a little button to force a green light.

    When we left the manufacturing site that we visited, we waited in line for security to search a few cars. The engineering manager ahead of us wasn't searched. When we approached the guard shack, The security guard made the driver pull a glass ball out of a bag. Apparently we got searched depending on the color of the balls. We were waved through as were the two cars behind us and the engineering manager's car ahead of us.

    We made our way to the restaurant and had a chance to discuss this random search with our host (engineering manager). He laughed and said, as he approached the guard, he flashed his headlights 3 times to let them know that the three cars behind him were guests and should not get searched. The guard has to go through the motions so the hourly employees don't cry foul about the randomness of searches but the guard has three bags of balls in the shack, one with all black, one all white and one with a mixture. We laughed and realized that our joke about the airport likely had some truth.

    So, OP, is this the type of "random search" device you are looking for?
     
  5. sharpy

    Thread Starter Member

    Aug 7, 2010
    10
    0
    Its a search button that staff on the premises press when they leave.

    Green pass

    Red search

    And no its not that random
     
  6. sharpy

    Thread Starter Member

    Aug 7, 2010
    10
    0
    [​IMG]

    This is one made by www.detectag.com.
    The panel goes in a control room. The number is the percentage chance of getting a green or red.
    I'm not fussed about a counter, the up and down button could be replaced with a variable resistor?
    At the other end there's a button ppl press and a green and red led.
    When the user presses the button the either get a green led.... The unit bleeps once and a green led is shown for 2 seconds, or the user gets a red led. The unit then bleeps continuously until the reset button on the keypad is pressed. I will need to keep these features.

    Any ideas anyone?
     
  7. panic mode

    Senior Member

    Oct 10, 2011
    1,320
    304
    google electronic dice
     
  8. sharpy

    Thread Starter Member

    Aug 7, 2010
    10
    0
    Yh I lpoked at those, but I want just 2 outputs and also want to be able to adjust the percentage chance of getting a 'red' or 'green'
     
  9. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    How many steps do you need for the percentage (what resolution)?
     
  10. sharpy

    Thread Starter Member

    Aug 7, 2010
    10
    0
    I would say 10% increments would be good!
     
  11. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,809
    834
    How about an unbounced switch input to a BCD counter. That'll give you a random number between 0-9. You could use a high frequency oscillator as well. Then, use a BCD Thumbwheel switch to set your desired percentage; 0 means all the time, 4 means 40% of the time. Feed both into a comparator and diode or the less than and equal inputs to one LED. Wire the greater than output to the other LED.

    Just a concept, but the details can be worked out.
     
  12. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    I don't think there's a simple way to keep all those features without using a microprocessor.
    And that would involve learning how to program one.
    Are you up to that?
     
  13. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,820
    I started laying it out and after I hit four logic chips, I tapped out. Microcontroller is the way to go.
     
  14. tcmtech

    Well-Known Member

    Nov 4, 2013
    2,036
    1,662
    Actually, it would not be that hard to make a biasable random two LED flasher like you are asking for.

    I would use a common 555 IC set up with a pot that can bias the duty cycle from 5% to 95% and a trigger button that activates the timer to run at some random odd high frequency above of a few tens of KHZ.

    Set the pot at mid point and give the button a push for a second or two. 50/50 chance the timer will stop on a high or low output state of which turns on either the red or the green LED. Turn it either way and you bias the odds of landing on that color you want proportionally to which way you turned the pot.

    Read up on 555 timer PWM circuits to learn more.
     
    GopherT likes this.
  15. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,058
    3,820
    Now you need to add the buzzer that requires a reset button press and a sort tone for the green case - either should sound after the button is pressed.
     
  16. crutschow

    Expert

    Mar 14, 2008
    13,016
    3,235
    I like the concept. :cool:
    I'm not sure how you would stop the 555 in either state but you could instead, leave the 555 running and connect its output to the D input of a FF, using a PB to trigger (clock) the FF.
    The chance of the FF going high or low when the PB is pressed is then proportional to the duty-cycle of the 555.
    The FF output controls the LEDs.

    So whether you would use the digital approach of djsfantasi or the analog approach of tcmtech somewhat depends upon whether you want to use a BCD thumbwheel switch or a rotary pot to select the percentage of Red versus blue.
    That's assuming the rest of the functions can be achieved with a reasonable amount of added circuitry.
     
    Last edited: Apr 30, 2016
  17. tcmtech

    Well-Known Member

    Nov 4, 2013
    2,036
    1,662
    Put a high ohm two resistor 50/50 voltage divider on the threshold and trigger connection so that when it is not looped in an astable mode it automatically floats those pins at 50% of the supply voltage thus holding the output in its last state.

    Since I don't have a drawing program on this laptop I will try and explain it the best I can.

    There is a simple 555 timer circuit configuration where the pin 3 output is used to drive the threshold and trigger inputs (Pins 2 and 6) via a resistor and a pot and the pot has a diode on each end (Pin 1 Cathode of first diode, pin 2 to resistor, Pin 3 anode of second diode) with their other ends going to the timing capacitor connected to the threshold and trigger pins that makes the 555 IC work as a wide duty cycle constant frequency astable oscillator.

    By putting a push button switch in series with the resistor, pot and two diodes part of the circuit the 555 can be set up to only cycle when the button switch is closed. By adding the two other resistors that will hold the threshold and trigger inputs at 50% of the supply voltage the output will stay toggled in its last state whenever the switch is opened.

    For the two output LED's they are connected through two resistors so that one is connected to the ground to light when the output is high and the other is connected to the positive supply to light when the output is low.

    Total parts count is around 13 or 14 pieces, I think. ;)

    Granted it's not a true binary random number generator but for anyone trying to cycle a multi-tens of KHZ variable duty cycle momentarily astable oscillator to land on a specific output using nothing more than a mechanical push button switch it's close enough.

    But by adding the ability to bias the relative duty cycles of each state that random output can be effectively biased to which state is more likely to be landed on given any number of tries. :cool:

    Now if you really want make it appear random place a thermistor and photoresistor in parallel with the fixed resistor that determines the upper and lower duty cycle limits and they will efectively add a bit of systesm freqency drift and duty cycle drift that is totally dependant on local light and temperature conditions and outside of any basic human level control.

    Basically it's using ambient light level, specifically any artificial light that has an alternating current power source/flicker, to add one more highly variable pseudo random biasing/drift artifact to the overall analog base frequency and duty cycles of the 555 IC so that even with high accuracy event triggering there is no constant exact base frequency or exact duty cycle at any two points in time. ;)
     
    Last edited: Apr 30, 2016
    #12 likes this.
Loading...