Go Down

Topic: static electricity setting off my arduino project (Read 530 times) previous topic - next topic

andyg91

I am building a Vending Machine that plays a tune when you put a quarter in the machine. i just used a photointerrupter to signal to my arduino when a quarter passes through it. then the arduino speaks to the adafruit sound fx board to play my tune. The problem is that static electricity is making the machine play the song on its own. if i ground myself and touch the metal frame of the machine, everything is fine and it needs a quarter to work. when i walk away, and rub my hands on the carpet and come back to touch the machine, i get a little tiny shock and it sets off the music. Ive also done it with a screw driver with a rubber handle ( i hold the rubber handle, rub it all over the carpet, come back and touch the metal part of the machine, and it goes off). I tried grounding the machine. i attached a ground wire to the frame and plugged it in. still not working properly. Please help!!

ted

Schematic is need - how you connect photointerrupter ?
picture ?

andyg91

#2
May 12, 2018, 11:44 pm Last Edit: May 12, 2018, 11:57 pm by andyg91
it's a bit messy but i've blurred out the other stuff that doesnt have to do with the photo interrupter. i tried to label most of it. the three wires circled in blue are to the Photo Interrupter itself. Two 100 ohm resistors are used and one 4.7K ohm resistor. the purple line shows a C1815 transistor. And the white wire that I circled in grey goes to the arduino. I also drew out a schematic that is more clear. Ill attach both images.

ted

So you connect the white board with one wire to arduino and one wire from arduino to adafruit sound fx board ?

ted

photo interrupter does not need extra transistor it is make circuit to much sensitive include static electricity discharges.

Can be connected directly to arduino digital  pin such as pin #2

google - photo interrupter arduino

https://www.google.ca/search?rlz=1C1NCHB_en&biw=1440&bih=741&tbm=isch&sa=1&ei=V2z3Wr_VCuyKjwS5lpewBw&q=photo+interrupter+arduino&oq=photo+interrupter+arduino&gs_l=img.3..0j0i24k1l2.136266.141549.0.143592.8.3.0.5.5.0.120.281.2j1.3.0....0...1c.1.64.img..0.8.319...0i67k1.0.82CAIU1EnXE#imgdii=7PKd82IrtT6nFM:&imgrc=PpVc5M6t_mlTtM:

andyg91

okay ill try this and see what happens. thank you so much!

ted

0.1uF capacitor from digital pin to the ground may help

andyg91

which digital pin? the one that i'm using already? I dont want you to spend tons of time but if it wouldnt be too much would you help me on how to physically do that? thanks. I have capacitors.

andyg91

this may be useful information. I bypassed the arduino and just put the white wire that normally goes to the arduino and put it in the pin for the sound board directly and i dont have an issue with the static setting off the sound. the problem is that i need the arduino to sustain the signal because the quarter passes through the photo interrupter too quickly for the sound board to pick it up. all i have the arduino doing is making that signal last longer so that the sound board knows to go off. thanks

ted

I am not expert in programming, but post the code which you are using.
Delay function can make a very long  pulse.

Go Up