optocoupler isolation false pulse from piezoelectric

Thread Starter

fibertech

Joined Oct 29, 2024
13
good day, im have a project involving a coin acceptor & nodemcu. the pulse from the coinslot was isolated using optocoupler pc817. the anode is connected to a 5v source with resistor and the cathode is connected to the signal line (pulse) to the coin acceptor. my problem is when i use the system & insert the coins to coinslot , it reads the actual value but when i use a piezoelectric source from the lighter it gives a false signal to the nodemcu . any suggestions on how to solve this problem ? thanks
 

crutschow

Joined Mar 14, 2008
38,323
I would assume the signal from the lighter is very short, so try a low-pass RC filter on the opto output to suppress the spike while still allowing the longer pulse from the coin to be read.
 

MisterBill2

Joined Jan 23, 2018
27,186
The first step is to discover what portion of the circuit is sensitive and then add shielding to prevent the high voltage field from coupling into the sensitive part of the system. And if there is already shielding, then it has lost it's connections to the common "ground" plane., and it needs to be re-connected to that plane.
 

panic mode

Joined Oct 10, 2011
4,867
use two camera or two to take image of one or both sides of the coin and then run OpenCV to compare against reference image. for added protection check for relief stamped into coin face (take additional image when light source is almost in the same plane as the coin face). also take image of the person trying to pass fakes... then display the image along with note that this is sent to an online server. to prevent posting image insert $5-20 in the next 30 seconds.. 29...28...;)
 

MisterBill2

Joined Jan 23, 2018
27,186
I am guessing that adding cameras to the existing vending machine would be rather difficult. What might work out well is an added sensing circuit that would detect such a pulse and trigger a loud alarm for a few seconds, or maybe half a minute or more, depending on the location.
Certainly there should be a way to add a properly connected shield between the accessible surface and the sensitive electronic portion.
Is it possible for us to see some images of the vending machine?
Are the bad-actors using a wire attached to the coin to send the high voltage farther into the machine?
 

panic mode

Joined Oct 10, 2011
4,867
coins just fall through the mechanism. there is no need to modify the mechanism, one can simply add own 2nd mechanism after it to do additional checks. this can be simply a tiny coin-sized tray with solenoid to stop and later release coin. so one does not need to worry if coin is too fast or if nodemcu has enough of muscle to capture image at right moment. and at about $1-5 for nodemcu with camera, and OpenCV support, this is straight forward to implement and more appropriate than crude size/weight check based on some mechanical contraption. and since it does not involve modifying anything existing, it could be an add-on option that can be easily deployed to machines already in service.
 

panic mode

Joined Oct 10, 2011
4,867
or focus on making current wiring more robust...

add TVS across input. cage everything and use shielded cable, and ground everything, use RF grounding strip to ensure fast response. in software make sure that you only react to pulses of sufficient length. typical piezo igniter produces some 300V pulse that is some 100uS long. coin passing through photo coupler should produce pulse that is orders of magnitude longer.

example of RF grounding wire (large surface area because of skin effect)
1730741124460.png
 

panic mode

Joined Oct 10, 2011
4,867
and if you are an eye-for-an-eye kind of guy, add "confirm" input. instead of button, use two metal handles and skin resistance as contact... if you determine that user is a crook, give him taste of his own medicine and zap him. two can play that game... so maybe he learns something. :D
 

MisterBill2

Joined Jan 23, 2018
27,186
The loud alarm will be more effective in announcing the bad actors. And it might even promote some redress. Besides, there might be some local lawyers seeing a chance to gain some income. NEVER underestimate how low some will go for a dishonest dollar. But now the concept of tricking logic witha voltage spike has become a challenge as to how most simply defeat it.
 

Thread Starter

fibertech

Joined Oct 29, 2024
13
or focus on making current wiring more robust...

add TVS across input. cage everything and use shielded cable, and ground everything, use RF grounding strip to ensure fast response. in software make sure that you only react to pulses of sufficient length. typical piezo igniter produces some 300V pulse that is some 100uS long. coin passing through photo coupler should produce pulse that is orders of magnitude longer.

example of RF grounding wire (large surface area because of skin effect)
View attachment 335069
thank for the idea, can you elaborate or give any schematic diagram with the use of tvs?
 

Thread Starter

fibertech

Joined Oct 29, 2024
13
The loud alarm will be more effective in announcing the bad actors. And it might even promote some redress. Besides, there might be some local lawyers seeing a chance to gain some income. NEVER underestimate how low some will go for a dishonest dollar. But now the concept of tricking logic witha voltage spike has become a challenge as to how most simply defeat it.
yes, it's a big problem. ☺
 

Thread Starter

fibertech

Joined Oct 29, 2024
13
and if you are an eye-for-an-eye kind of guy, add "confirm" input. instead of button, use two metal handles and skin resistance as contact... if you determine that user is a crook, give him taste of his own medicine and zap him. two can play that game... so maybe he learns something. :D
..im not that type of guy
 

MisterBill2

Joined Jan 23, 2018
27,186
The good news is that there has already been a vast amount of study done on how to prevent outside voltage transients from causing incorrect functioning of electronic circuits. The basic problem has been around for as long as circuits, only the specific source of the problem is new. So there is a great deal of knowledge available, but probably not much on the "cartoon channel", where fake information seems to be common.
Do you know where the bad actors are applying the high voltage to the system?? That will be a starting point towards the solution.
 
Top