Fast 12v interrupt on 3.3v MCU

Hello. I have a bill acceptor outputting 12V that I'd like to service using interrupts.
How do I lower the voltage so that I can connect it to my 3.3V Arduino? My main concern is it being too slow.
Pulse length is 50ms.

Thank you

Use a potential divider circuit. It will not slow down anything.

In computer terms that is a very long time, so trigger the interrupt off an edge.

Is this solution better than using a transistor?

Level shifter is something that may interest the OP.

Thanks for your answer. Do I get any benefits instead of using a transistor? Thank you

Yes.

But from what you have told us you are worrying about this unnecessary.

I think I'll use the potential divider circuit, seems fairly simple.
Is there anything I should watch out for? Does it matter which resistors are used (I could get the same thing with using two more resistant resistors or two smaller ones)?
Also, I'm getting 12V 99.9% of the time, interrupt is actually from HIGH to LOW. Will heating be an issue as I'm using resistors?

Thank you

Also, one more thing. I don't want it to die, this will be plugged in constantly , probably for years. And I don't want it to burn.

Are you sure it's outputting 12V? Every bill acceptor that I've seen has an open-collector (NPN) output that can be connected to a wide range of voltages, using a pull-up resistor. And yes, arduino is more than fast enough to read the pulses.

What model is your bill acceptor?

10k from 12v to input pin, 3k3 pin to ground. Ratio is 3.3/13.3 = ~0.25. Power dissipation in resistors 144/13.3 ~= 12mW, hardly any heating. Don't worry!

NV10. Not sure really, I've read that it's 12V, I don't know if there's a way to have it output less. Please tell me if there is, it's my first time tinkering with bill acceptors.

Thanks!

I know that the NV9 is open-collector since I've connected to a bunch of those. I'll see if I have data on the NV10, but as far as I remember, the whole series works the same way, they just have different options.

Okay, it's only mentioned in the documentation but I can't find anything on how it works and how it's configured

Hello lukapetko2

You can also use an optocoupler for electrical decoupling.

1 Like

You can use all sorts of resistor values to get the same thing, google
voltage divider calculator
You can plug in all sorts of values but go for about a 4K7 to 10K top resistor.
I would aim to get something like 4.5V out of it instead of 5V as this gives you a bit of a margin and 4.5V will work fine with a digital pin.

The individual resistors can be made up of two smaller resistors in series. This is easy to calculate because the total resistance of resistors in series are simply the sum of the individual resistors. Resistors have a tolerance, which is the difference between the resistance written on the resistor and what you actually get. A 5% tolerance will be fine ( that is why I suggested aiming for a 4.5V output )

In my opinion then you can't do better than two resistors.

However if:-

Then it has it. The fact that you haven't been able to find anything about it is not the fault of the data sheet it is a configuration that "everybody knows about". The think about data sheets is that they are not a beginners tutorial they are written for experienced engineers.

To use them simply connect the output to an Arduino input pin. And then make another connection to that pin with a 4K7 resistor, and the other end of the resistor to the 5V.

Check first the voltage coming out of the bill acceptor and nothing then it is an open collector output and you can proceed with direct connection to a pin. If however you measure any sort of voltage then proceed with the two resistors approach.

1 Like

Page 10 of the NV10 operations manual states that it's an open-collector output.

1 Like

Thank you. Very clear now.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.