Go Down

Topic: Arduino Voucher Code Generator of MikroTik (Read 1 time) previous topic - next topic


So I have a unit of WiFi Vendo Machine (I did not make this or programmed this, it just happened that I have one). As I observed its flow/process:

1. Insert a coin, and then the LCD will show how much you inserted a coin and the equivalent duration of rent.
2. If you're satisfied with the duration you want, you'll have to push a button.
3. After pushing a button, I see this message on LCD screen and it says
  • SD Write: Passed - this generate a voucher code from the Arduino I guess? I has a 5 character-long of username and password
  • Coin Counter: Update - number of total coins inserted (including past transactions) 
  • Sending Data: Success - This one registers the voucher code on router using a command line that will execute on router's terminal

4. Then after adding/registering the voucher code on the router, the voucher code (user/pass) will now display in LCD

As I opened the unit, there's a MEGA, Ethernet Shield, a button and a universal coin slot. I noticed that there's an SD card on Ethernet Shield so I tried opening it to see what is inside.

What I found in the SD are 3 text files (sometimes 2, I'll explain it later how it works)
1. Rate.txt - this is the rate of 1 peso coin. In my case 1 peso coin = 9 minutes
2. Hotspot.txt - this is where the command line is stored

/ip hotspot user add server=all name=OcCwM password=80443 limit-uptime=0:18:00 disabled=no profile=PisoWifi
This text file will disappear if the unit or the arduino is connected to the router through ethernet cable. If not, the text file remains and the voucher code on it.

3. Counter.txt - this is where you find the coins inserted per transactions. example:
So if you restart/reboot the unit, the arduino will get the sum of these transaction and display it on LCD.

My main problem is that, how does the arduino send the data to the router? How does the arduino execute the command line to add user/pass (voucher code)? And before executing the command line, you have to log in to the routerOS then execute the command in Terminal.


what is the model of the mikrotik? and can you send pics of the unit?



Hi, Im building the same problem, can you help me?


Oct 15, 2018, 06:14 pm Last Edit: Oct 16, 2018, 03:59 am by JacobFaj
This is my observation,
- pulses will determine by the arduino, 1 5 or 10
- at the press of button, the program will sum up all the pulse value into total number of minutes then a script will be created on a text file save on sdcard
- mikrotik has a scheduler of 5 seconds to detect wheather the file exist or not, if exist it will fetch the voucher code and add it
- mikrotik will delete that text file immediately after registered

I am still researching how to do all of this LOL!!! Just pm me if you managed to do all this.


i am also making this project i also have 1 unit of this i am not the one who build or program it. I already manage to assemble all the parts and connection of wires. The only i am trying to figure out is how the txt file from sdcard module be read by arduino mega 2560 and username/password be displayed in i2c lcd.....finding it hard hehehe....any updates guys ty

Go Up