I want to make parking system for my brother who owns a bar. Just a simple system that opens the gate, when someone puts in coin acceptor 0,5€.
I got the coin acceptor and connected it to computer and then I also calibrated it and it worked perfectly. If I put coin in it, the terminal on computer showed that the coin was entered.
It worked very fast. When I put it in coin acceptor it was already on my PC screen.
After that I wanted to connect it to Arduino UNO since I will be using it for controling the entering gate and coin acceptor. The whole thing works but very slow. I put in a coin and after 5 seconds it appears on LCD instead of immidiately like on computer.
Here is my question: Where is the fault? Is the arduino UNO to slow at proccesing data over COM port and displaying it on LCD 20x4, because the same thing works on computer flawlessly.
And which version of Arduino would be better if UNO is to weak; maybe MEGA ..
Here is my question: Where is the fault? Is the arduino UNO to slow at proccesing data over COM port and displaying it on LCD 20x4, because the same thing works on computer flawlessly.
And which version of Arduino would be better if UNO is to weak; maybe MEGA ..
Without the whole code listing, I would only be guessing.... Ummmm, let's see....
That would be little help to you and frustrating for me.
So, generally I would say that you need to understand that the AVR is 8-bit (your PC is likely 64-bit with a highly cached CPU and gigabits of RAM) and the Atmega328p-PU used in the UNO only has 2K of SRAM.
However, the Mega is also 8-bit, but has 8K of SRAM however it runs at the same 16MHz clock. The internal architecture of the AVR core is nearly identical for the Mega, so it will not run any faster than the UNO.
You obviously have a very good grasp of programming the AVR since you have completed the project and I see that this is only your first forum post. Therefore, I must assume you have a fair programming background and this project is just causing you to question the choice of microcontroller.
My guess is that there is some programming issue in your code since the coin device does the authentication and passes that handshake to the UNO. As I do not know what the interface is between the two devices, I would suggest that you attempt to simulate the coin acceptor interface .... ASCII, digital, etc. and time the UNO after it receives the simulated signal. Use the LED on pin #13 to light before any of your LCD routines... the LED and LCD should almost be simultaneous, right?
Break down the problem... separate the coin acceptor, use the internal LED, etc.
Thanks, the problem was in my program. I managed to fix it.
I still have one question. Can be arduino connected to 2 devices via COM port at the same time. Because my coin acceptor is connected with Rx Tx pins to arduino so COMport is already taken. Since I want to connect arduino also on computer and send him data, to create database and see how much money my brother got from parking. Is there any arduino with 2 Com ports or can I somehow control COMport to send data to PC or coin acceptor.
ChilliTronix:
Look up software serial. That may help.
Yes - SoftwareSerial.... But
Nick Gammon created a send-only version of SoftwareSerial for the ATtiny. This version can be used on UNO and will save resources since the Op wishes only to echo the data to the PC. Nick's Post