MrCasinova.com > TX433 & RX433 RF Modules with AVR Microcontrollers in Slots
TX433 & RX433 RF Modules with AVR Microcontrollers in Slots
Being one of the most popular ways to gamble, slots are considered to be easy as you simply insert the money and watch the reels spin. In reality there is much more going on, both in free slots but especially when it comes to online real money casinos and real money slots. Read this guide to gain information on how slot machines work with AVR micro-controllers.
Sometimes in embedded design you may want to go wireless. Might be you will want to log various readings of remotely placed sensors, or simply build a remote control for a robot, car alarm system and slot machines. Radio communications between two AVR microcontrollers can be easy when specialized modules are used. In this guide, MrCasinova.com will try to run the very well known RF modules TX433 and RX433 that can be found in most electronics and repair shop.
The transmitter and receiver modules are tuned to work correctly at 433.92MHz. The transmitter can be powered from 3 to 12V power supply while the receiver accepts 5V. 5V is commonly used for AVR microcontrollers so there will not be any problems with interfacing. Modules don’t require addition components – simply apply power and connect a single data line to send information to/from. For better distances apply 30 – 35cm antennas. Modules use Amplitude-Shift Keying(ASK) modulation method and uses 1MHz bandwidth.
Two separate circuits have been constructed for the testing on Atmega8 microcontrollers.
For testing, the prototyping board and breadboard were used. Also, one LED was used to indicate RF activity.
When it comes to the software, radio transmission is a bit more complicated than wired communications because you never know what radio signals are present on air. All that matters is how the transmitted signal is encoded. And this is a part where you have many choices: use hardware encoding like USART or write your own based on one of the many ending methods like NRZ etc. Using hardware encoders solves many problems like synchronization, start and stop and various signal checks.
4 byte data packages where formed in order to send one byte of information. These include:
➡️ one dummy synchronization byte (10101010)
➡️ one address byte – in case there are more receivers or transmitters
➡️ one data byte
➡️ checksum which is actually a sum of address and data(address+data)
At the beginning a dummy byte can be used. When the transmitter doesn’t transmit any data, the receiver catches various noises that come from the power supply or from other sources. This is because the receiver adjusts its input gain depending on the input signal level. The first byte tunes the receiver to accept the normal signal. After that, the address byte, data and checksum can be reliably read. With different transmission modules you may easily exclude the dummy byte.
The Transmitter Program for AVR Atmega8:
Here, UART 1200 baud rate was used. It may be increased or decreased depending on the distance and environment. For longer distances, lower baud rates work better as there are bigger probability for transmission errors. The maximum bit rate of transmitter is 8kbits/s, around 2400 baud. But what works in theory usually does not work in practice. 1200 baud was the maximum rate with which it was working correctly.
The transmitter sends two commands (LEDON and LEDOFF) to the receiver with 100ms gaps. The receiver recognizes these commands and switches the LED on or off depending on the received command. This way the data transferred can be monitored that it works correctly. If the LED blink is periodical – then transmission goes without errors. If there is an error in the received data, then the LED gives a shorter blink.
Receiver program code:
The receiver program receives all four bytes, then checks if the checksum of the received bytes is the same as the received checksum value. If the checksum test passes, then the receiver addresses are compared and if the signal is addressed to the receiver, it will analyse the data.
Without the antennas transmission, it is more erroneous even if the modules are standing near by. In the below picture you can see the data packets of 4 bytes seen on the oscilloscopes. The yellow signal is from the transmission data line(TX), while the blue is taken from the receiver data line(RX):
The transmitted and received signals matching:
In the ideal world, there will be no noise between the data packages.
Building a Slot Machine with Micro-Controllers
Being one of the most popular ways to gamble, online slots are considered to be easy as you simply insert the money and watch the reels spin. In reality there is much more going on. Generally, slot machines have three or more reels, each containing symbols. Physical slot machines would typically have 20 or more symbols per reel, whereas digital slots are allowed to have many more, with some having 256 different symbols that hold millions of combinations. Slot machines also contain a random number generator that is able to generate thousands of combinations per second. Your winning or your loss is determined by the random number generator the second that you press the play button. Therefore, it is impossible to predict what will happen since each spin is random and unrelated to previous or future spins.
When it comes to the mechanism, a slot machine comprises of 2 main components:
1️⃣ CPU – This operates the slot machine and determines a random outcome and wager.
2️⃣ Reel Mechanism – This includes a motor with a rotatable shaft and a reel which is mounted to the shaft.
Slot machines are also built by using micro-controllers. The micro-controller is included in the reel driver where it is distinct from as well as coupled with the CPU. This causes the motor to rotate. The CPU will send commands to the reel driver related to the rotation. To free up the CPU for other tasks, the micro-controller performs low rotation operations. Some features of a slot machine are accessed via an LCD display screen by using navigation and a select button. The buttons use an algorithm that takes advantage of the micro-controllers.
With years of experience in the gambling industry, Sarah is knowledgeable in the field of the casino world. She is responsible for most of the content that is written on MrCasinova and her main goal is to provide casino players with the best information and recommendations to help users enhance their experience. Recently, Sarah graduated with a Professional Diploma in Digital Marketing.
In the media:
Subscribe to our Newsletter
Receive latest offers, bonuses & much more in your inbox.
If you subscribe you confirm you are 18+ and you accept to receive marketing material.