How to use CH-926 Coin Acceptor with Arduino

Ғылым және технология

In this video I will show how to program Coin Acceptor to recognise a set of coins as well as connect it to Arduino .
Arduino code would capture impulses coming from the Coin Acceptor and display the sum of inserted coins on 4 digit display.
We also use Arduino build in EEPROM to save the balance so it is not lost when the arduino is power down.
Hope that you would find this video useful.
Links to components used in this project:
Display: pl.aliexpress.com/item/328678...
Coin Acceptor: pl.aliexpress.com/item/328306...
Arduino Nano: pl.aliexpress.com/item/328504...
Link to the code:
projecthub.arduino.cc/Dziubym...
If you like this content and you want to support me in creating similar videos go to my Patreon webpage
/ mariosideas
Or
www.paypal.com/cgi-bin/webscr...
In the video I used royality free music from youtube
Here are the credits:
------------------------------
Track: Good Life - JayJen & Roa [Audio Library Release]
Music provided by Audio Library Plus
Watch: • Good Life - JayJen & R...
Free Download / Stream: alplus.io/good-life
------------------------------

Пікірлер: 233

  • @DGworksIvan
    @DGworksIvan Жыл бұрын

    i love how you explain the code layer by layers, really good teaching, thanks a lot

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    Thanks:) Sorry for a late reply. I just came around to answer all the messages from my viewers:)

  • @kurtiii
    @kurtiii Жыл бұрын

    thank you so much! I searched so long for a video like this!

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    You welcome:) Consider supporting my chanell.

  • @laurentiujinga5558
    @laurentiujinga55583 жыл бұрын

    Thanks for the info on coin mechanism, exactly what I was looking for. 👌

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    I had some issues at the beginning . I did not use resistor or I had fast impulses chosen on the device. This error is in the wrap up where I used footage that still got an error without realizing . Thanks for subscribing

  • @laurentiujinga5558

    @laurentiujinga5558

    3 жыл бұрын

    @@marios_ideas I have seen on another answer. Thanks

  • @msindisimtengwane9456
    @msindisimtengwane94563 жыл бұрын

    This was a great video man. Very detailed. Love it. Thank you for making it.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Glad you liked it!

  • @reamonlinnabary9749
    @reamonlinnabary97493 жыл бұрын

    Great video!!! It is very helpful, especially since the box doesn't come with any instructions. Thank you!!!

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Thanks for watching!

  • @alirezashirazifard8990
    @alirezashirazifard899010 ай бұрын

    This is the best video to watch for set up coin drop. Others are mute

  • @ChinoBuchonMX
    @ChinoBuchonMX3 жыл бұрын

    This video is amazing, outstanding work and very good code, congratulations man

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Thank you:)

  • @MrWolftamer
    @MrWolftamer Жыл бұрын

    Thank you very very much! I now know how to program! Instructions that came with mine were very vague.

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    My pleasure:) like the video and subscribe to my channal. Also consider supporting it.

  • @GorkemYildirim
    @GorkemYildirim3 жыл бұрын

    Nice one. I haven't seen this before. Thanks for your efforts.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    I am glad you enjoyed it:)

  • @GorkemYildirim

    @GorkemYildirim

    3 жыл бұрын

    @@marios_ideas subscribed

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    @@GorkemYildirim Thank you

  • @semiplex9727
    @semiplex97273 ай бұрын

    Hello Mario, First, great Video! Thank you. I just brought this Coin Acceptor after I watched your Video and today I played around with it. I'm working on a Cady machine for Kids (ofc not for permanent usage. The Kids need to do different Task like collecting trash to get a Coin. It's for an event). So, I trained all my Coins and connected a LED between Ground and the Counter Pin, that was working as expected (Blink Whenever a Coin is inserted and also in different repetitions). But when I connected the LED to Ground and Coin Pin, it just turned the LED on even tho it's on Normally Close. I expected a Consistent Blinking like a Clock where I can Orientate the Counter Pin to. My plan was to use 2x optocoupler. I'm not new in Programming but I'm (very) new to electronic and to be Honest, I didn't understood that much when it came to connection. It seems like you connected the Coin Pin directly to the Arduino, in my Case it would Fry my ESP8266 or I am wrong (that's why I also wanna use optocoupler)? I don't understand, I hope someone can Explain me this in a way that every dummy will understand this.

  • @EC-TPavithiravalavan
    @EC-TPavithiravalavan9 ай бұрын

    Really a great video. Greatly explained 👍

  • @marios_ideas

    @marios_ideas

    9 ай бұрын

    Thanks:) Consider supporting my channel:)

  • @markdemasseur
    @markdemasseur Жыл бұрын

    Hi this coin acceptor doesnt keep credit for arcade machine. So when you press play then there will be used 1 credit and other credits keeping on the memory. Is it possible to make something with arduino a project like this.?

  • @GusNando
    @GusNando2 жыл бұрын

    Thank you, it's very helpful 😁

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Give it a like if you liked it and found it useful. Would mean a lot to me

  • @solomizan
    @solomizan3 жыл бұрын

    Thanks! It helped me a lot.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Glad you found it useful:)

  • @pierluigizagaria
    @pierluigizagaria8 ай бұрын

    Thank for the video, I have a question. If the board has built in pull-up resistor, there is no need for the external one right? How does the coin-acceptor signal work? Sends pulses of 5v?

  • @skostasx
    @skostasx5 ай бұрын

    bu güzel videonuz için teşekkür ederim.

  • @samzmann
    @samzmann Жыл бұрын

    Thx. Very useful video! Any idea how to disable the buzzer/beep that sounds when coins are accepted?

  • @osamasegh8737
    @osamasegh87374 жыл бұрын

    Thank you so much for this video, it is great. You helped me a lot to understand the code. Good Continuation ...

  • @marios_ideas

    @marios_ideas

    4 жыл бұрын

    Thanks. I will be doing more tutorials in the future. If you want to check them out, subscribe to my channel:)

  • @osamasegh8737

    @osamasegh8737

    4 жыл бұрын

    @@marios_ideas I'm already subsecribed ... You have a simple and fluent method to explain ... I will fellow your works to learn more about arduino programing ... Best Regards.

  • @Lennings82
    @Lennings827 ай бұрын

    seems like it counts quite odd if i put in coins too fast. Is it a way ti activate the coin reject between the coin inserts? so if I put it in to fast it will come out again.

  • @rohamtavakkoli7562
    @rohamtavakkoli7562 Жыл бұрын

    Very informative. Do you know if the acceptor outputs RS232? The manual mentions that it does, but I'm not sure if external hardware (a conversion board maybe) is needed if an Arduino is not used

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    I cannot really comment on that

  • @nestormarcelovenece5091
    @nestormarcelovenece50912 жыл бұрын

    Very good work

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    give it a like if you enjoyed it:)

  • @henrylaredo
    @henrylaredo14 күн бұрын

    thanks for the video, just one question, are you assuming the "i" variable inside "loop" function is incremented each 1 milisecond?

  • @marios_ideas

    @marios_ideas

    14 күн бұрын

    This was just my way of making sure there is a break in between interrupt execution. At that stage I was not aware of millis function. Now I would replace the mechanism with i variable with using millis to check how many ms passed inbetween impulses

  • @hudabert4074
    @hudabert4074 Жыл бұрын

    what the purpose of connecting 5v with the 10k ohm resistor to the coin pin in the D2 pin? isn't the coin pin alone will give the signal (voltage) when inserted coin is detected? please enlight me.

  • @Lennings82
    @Lennings827 ай бұрын

    hi.. are trying to get this to work. but if i the setup running for some time i can see that it self trigger on the coin puls. is there a way to fix this??

  • @elektroaqua7630
    @elektroaqua76304 жыл бұрын

    Good job

  • @marios_ideas

    @marios_ideas

    4 жыл бұрын

    Thanks:)

  • @gloryvidalr3313
    @gloryvidalr33132 жыл бұрын

    How do I put the price so that it adds up the coins and can be used? I mean, when add coins and get enough to play. How to define it?

  • @asllovett5208
    @asllovett5208 Жыл бұрын

    I tried programming my coin acceptor and did all that you say but after the programming, the LED displays from E to 0 instantly. I wasn't able to turn off the coin acceptor when the display is at E. What happened here?

  • @youssefyoussef2517
    @youssefyoussef25177 ай бұрын

    I have the same in a beverage dispenser but when I unplug the dispenser, I have to redo the configuration from the beginning, will you have a solution? THANKS

  • @jamalsaid7158
    @jamalsaid7158 Жыл бұрын

    Finally a good video

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    Thank you:)

  • @jamalsaid7158

    @jamalsaid7158

    Ай бұрын

    ​Btw how can I get the 3d printed plate? been searching on STL finder and found nothing​@@marios_ideas

  • @gadfay8463
    @gadfay8463 Жыл бұрын

    We should add an Eprom (external) ? What happen exactly after 100000 times ?

  • @troymcdonald
    @troymcdonald Жыл бұрын

    Thanks

  • @TheEPROM9
    @TheEPROM93 жыл бұрын

    Handy, was able to set up main as the instructions that come with it are about as clear as mud.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Glad my video was helpful

  • @johannesrose7324
    @johannesrose73242 жыл бұрын

    What can you do with the outputs NC and NO? Can the device also count itself and e.g. only give a signal after $ 7 has been inserted? So without an external evaluation?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    The device just recognises coins and output the defined number of impulses per each coin. Does not have any more built in logic. Any additional behaviour has to be coded, like counting the total, reacting to any particular amunt entered etc

  • @peacerobertozitha3008
    @peacerobertozitha30086 ай бұрын

    Do you think it would be possible for me to add PS4 controllers to a 5V relay module and code the esp32 that each time the Coin collector recieves a R5 coin (ZAR) it switches the PS4 controllers on for 10 minutes ?

  • @semiplex9727

    @semiplex9727

    3 ай бұрын

    I don't think this will be a Problem, whenever a R5 Coin is detected, open the Relay for 10 Minutes.

  • @gadfay8463
    @gadfay8463 Жыл бұрын

    Hi friend! Sensitivity? What is it exactly? How you can set it for 10 cents ( for exemple). Thanks

  • @KuyaMagik
    @KuyaMagik3 ай бұрын

    Is there way to make a free play button with this type of coinslot?

  • @marios_ideas

    @marios_ideas

    3 ай бұрын

    Just like the display to show the recignised coin value you can add any other that you want and program its logic, including buttons

  • @Striyka
    @Striyka2 жыл бұрын

    Brilliant

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Give video a like if you liked it:)

  • @georgijetanasic3357
    @georgijetanasic33572 жыл бұрын

    13:08 You put 2 euro inside, but the value increased by only 1. I have Arduino Uno and 16x2 LCD. I will order coin acceptor and try to make it. So, I have one question. I want to have GUI on touchscreen display. So do I need to connect Arduino to Raspberry or I can do everything with Raspberry(To connect coin acceptor directly to Raspberry)?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    This is a wrap up footage,. At the beginning I had an issue which was fixed. And when I was selecting footage for the conclusion I chose it from a wrong file:) if you work with raspberry pie you should write the code for Rasbery pie. I unfortunately have no experience with that microcontroller

  • @chandandas2041
    @chandandas20412 жыл бұрын

    Awesome

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Give it a like if you enjoyed it

  • @khunden
    @khunden2 жыл бұрын

    What is the logic of the counter pin on the coin acceptor? Is it a logic high and drops to logic low when a coin is accepted?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    This is a GREAT question. When I was researching this topic I couldn’t find anything and Chinese instruction I got was useless. Maybe someone can chip in here:)?

  • @iam726246
    @iam7262462 жыл бұрын

    when it arrives at the price of the product, how to activate a relay so that it delivers the product? And in case you want to add a hopper to deliver change, what would a code example look like?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    This is a hobby for me. And you probably are seeking a comercial use. Did not use hoppers so cannot really help here.

  • @spacegoogie
    @spacegoogie7 ай бұрын

    My unit will at random & automatically deposit coins into my pinball cab. and I can't figure out why. All my stuff is wired up correctly. Anyone have any input on this for me?

  • @fuaduddin1811
    @fuaduddin18112 жыл бұрын

    Can someone suggest a coin operated smart plug solution? Would like to make a washing machine coin operated using a smart plug.

  • @KuyaMagik
    @KuyaMagik3 ай бұрын

    Can you help me program an arduino with my bill acceptor? TheTB74? is there a way to contact you

  • @marios_ideas

    @marios_ideas

    3 ай бұрын

    To be able to help you with something like this I would have to have this module, and I don't . Also I looked at the spec. It is quite complex to set up any given currency. It will take a lot of time to figure this out and I have plenty other projects videos I commited to, and very limited time to deliver them:(

  • @fabi_0202
    @fabi_02022 ай бұрын

    Good video! But my coin acceptor beeps with every pulse when a coin is inserted. Is there any way to disable this?

  • @khellafsamy
    @khellafsamy3 жыл бұрын

    THANK U

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    You are welcome

  • @lyricalworld360
    @lyricalworld3602 жыл бұрын

    Any idea about coin acceptor with timer control Please help ❤️

  • @AFerreira1977
    @AFerreira19772 жыл бұрын

    Olá. Dado que já ando um pouco perdido e desesperado...venho pedir aos entendidos na matéria, solução para instalar corretamente este moedeiro de arcade (JY - 926), com correspondente ligação à placa “Zero delay”. Consigo configurar moedas, contigo, não consigo que adicione créditos (não dá pulso). Eternamente grato! Muito obrigado 🍺

  • @mtraxx
    @mtraxx11 ай бұрын

    Hi, Can this coin acceptor directly control the cy-822a type circuit?

  • @marios_ideas

    @marios_ideas

    11 ай бұрын

    I am sure you can but I do not have experience with CY-822a

  • @sklepa
    @sklepa3 жыл бұрын

    Dzięki za film, fajnie wszystko objaśnione. Mam tylko taką zagwozdkę: zakładamy że licznik "i" zwiększa się o jeden w każdej pętli, i do póki w pętli nie ma nic innego niż zliczanie monet to jest ok. Później jeżeli dołożymy więcej kodu typu obsługa komunikacji i jakichś peryferii, pętla zacznie zwalniać i mogą pojawić się problemy. Czy dobrze rozumuję?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Masz absolutną rację. Niestety uczę się na bieżąco. Zmienna I wykorzystywana byla do zbudowania stworzenia ok 300ms przerwy które mowi nam ze to juz koniec impulsów i można rozpoznać monete. Jesli sprawdzisz moje ostatnie filmy to bedziesz widzial te o wykorzystaniu millis. I tu jest wlasnie idelane zastosowanie. Zmienna i i liczenie do 300 powinno byc zastapione funkcja millis. Czyli wrzucamy monete. Zapamietujemy czas i ponownie sprawdzamy czas z millis w petli i jesli bedzie wiecej niż umowne 300ms to moneta jest rozpoznana

  • @sklepa

    @sklepa

    3 жыл бұрын

    @@marios_ideas I tak też bym to rozwiązał :) też jestem amatorem, tak tylko mówię. Pozdrawiam!

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    @@sklepa Sam fakt ze robilem te filmy o millis pokazuje ze tez dręczyło mnie take zastępcze rozwiazanie. Jak zerkniesz na film o nastawianiu alarmu w budziku tam tez jeszcze nie stosowalem millis:( I teraz bym to chetnie poprawil.

  • @fuoto
    @fuoto2 жыл бұрын

    The guide looks perfect. I just don't know how to program if one button on vending is pressed then the program should indemnify the amount specified. What if I have 2 different buttons. Every button should indemnify a different amount. And if there is not enough money machine should not do anything. Please help.

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Well. I cannot write the code for you. You need to introduce one or multiple buttons and write the code for them.

  • @erickroeger1161
    @erickroeger11613 ай бұрын

    I remember working on one of these but at the time there was something finicky about it (output value? i think cant remember this was years ago) anyhow had to solder wires to the 6 leds to get the correct feedback rather than detecting the usual impulses, i think its because the impulse were too slow when the user inserted coins quickly and therefore you get mixed of impulse. Like if I had a quarter that had 5 impulses but then I inserted another coin While those impulses were still sending out, I'd get higher amount of impulses. This additive feedback isn't practical for real world usage.

  • @NicodemusT

    @NicodemusT

    Ай бұрын

    Hey there, could you explain? I have 6 leeds, too - and most of them seem to carry 12v for some reason. I am also finding the pulses finicky.

  • @erickroeger1161

    @erickroeger1161

    Ай бұрын

    @@NicodemusTSo pules aren't at all reliable because they add on top of each other due to the fact that they're being measured by the m/s (or whatever); this is why, for example, when you insert a penny (1 pulse) and QUICKLY insert a nickle(2 pules) you end of with 3 pules as an output. Its a bad design because your essentially working with one variable when you need 6 distinguished variables for each coin. (idk about the 12v thing but) You'll can hackishly opt to detect the voltage change in the leds themselves by soldering a wire to the pads and use that to distinguish which coin was inserted. Mind that this was a long time ago I can't remember much working with Arduino but maybe I can dig up some links I found; if I can I'll post again later if i find them.

  • @danielmiller5967
    @danielmiller59673 жыл бұрын

    At the sampling phase my coins are not recognized. Can anyone help?

  • @steamplay29
    @steamplay294 жыл бұрын

    Fajny filmik :)

  • @marios_ideas

    @marios_ideas

    4 жыл бұрын

    Dzięki:)

  • @heno_3098
    @heno_30983 жыл бұрын

    An error occurred at time 13:10, after insetr 2€ coin the display shows adding value 1€. The question, then, is whether the Chinese validator is a scrap or is present a bug in the arduino program. I also don't like the fact that the response after inserting a coin after displaying the status takes too long ...

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Well I think the coin acceptor is ok. I had rare issues when writing the initial code where a single impuls was resulting in runnig the interrupt function more then once . I realised that after filming the footage. This led me to introduce variable "i" to eliminate this. I reshot some of the footage after that change.I had this issues with interrupts on other projects. Now I cannot tell you if the use of "i" did not fully eliminate the error or I used the previously filmed footage that contain the error . Now , knowing more I would do it differently. I would use millis() inside of interrupt function to make sure there is proper time interval between impulses. I already used in my other videos. e.g. kzread.info/dash/bejne/a5Vp04-xdNnAgdY.html go to 4:55

  • @heno_3098

    @heno_3098

    3 жыл бұрын

    @@marios_ideas Therefore, I do not use sw arduino, but I write in assember directly. It is very fast and reliable. The point is to measure the time it takes for the finding how long pulse to last after the interrupt is triggered, as MCU can also find some short-term interference as a pulse and it has a short length of log0 (less than 90mS). Consequently, if the pulse (log0) lasts more than 90mS continuously, but a maximum of 110mS (according to the validator setting to 100mS length of one pulse), then the length is checked for how long it lasts (log1) and only then it is decided whether it is 1 pulse in this in the case of a € 1 coin or a further decrease to log0 continues and it will be 2 € 2 pulses, etc. Everything is decided no later than 110mS after the end of the last log0.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Heňo _ writing code in assembler is way over my head. Last time I did it back at the university which was a long time ago. I will probably do follow up videos where I wold use millisecond and put the coin acceptor to a test loading large number of coins in sequence to see if I can fix this problem , assuming that it is not the old video footage problem.

  • @heno_3098

    @heno_3098

    3 жыл бұрын

    @@marios_ideas Long ago in Poland? I've never seen a university from the inside. I graduated from an apprentice high school under socialism in the Czechoslovak Socialist Republic. But these things were already a necessary basis at the time, perhaps then the demands declined.

  • @promediag
    @promediag Жыл бұрын

    I just need to learn this

  • @honelicious127
    @honelicious1273 жыл бұрын

    how we can add a digital pin to trigger the added relay to turn off when the time is zero? ty

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Not sure I understand. What time are you talking about.

  • @honelicious127

    @honelicious127

    3 жыл бұрын

    @@marios_ideas i mean add some relay to trigger when time is end. Please

  • @lisserkc6000
    @lisserkc600011 ай бұрын

    Mine lets some coins trough without it actually seeing the coin, it even does this when the power is out. Do you maybe know how to fix this?

  • @marios_ideas

    @marios_ideas

    11 ай бұрын

    You mean it goes through like it was recognised and is not returned in the return slot.? In this case it seems to me that there is a problem with your acceptor

  • @knerduno5942
    @knerduno59423 жыл бұрын

    After a hiatus, I have come back on working on this. I just recopied the code, and readjusted the pulse counts and total amounts to reflect my needs. i.e. if (i>=30 and impulsCount==2){ total_amount=total_amount+2; Looking at the serial monitor, I can see the total pulses being counted, but the variable "total_amount" is constantly staying "NaN" even before a coin has been inserted, though I do see you have total_amount already set to 0. This means the display goes to 0 when turned on, and never changes from 0. Any ideas on this?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Sorry for a late response but I was skiing this week. Before I can answer you have to clarify. Not sure what you mean by "NaN" This is an float type so it should always have a numerical value. And I do set the initial value to 0 ., so this seems strange to me.

  • @knerduno5942

    @knerduno5942

    3 жыл бұрын

    @@marios_ideas Hope you had a good time skiing. NaN is a response from the program, or computer meaning "Not a Number."

  • @knerduno5942

    @knerduno5942

    3 жыл бұрын

    @@marios_ideas Someone in software development shoudl know about "NaN" when the system returns that as a value, or lack of. Here is a line of output from the serial console after just starting the application" i=533 Impulses:0 Total:nan

  • @patrycjaferuga9783
    @patrycjaferuga9783 Жыл бұрын

    Czy dałoby się zaprogramować to jakoś, aby przyjmował złotówki? albo jest może jakiś zamiennik CH-926 który przyjmuje złotówki?

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    Czy aby na pewno obejrzałas cały ten film?:) Tam jest cała procedura uczenia tego urządzenia rozpoznawania monet. Jakie to są monety to nie ma znaczenia

  • @Apothyxis
    @Apothyxis10 ай бұрын

    How would I set impulse if I want two of the same coin to equal one credit?

  • @marios_ideas

    @marios_ideas

    10 ай бұрын

    The impulses are for recognising the coin. How would the coin be calculated into credits is configured in the code.

  • @smappdooda
    @smappdooda2 жыл бұрын

    What voltage does the unit pulse when a coin is inserted? 12v or 5v?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    5v

  • @Rippafratta

    @Rippafratta

    17 күн бұрын

    @@marios_ideas I know I'm late: 5 Volts because of the resistor? So, without resistor it would be 12 Volts, right?

  • @marios_ideas

    @marios_ideas

    17 күн бұрын

    @@Rippafratta No I think it is 5v as there are no 12v microcontrollers . The device requires 12v to work but the signal pin has 5v

  • @knerduno5942
    @knerduno59422 жыл бұрын

    I am revisiting this project after realizing the Arduino is just too slow in response. Even upping the BAUD rate did not help. If you insert the coins in too fast it throws the application way off, and cannot recover. With that, I looked for something faster. I decided to try an ESP32. So looking even closer at your code and the diagram, I have and issue now maybe you can help with. I see you are using Digital Pin 2 connected to 5 volts, 10k resistor, and to the coin accepter. Looking at the code, I see nothing in there checking for pulses on Pin 2. How is the code getting the pulses?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    I am using interrupts in the code. Arduino nano and uno have 2 pins with interrupt functionality D2 and D3. You would need to check my tutorial kzread.info/dash/bejne/nYGotM-jaae5Yqw.html but also this is mentioned in the coin acceptor tutorial as well

  • @StreamMovieYT
    @StreamMovieYT11 ай бұрын

    Thx worked with HX 916 and i wanted to ask how you do the price so for example i have a flipper and when i press start it does -1€ but if its under it doesnt start pls do a tutorial thank you.

  • @MiguelHernandez-zv8ne

    @MiguelHernandez-zv8ne

    11 ай бұрын

    could you solve it? ... I also have the same model.

  • @jamalsaid7158

    @jamalsaid7158

    11 ай бұрын

    @@MiguelHernandez-zv8ne yeah it worked I'll send the code when it's done and use it for Arduino it put it on the computer but it still not with start thing if we found a solution we will tell

  • @Jandroverse
    @Jandroverse Жыл бұрын

    Nice project however, you will overflow "i" after a certain period of time when no one is using the machine. it would work fine just by adding if(i>=50){ i=0; }; add that at the end of the loop and it will eliminate your problem.

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    Well i didn’t know much about anything then :) i i actually not needed. I t would be much better to use millis function instead to measure the delay

  • @Jandroverse

    @Jandroverse

    Жыл бұрын

    @@marios_ideas yep…that was going to be my other suggestion. Either way great project and very good explanation!

  • @boutrazaata2714
    @boutrazaata27143 жыл бұрын

    Arduino UNO R3 will it also be compatible with your set-up

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Yes

  • @boutrazaata2714

    @boutrazaata2714

    3 жыл бұрын

    @@marios_ideas I'll give it a shot (Thank you)

  • @sploopvrdavao4631
    @sploopvrdavao46316 ай бұрын

    What is the difference between the COIN and COUNTER pin?

  • @mikawiemers8558

    @mikawiemers8558

    4 ай бұрын

    I think that each accepted coin gives one pulse to COUNTER-pin, that can be connected to a coin counter (counts number of coins, not value) and the COIN-pin gives out the predetermined pulses per different coin inserted. Like in this video 2€ - 1 pulse, 1€ - 2 pulses, 0,50€ - 3 pulses etc. COIN-pin pulses are to determine how much money has been inserted and COUNTER-pin pulses how many coins have been inserted (not sure if it counts all coins or only accepted, probably only the accepted)

  • @gennarogrosso2103
    @gennarogrosso21032 жыл бұрын

    Hi, I would like to be able to program the coin operated 616, similar to 926, inserting 3 coins from € 0.50 Send a single impulse, is it possible? Thank you.

  • @gennarogrosso2103

    @gennarogrosso2103

    2 жыл бұрын

    Hi, I would like to be able to program the coin operated 616, similar to 926, inserting 3 coins from € 0.50 Send a single impulse, is it possible? Thank you.

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Do not fully understand the post. “3 coins from € 50”?

  • @gennarogrosso2103

    @gennarogrosso2103

    2 жыл бұрын

    I explain myself better: By entering 1 coin from 2 € Scheduled for a coin for a single impulse. I would like to get a single pulse cumulating insertion of 2 coins from 1 €. it's possible? I can not do it. Thanks for your help.

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    @@gennarogrosso2103 one tyle of coin has a definiendum number of impulses. Yo can program it for 1 Eur to have one impuls or more . It aloes you to program up to 8 coin types

  • @gennarogrosso2103

    @gennarogrosso2103

    2 жыл бұрын

    @@marios_ideas May I cannot explain to me. Help me please. I have a small moon park, a game measures the strength by pulling a fist, every game on the game costs € 2. The programming is done so, I would like to get the same thing if in the coin holder they introduce 2 coins from 1 €, making the sum, 1 € + 1 € = 2 €, I should get a single pulse or, just one fist to measure strength. I am looking for confidence.

  • @othall9949
    @othall994911 ай бұрын

    Mario i love this idea, i have a project that i would love your help on if you're interested, it involves the coin acceptor you're working with

  • @nithinchandran3807
    @nithinchandran38072 жыл бұрын

    Broo can you include a vending moter also into the circuit, so that for a particular fixed total value , the arduino will trigger the vending moter and reset the total value for next count. Can u give code and circuit Diagram for that , it will be so helpful.

  • @boiyfact4918

    @boiyfact4918

    Жыл бұрын

    Sir i want to contact you . Please. I want help in a project

  • @wanzn471
    @wanzn4712 ай бұрын

    please make another adruino coin acceptor video with real life aplication , like controlling kids toy car or anything that based on timer countdown

  • @rcvtv3858
    @rcvtv3858 Жыл бұрын

    Good day sir can you make tutorials on how to change price in the arduino vendo machine using buttons? God bless ang keep safe always!

  • @ClbnaVGM
    @ClbnaVGM Жыл бұрын

    Do you know how to connect it to those cheap "zero lag" usb encoder please ?

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    What would be the role of that encoder? Send me the link to that part webpage

  • @ClbnaVGM

    @ClbnaVGM

    Жыл бұрын

    @@marios_ideas It's pretty generic so I wont be able to find a webpage. Here's a video however : kzread.info/dash/bejne/iYWcldqrhMKaZ6Q.html This board/encoder receives impulses from on/off microswitches (arcade buttons). My goal is to put the coin acceptor into a diy Raspberry Pi Arcade Cabinet.

  • @GenreFluid
    @GenreFluid3 жыл бұрын

    Would I still need an audino with a raspberry pi 400

  • @GenreFluid

    @GenreFluid

    3 жыл бұрын

    I want to make my raspberry pi 400 coin-op boot so I have to earn pocket money to run it

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Rasbery pi is different type of controller so you do not need Arduino but also my code would not work on Rasbery pi. You can apply the concept but I presume you have to write whole new code for rasbery pi. I have never worked with those controllers so cannot really help

  • @arshathossain8061
    @arshathossain80613 жыл бұрын

    Same 2 coin use to 1 puls, is it possible

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Generally it is possible in two cases: First one is if your code is not properly counting impulses. In my code I assumed the impulses are lass then 30ms apart if I am not mistaken , if your device has a different interval. Some have even a switch to control that interval. Fast midum and slow. If code does not correspond to the actual device setup then you can imagine two impulses are interpreted as one. The other case maybe if the learning process was not properly performed e.g you did not use the right sample amount or cheated the process by using the same coin over and over again and you have coin types that are similar. Then the device maybe confusing the types.

  • @carlosbasques4278
    @carlosbasques42782 жыл бұрын

    Hi. Congratulations for this video. It's possible do convert coin input to rest api? I would like to create a digital wallet to my child.

  • @alexherrera7568
    @alexherrera7568 Жыл бұрын

    Is it possible to replace it with an 16x2 LCD? thank you

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    The choice of the display is entirely up to you. The display is for outputing the number . You can also use oled displays e.g like in other project of mine kzread.info/dash/bejne/pZl4qZVmkd3KiLA.html

  • @alexherrera7568

    @alexherrera7568

    Жыл бұрын

    @@marios_ideas how it would change the code?

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    I can't write the code for you:) @@alexherrera7568 You can find the tutorials on how to use LCD displays. It is really not that complicated.

  • @jbm168
    @jbm1682 жыл бұрын

    Hello and thank you for your explanations. How can we do a total reset please? Thanks in advance

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    By starting a new setup you reset all previous settings

  • @BasitMirzaChannel
    @BasitMirzaChannel7 күн бұрын

    Hi. Can you program for me for a weight machine kindly?

  • @knerduno5942
    @knerduno59423 жыл бұрын

    I finally got all the parts and have it all assembled. Now in the Arduino code, I see there are five different libraries to pick from. You did not mention which one you are using.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    In the code at the top I have following library declaration #include #include #include

  • @knerduno5942

    @knerduno5942

    3 жыл бұрын

    @@marios_ideas Yes, but in the Arduino IDE, there are five different libraries. Using the search for TM1637, it shows five and turned out to be #3 in the shown choices.

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    @@knerduno5942 Check my video kzread.info/dash/bejne/eXyKr8SeltvApJs.html where I show which one I installed

  • @knerduno5942

    @knerduno5942

    3 жыл бұрын

    @@marios_ideas thank you kindly

  • @knerduno5942

    @knerduno5942

    3 жыл бұрын

    @@marios_ideas I think a good followup video to this would be using C# or C++ to get the data from the serial port while the Adruino is still connected, and displaying the data in an application

  • @akshaymane9027
    @akshaymane90273 жыл бұрын

    Sir make a video on coin based water dispenser system👉👉👉

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    I will be doing a wideo to control water pump to water flowers. As to water dispenser I can give you few guidelines. You can get cheap 5v water pumps on Aliexpress pl.aliexpress.com/item/32850821465.html You connect it to GND and the pin you want to control it with. When coin acceptor receives defined amount of coins you recognise it in the code and send the high signal to the water pump pin. You keep it High for as long as you have to to fill the water cup

  • @laohanme7281
    @laohanme72812 жыл бұрын

    why my incomingImpuls always keep increasing without any coin insert?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Your device may be faulty. What do you mean by increasing?

  • @GeekBoy03
    @GeekBoy033 жыл бұрын

    What is the purpose of the 10k resistor?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    From my video you probably got the idea that I come from the IT background and I learn electronics as I go. When I got this coin acceptor I checked online how other connected it and quite a few diagrams I got had that resistor. Since I didin't have a datasheet as such for this part I conencted it through this resistor and it worked. I am not sure if it is needed but didn't want to risk destroing the part I waited one month to arrive:)

  • @GeekBoy03

    @GeekBoy03

    3 жыл бұрын

    @@marios_ideas Thanks for the response. I have the 8 coin version. I had also bought a special device which converts the pulses to serial hexidecimal, but it seems to be a bit over complicated, and lacking the ability to connect the coin counter. This Adruino nano makes it a much better choice (and cheaper). Thanks for putting this up.

  • @alperduran55
    @alperduran553 жыл бұрын

    Does this work with LCD DIsplay I2C Module ?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    The dopłat is used just to display the total. Any display can be used but the code would need to be adjusted. I have not used LCD in the past but i do’t imaginacji this would be complicated. Just a change to few lines of code

  • @alperduran55

    @alperduran55

    3 жыл бұрын

    @@marios_ideas So u couldnt help me to change these few lines of code :(

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Optimus Prime I would need to first get my hands on LCD display. And play with it

  • @alperduran55

    @alperduran55

    3 жыл бұрын

    @@marios_ideas okay, but thanks for your answers

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Connectity like here: howtomechatronics.com/tutorials/arduino/lcd-tutorial/ You do not have to connect potentiometer Then in code: #include // includes the LiquidCrystal Library LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LC object. Parameters: (rs, enable, d4, d5, d6, d7) in setup function lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display } And the replace if(total_amount

  • @LexGoPH
    @LexGoPH3 жыл бұрын

    in the in the incomingImpuls function shouldn't there be a "i = 0" above "impulsCount=impulsCount+1" too? that way, it doesnt read the first impulse as only 1 and add the value you set for 1 impulse?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    This is one major problem with this code. When I was writing it I was not yet familiar with millis function. The use of i variable is a workarund . each time impuls is detected we reset i to 0 in the interrupt function. Then i gets incremented in the loop function. If we have multiple incoming impulses they are close apart. Inbetween each impuls the loop function is executed less then 30 times and we keep increase impulse count. If all impulsess I read then Loop gets executed more then 30 times and then we know there are no more impulses and then we can positivly finish coin recognition process. If I used millis I can meassure the exact interval between impulses and this way I would not need I variable at all.

  • @4x4Tobi

    @4x4Tobi

    3 жыл бұрын

    @@marios_ideas do we know the cycle time of your Arduino to get a feeling what these 30 times trough the loop stands for or even better do we know the exact interval time between impulses by now?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    ​@@4x4Tobi When I was creating this video I was not familiar with Millis function. This can replace this whole thing with counting cycles. Check my millies tutorial and you can then check the video I created for Eggtimer where I use millies in the interrupt functions to make sure I am not reacting to a single button press twice. This is the same concept I would use in corrected coin acceptor code if I was writing it now. I will be creating some Q&A videos and I may include it in it providing corrected code.

  • @richardgarcia5926
    @richardgarcia59263 жыл бұрын

    Can you do a coin counter using a coin hopper?

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Is this the device where you have different slot sizes through which coin drops and this way it gets recognised? I have many projects already planned so even if I will look into this one it will not be in immediate future

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Aaaa .. just checked what the coin hopper is. Cool looking device. I will do some research. Currently I have no revenue from this channel so I am scaling down on new items bought. But in the future I may look into it.

  • @user-be6ls6ox3e
    @user-be6ls6ox3e6 ай бұрын

    please i need the fisrt library in the code

  • @marios_ideas

    @marios_ideas

    6 ай бұрын

    Which library?

  • @robbiezxc
    @robbiezxc3 жыл бұрын

    Hi can you please show how to add a function to the code so something can happen at a certain amount of money like when you have put €2 in an led could light for a set period of time and then turn off but repeats when the next to €2 value was put in thanks 😀

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Connect LED e.g. to PIN6 #define LED 6 In Setup pinMode(LED, OUTPUT); digitalWrite(LED,LOW); And then in Loop function if(total_amount==2){ digitalWrite(LED,HIGH) You can connect anthing to this pin. E.g. magnetic lock.

  • @robbiezxc

    @robbiezxc

    3 жыл бұрын

    @@marios_ideas one more thing if you don't mind how do I get the light to stay on for 5 minutes and then turn off but turn back on again once another €2 has been entered

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    @@robbiezxc I will put short code for you tomorrow

  • @robbiezxc

    @robbiezxc

    3 жыл бұрын

    @@marios_ideas thanks I'll send you a tip when I get payed

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    The code using millis function which return number of milliseconds that passed since the program was started. I have a separate tutorial on this. #define LED 6 long Timestamp_2EUR=0; // records time when 2EUR was reached In Setup pinMode(LED, OUTPUT); digitalWrite(LED,LOW); And then in Loop function if(total_amount==2){ digitalWrite(LED,HIGH) if (Timestamp_2EUR==0) time_past=millis(); // if Timestamp_2EUR is 0 means we just reached 2EUR so we record the timestamp // if it is yet another loop run with 2eur reached Timestamp_2EUR is not changed } if (millis()-time_past>300000){ // 300000ms is 5min. We check if the 5 min was exceeded digitalWrite(LED,LOW) // LED off total_amount==0 //reset the balance

  • @ishackfrg5227
    @ishackfrg52273 жыл бұрын

    Sir pls kindly do one video how to connect coin acceptor controll box in to auotomatic front and top load washing machine (how to set with coin acceptor)🙏

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Weel. you overrate my skills. I would be able to build a simple vending machine but hacking into existing washing machine to introduce coin acceptor is much more complicated

  • @MSIUser2012

    @MSIUser2012

    3 жыл бұрын

    I am not sure what exact functionality you want in this control box, but a simple idea that can make integrating this coin acceptor with an automatic washing machine. - You can use a relay module with the Arduino and coin acceptor to turn on the washing machine. For example, to use the machine, user must insert 50 cents in the coin acceptor. Once the coin is inserted and it is equal to 50 cents, then the relay is triggered and the washing machine is turned on for an specific amount of time. After that time passes, the washing machine will automatically turn off and the coin acceptor will reset the amount to ZERO. Again, this is just a simple idea and I haven't tried it practically. But I hope it would help.

  • @Nico-pb1sr
    @Nico-pb1sr8 ай бұрын

    Where is the arduino receiving power from?

  • @marios_ideas

    @marios_ideas

    8 ай бұрын

    In the video if I am not mistaken I was powering Arduino from USB port of the PC or from the powerbank. However if you want to have a single power supply then you need 12 powere supply which powers the con acceptor but also connects to VIN and GND pins of Arduino. VIN pin is regulated down to 5V. Caution. Do not connect 12V to 5V pin as this will positively fry the microcontroller.

  • @Nico-pb1sr

    @Nico-pb1sr

    8 ай бұрын

    @@marios_ideas doesn't the coin acceptor have a current spike when a coin goes in? Will this affect the Arduino if on the same power supply?

  • @adityajadhawar-kv7gd
    @adityajadhawar-kv7gd7 ай бұрын

    wamuuuuuuuuuuuu

  • @mdrashadrashad8357
    @mdrashadrashad83572 жыл бұрын

    My machine is jammed, coin not gat in??

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    It must be mechanical problem which I cannot help you with. In unconnected state the coins pass through with no problem

  • @abeltiguaavellan1156
    @abeltiguaavellan11562 ай бұрын

    link is down

  • @user-sc6gr1xt3h
    @user-sc6gr1xt3h3 жыл бұрын

    When the coin is inserted too fast, an error occurs and cannot be judged

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    I did not experience this. This can be an issue with amount of samples when calibrating the device

  • @Nkanyiso94
    @Nkanyiso942 жыл бұрын

    Hi I have 2 questions 1)Can I add a servo motor? 2)Does coin acceptor work with Arduino UNO?

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    Yes and Yes:)

  • @Nkanyiso94

    @Nkanyiso94

    2 жыл бұрын

    Can we chat privately via email, I'm struggling with programming functions. I would really appreciate your collaboration 🙏

  • @simpasmarykimberly.2874
    @simpasmarykimberly.28742 жыл бұрын

    can I have the components please? thank you :)

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    All info is in the description . Go to the code link.

  • @ishackfrg5227
    @ishackfrg52273 жыл бұрын

    Any have in uae for this setting kindly contact me

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Not sureI get your question

  • @beverlyligutom7223
    @beverlyligutom72232 жыл бұрын

    Magkano po yan sir

  • @marios_ideas

    @marios_ideas

    2 жыл бұрын

    11USD

  • @romekatomek2159
    @romekatomek21593 жыл бұрын

    zainstaluj fizyczną blokadę po wrzuceniu monety "zasówka / zaślepka " - nie będziesz miał monet wrzuconych "so far"

  • @marios_ideas

    @marios_ideas

    3 жыл бұрын

    Nie wiem czy rozumiem. Wyjasnisz? Jesli wrzucam do pewnej kwoty to chce dorzucac kolejne monety i je zliczac

  • @hongtecklee135
    @hongtecklee135 Жыл бұрын

    So, you've invented a vending machine that does not payout the change...

  • @marios_ideas

    @marios_ideas

    Жыл бұрын

    ... in a nutshell:)

  • @hongtecklee135

    @hongtecklee135

    Жыл бұрын

    @@marios_ideas 🤭🧠❌️

Келесі