2

New to the forum because I am stumped. Im building what I am calling the "water table" for my kids. It has a series of spigots, and channels that funnel into a kiddie pool. Then I got creative and added some solenoids to make some quirt guns that run off of line pressure. They are SWEET!

I have 2 solenoids left to find a function for. My oldest wants me to get a push button that will randomly shoot the person standing in front of the button. So, you can press it anywhere from 1-10 times before it goes off and every time its a different number of pressure. Kind of like Russian roulette... but for kids lol

I just spent the last hour googling things with no results, but I found this page and thought someone would be able to point me in the right direction. Any thoughts or input would be great!

Thanks!!

Ian Dunbar
  • 21
  • 2
  • 3
    Please, please, don't make anything with water and electricity for your kids. – Eugene Sh. Jun 29 '18 at 19:24
  • And what do you expect from us? Finding other ideas for the solenoids left, or giving you a full design of the roulette idea? Both are probably off-topic... – dim Jun 29 '18 at 20:10
  • 1
    There is a srand() function in C so you could use an MCU or Arduino, seed with a free running counter. But this is likely off-topic as dim says. – Spehro Pefhany Jun 29 '18 at 20:15
  • Im trying to understand the roulette idea. Honestly I don't even know what to search for. – Ian Dunbar Jun 29 '18 at 20:19
  • I was on arduino's site. That seems like a viable option. im not familiar with it, but it looks easy enough to figure out – Ian Dunbar Jun 29 '18 at 20:21
  • Just run a timer. If the press was detected on an odd cycle - don't turn it on. If on even - turn on. If you want to reduce the odds - have it to turn on on each, say 16's cycle. – Eugene Sh. Jun 29 '18 at 20:24
  • 1
    All you need is a high speed clock with N=10% duty cycle and sample the output. Probability is due to undersampling and normal distribution of 1 out of 10 Then a timeout. Or an old Lucas switch (lol) – Tony Stewart EE75 Jun 29 '18 at 21:24
  • But being a normal distribution gives a wider range than 10 , so if you choose 20% duty cycle then on average 1 out of 5 times. but could be more than 10 But a true roulette loads 1 of 10 random spots then shifts out and reloads a different sample after bang – Tony Stewart EE75 Jun 29 '18 at 21:31
  • I like the sound of that. Then I'd add another timer to make it stay on for 5 sec or so? Would I be able to do all that off the same timer? – Ian Dunbar Jun 29 '18 at 22:06
  • I'm also liking the arduino. I could hook a servo up and make sure no-one gets away unscathed lol – Ian Dunbar Jun 29 '18 at 22:12
  • Use a Raspberry pi and maybe you can implement face tracking targeting. – Spehro Pefhany Jun 29 '18 at 23:45
  • I hope the "water table" has no connection to the 115 V power grid and is powered by batteries with less than 25 V only. Just to keep it safe for kids playing with water. – Uwe Jun 30 '18 at 14:59
  • After nine missed the thenth must shoot or each one is randomly 1/10 chance? – Dorian Jun 30 '18 at 15:18
  • I'm hoping he's using irrigation solenoids which are like 24V or 12V, still that's enought to be unplesant if you have wet hands. – Jasen Слава Україні Jun 30 '18 at 21:01

2 Answers2

1

Configure a 555 timer for a 91% duty cycle and latch the output.

Feed the output of the timer into a D flip-flop. Use a double pole switch. The first pole of the switch is used as the clock for the flip flop. When the button is pressed the flip-flop will latch whatever value was on the clock pulse. There will be a 9% chance that the output was low. A low output on the timer will result in the flip-flop output being high. This will turn on the 2N7000 MOSFET. The MOSFET may be used to drive the solenoid directly, or if required it can drive a relay. The second pole of the switch is put in series with the solenoid so that the solenoid only remains on as long as the button is pressed.

In total the cost of the parts should be under $5.

schematic

simulate this circuit – Schematic created using CircuitLab

Component links

SE555P https://www.digikey.com/product-detail/en/texas-instruments/SE555P/296-9684-5-ND/380221

CD4013BE https://www.digikey.com/product-detail/en/texas-instruments/CD4013BE/296-2033-5-ND/67245

EC2-4.5NU https://www.digikey.com/product-detail/en/kemet/EC2-4.5NU/399-11046-5-ND/4291112

2N7000-G https://www.digikey.com/product-detail/en/microchip-technology/2N7000-G/2N7000-G-ND/4902350

user4574
  • 11,816
  • 17
  • 30
0

so you have a fast clock a 10 cycle counter and a bistable

when the button is pressed advance the counter by one count.

if the counter gets to 10 turn the bistable on

if the bistable is on clock the counter from the fast clock

if the bistable is on and the button released reset the bistable..

when the bistable turns on activate the squirt.

in this way the counter will race when it gets to 10 and when the button is released after the squirt the counter will be left in a hard to predict state.