Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Troubleshooting
  3. [SOLVED] Apex Serials 5000 Bill Acceptor with Arduino Mega 2560 over Serial (600 baud, 1 start bit, 1 stop bit, no parity)

[SOLVED] Apex Serials 5000 Bill Acceptor with Arduino Mega 2560 over Serial (600 baud, 1 start bit, 1 stop bit, no parity)

Scheduled Pinned Locked Moved Troubleshooting
10 Posts 3 Posters 9.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • jesseJ Offline
    jesseJ Offline
    jesse
    wrote on last edited by jesse
    #1

    I'm trying to get a Apex Series 5000 Bill Acceptor to communicate with an Arduino Mega 2560. When I plug the Bill Acceptor's output Serial TTL line into the raw Serial input port (TX0->1) of the Arduino and run the Windows program RealTerm, the data can be seen in the Terminal.

    Screenshot: http://i.imgur.com/Nt0LyVs.png

    81 (hex) means 1 dollar was inserted in the bill acceptor.

    When I try to use the Arduino Mega's Serial1 input port, it doesn't recognize and display the input from the bill acceptor.

    Source code: http://codebender.cc/sketch:58090

    Is the config in the screenshot different from the config in the source code?

    Z 1 Reply Last reply
    0
    • daulagariD Offline
      daulagariD Offline
      daulagari
      Hero Member
      wrote on last edited by
      #2

      Is the config in the screenshot different from the config in the source code?

      Yes it is, I see Realterm using 600 baud and with the Arduino source code you seem to use 115200 baud.

      jesseJ 1 Reply Last reply
      0
      • daulagariD daulagari

        Is the config in the screenshot different from the config in the source code?

        Yes it is, I see Realterm using 600 baud and with the Arduino source code you seem to use 115200 baud.

        jesseJ Offline
        jesseJ Offline
        jesse
        wrote on last edited by
        #3

        @daulagari 115200 is for the regular interface to read the serial output. Serial1 is at 600 baud and is connected to the bill acceptor.

        1 Reply Last reply
        0
        • daulagariD Offline
          daulagariD Offline
          daulagari
          Hero Member
          wrote on last edited by
          #4

          115200 is for the regular interface to read the serial output. Serial1 is at 600 baud and is connected to the bill acceptor.

          Right, reading too fast.
          But then I do not understand:

          When I plug the Bill Acceptor's output Serial TTL line into the raw Serial input port (TX0->1) of the Arduino and run the Windows program RealTerm, the data can be seen in the Terminal.

          So the Bill Acceptor's output Serial TTL line goed into the raw Serial input port (TX0->1) of the Arduino but how do you see then the output in RealTerm (which is set to 600 baud?)

          jesseJ 1 Reply Last reply
          0
          • daulagariD daulagari

            115200 is for the regular interface to read the serial output. Serial1 is at 600 baud and is connected to the bill acceptor.

            Right, reading too fast.
            But then I do not understand:

            When I plug the Bill Acceptor's output Serial TTL line into the raw Serial input port (TX0->1) of the Arduino and run the Windows program RealTerm, the data can be seen in the Terminal.

            So the Bill Acceptor's output Serial TTL line goed into the raw Serial input port (TX0->1) of the Arduino but how do you see then the output in RealTerm (which is set to 600 baud?)

            jesseJ Offline
            jesseJ Offline
            jesse
            wrote on last edited by jesse
            #5

            @daulagari The Arduino can be used like it was a serial to USB adapter. Just plug the wire(s) in to RX0 (Pin 0) and TX0 (Pin 1) and load up a terminal host (ex: RealTerm). The output serial line is connected to the Arduino TX0, The data passes through without the Arduino being programmed to do anything.

            It works similar to one of these devices which can be used to program the Arduino Pro mini or as a general TTL serial port: http://www.ebay.com/itm/360916810060. An example use case is reading GPS data though a serial to USB adapter.

            1 Reply Last reply
            0
            • daulagariD Offline
              daulagariD Offline
              daulagari
              Hero Member
              wrote on last edited by
              #6

              The Arduino can be used like it was a serial to USB adapter. Just plug the wire(s) in to RX0 (Pin 0) and TX0 (Pin 1) and load up a terminal host (ex: RealTerm). The output serial line is connected to the Arduino TX0, The data passes through without the Arduino being programmed to do anything.

              Okay, did not know that, thanks!

              Yes, then the behavior you describe, the Arduino Mega not recognizing the data, is really weird.

              1 Reply Last reply
              0
              • jesseJ Offline
                jesseJ Offline
                jesse
                wrote on last edited by
                #7

                I'm going to try using Software Serial on an Uno instead of Serial(1 to 3) on the Mega

                1 Reply Last reply
                0
                • jesseJ jesse

                  I'm trying to get a Apex Series 5000 Bill Acceptor to communicate with an Arduino Mega 2560. When I plug the Bill Acceptor's output Serial TTL line into the raw Serial input port (TX0->1) of the Arduino and run the Windows program RealTerm, the data can be seen in the Terminal.

                  Screenshot: http://i.imgur.com/Nt0LyVs.png

                  81 (hex) means 1 dollar was inserted in the bill acceptor.

                  When I try to use the Arduino Mega's Serial1 input port, it doesn't recognize and display the input from the bill acceptor.

                  Source code: http://codebender.cc/sketch:58090

                  Is the config in the screenshot different from the config in the source code?

                  Z Offline
                  Z Offline
                  Zeph
                  Hero Member
                  wrote on last edited by
                  #8

                  @jesse
                  Thoughts:

                  Did you get any "serialEvent1 called" debug output?

                  Try moving lines 17-20 inside the loop function.

                  I assume RealTerm is now configured for 115,200 baud (rather than 600) when you run the code.

                  I assume that you've connected the bill accepter output to RX1 (vs Tx0 in the direct connection, since you want to go into the ATMega, not replace it's TX output).

                  By the way, you might have some trouble with Software Serial at that low a baud rate, if it keeps interrupts disabled for too long while receiving a byte (16.7 msec per byte). Not sure if it does that for receive-only, you can check.

                  jesseJ 1 Reply Last reply
                  0
                  • Z Zeph

                    @jesse
                    Thoughts:

                    Did you get any "serialEvent1 called" debug output?

                    Try moving lines 17-20 inside the loop function.

                    I assume RealTerm is now configured for 115,200 baud (rather than 600) when you run the code.

                    I assume that you've connected the bill accepter output to RX1 (vs Tx0 in the direct connection, since you want to go into the ATMega, not replace it's TX output).

                    By the way, you might have some trouble with Software Serial at that low a baud rate, if it keeps interrupts disabled for too long while receiving a byte (16.7 msec per byte). Not sure if it does that for receive-only, you can check.

                    jesseJ Offline
                    jesseJ Offline
                    jesse
                    wrote on last edited by
                    #9

                    @Zeph I found the problem by connecting the Serial output line to analog pin 0. Low was about 320/1023, floating was about 330/1023, and high was about 340/1023. I used the internal pull-up on Serial1. Then it became possible to read the Serial data.

                    The embedded code in the first post was updated automatically as work progressed.

                    1 Reply Last reply
                    0
                    • jesseJ Offline
                      jesseJ Offline
                      jesse
                      wrote on last edited by
                      #10

                      Here's a better sketch that uses Software Serial.

                      http://imgur.com/b6bOSuH

                      https://codebender.cc/sketch:61723

                      https://www.youtube.com/watch?v=OfaXlIDLQyQ

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      14

                      Online

                      11.7k

                      Users

                      11.2k

                      Topics

                      113.1k

                      Posts


                      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • MySensors
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular