You Are Here: Home » AVR ATmega Projects » Game - Entertainment Projects » A Budget Pachinko Machine Using Atmega644

A Budget Pachinko Machine Using Atmega644




Pachinko is a game in which a ball drops down through a large quantity of pegs and the objective is to catch that ball in a fixed basket. The concept behind our machine is novel in that it was built using mostly discarded and salvaged parts. We built a pachinko machine because we wanted to play with one and none were around.

A Budget Pachinko Machine Using Atmega644

Not all projects have to further scientific advancements or revolutionize the industry. Our design was built for one purpose: fun. Having seen videos of pachinko machines on the internet as well as having played the popular computer game Peggle, we thought the game of pachinko would be fun to play in real life. Though both of us wanted to try out a pachinko machine, they are not common in our area; our only options were to buy one or build one. The machines themselves are relatively expensive and neither of us had the free time to build one. The open ended nature of this project assignment allowed for the perfect opportunity to build one.

Regular pachinko machines drop metal balls to fall through their pegs, our design uses skittles. The skittles add an extra element of fun to the game in that the machine dispenses all scoring skittles to the player. During a quick and informal survey, all players polled would rather eat the skittles than not.

High Level Design    top

Overview

Our project utilizes two microcontrollers. These two microcontrollers do not interface with each other except for a single reset bit. The first microcontroller is an ATMega32 and is used to controll all aspects of dropping a skittle. The second microcontroller is an ATMega644 and is used for all aspects of scoring. The division of control between two microcontrollers allowed for both partners to write code concurrently and without worry of affecting the other’s.

Standards

The only noteable standard that was adhered to in this project was the control protocol for servo motors.

Intellectual Property

Pachinko as a game is wildly popular in certain regions, most notably in Japan. As a result of its popularity, every conceivable iteration of the inner workings of pachinko machines has already been patented. Due to its early origins however, there is no trademark on the name “pachinko” itself. “Skittle” however, remains the trademark of Mars, Inc. The artwork done on our machine’s backboard was done by an external artist and is her intellectual property. Nintendo holds the copyright for Mario, but the use of his image in our backboard’s artwork should be covered under the fair use clause.

Background Math

A machine involving a dead drop of a perfectly spherical ball with symmetric and completely filled rows of pegs follows a binomial distribution in terms of where the ball will land. A skittle is not nearly a sphere and our design has a spinning motor, highly asymmetric layout of pegs, and was not fully filled with pegs; because of this, the binomial distribution no longer applies.

Hardware and Software Tradeoffs

A large portion of our project was hardware based. Originally we had a very grand plan for the machine, and as construction got going, it became clear that it was going to take a substantial amount of time. Most of the tradeoffs happened in hardware, as that is not our area of expertise, and most of these tradeoffs involved simplifying or speeding up construction so that we would actually have something to control with our code. Simplification of the hardware usually led to some simplification of coding, so there weren’t many tradeoffs between hardware and software, but more between hardware and how much time we had left to practically finish the project.

We originally planned to have a moving dispenser on rails along the top of the case to allow for additional control. This concept failed because we were unable to fit the rails salvaged from a printer into the main pachinko case.

We also originally planned on including sounds and music. Initial testing showed the speaker salvaged from a printer was too quiet. We could have found another speaker or make other modifications to make the sounds work, but we were low on time and it was not essential to the system, so the idea was scrapped.

Another concept not implemented in the final version of our design was a tilt sensor which would work to prevent cheating. Testing showed that the sensor was too sensitive, and constantly triggered. We could have found a work-around or used another sensor, but we were low on time and the sensor was not essential to the system so the idea was scrapped.

In the spirit of reuse and recycling, we planned on using the seemingly unlimited supply of screws from the scanner and printers as the pegs in pachinko machine. This idea was scrapped because it was more important to us that the user be able to eat their winning skittles. The screws were deemed too contaminated to be allowed to come in contact with food, and so fresh push pins were used in their place.

High Level Block Diagram

The overall structure of this is relatively simple. A skittle is dispensed from the dispenser, which falls down through the pegs. It may land in a scoring basket. If it does, the score increments by one and the user gets to eat the skittle. If not, the skittle is deposited behind the machine.

Hardware

It is entirely possible that someone else could build this from what we have written. In fact, someone with access to better machining equipment could build one of much higher quality and durability than ours. One of our major challenges was just building the system physically. All of our electronics are easily replicable and someone with a moderate level of experience in wiring and microcontrollers should find success in building this or using our system to build something similar.

Hardware Design

The electrical schematic for our design is split between the ATMega32 and ATMega644.

Hardware Components

Schmitt Triggers

Schmitt Triggers are what notify the system that a skittle has scored in a basket. The actual sensors are analog, but the schmitt triggers cause their output to be converted into a binary digital signal. These are quite important for the system to keep track of the current score, and sometimes are finicky to tune. At first we tried a packaged Schmitt trigger, but due to lack of tunability, we decided to make our own out of op-amps and a potentiometer.

H-Bridge/DC Motor

The use of an H bridge to control a DC motor is fairly standard practice, especially in small electronics projects. The H bridge can allow current to flow either direction through a DC motor based on the logic inputs, which allows control of a motor in either direction. We used this in our project to add an element of both randomness and control for the user. We wound up using a Toshiba TA7291P package that is rated for 1 amp. Since our motor did not need extremely high amounts of current draw, this suited our needs nicely and was easy on the budget.

IR Emitters/Detectors

We used a set of 5 IR emitters/detectors in order to sense our skittle scores. The output of these were hooked into the Schmitt triggers which then fed into the microcontroller. The Schmitt triggers had to be extremely finely tuned because skittles are largely transparent to IR light, and therefore cause only a minimal signal at the sensor. Another of the challenges we faced with these was physically mounting them. In order for them to function, they needed to be moderately close and we had to make sure that the skittle would block off the IR emitter without getting stuck in our passageway. The imperfect spheroid shape of the skittles made this surprisingly hard. Eventually we figured out a system that relied on guiding the skittle through moderately close quarters.

Display Board

A Budget Pachinko Machine Using Atmega644

The display board shown below is a collection of components mounted at the top of the machine whose purpose is to provide the user with visual feedback about the system. An LCD is used to display the all-time highscore as well as useful messages. A three digit, seven-segment display is used to show the user’s current score. Another, one digit, seven-segment display is used to indicate the state of the DC motor. A 5×7 LED matrix is used to show how many skittles remain in the user’s current game session.

Parts List:

PartSourceProduct Number

Unit Price




Cost
ScannerIthaca Second-hand reuse center

$10.00

$10.00

LCD (16×2)lab

$8.00

$8.00

H Bridge (2)digikey.comTA7291PO-ND

$1.64

$3.28

Target Board (2)lab

$4.00

$8.00

DIP socket (2)lab

$0.50

$1.00

Header pins (24)lab

$0.05

$1.20

Sockets (16)lab

$0.05

$0.80

ATMega32lab

$1.00

$1.00

ATMega644lab

$6.00

$6.00

Solder boardlab

$2.50

$2.50

Small solder board (2)lab

$2.00

$2.00

5 input NOR gatelab74ls260

$0.00

$0.00

Schmitt Trigger (5)lablm358

$0.00

$0.00

Push pins (30)lab

$0.00

$0.00

Large capacitorlab

$0.00

$0.00

Assorted resistorslab

$0.00

$0.00

IR emitters (5)lab

$0.00

$0.00

IR detectors(5)lab

$0.00

$0.00

Foam boardlab

$0.00

$0.00

DC motorsalvaged – dead printer

$0.00

$0.00

Laser reflectorsalvaged – scanner

$0.00

$0.00

Large power supplysalvaged – scanner

$0.00

$0.00

Outer casesalvaged – scanner

$0.00

$0.00

Assorted cardboardsalvaged – recycling

$0.00

$0.00

12V power supply (2)pre-owned

$0.00

$0.00

Servo motorpre-owned

$0.00

$0.00

Jumper cablepre-owned

$0.00

$0.00

5 V regulatorpre-owned

$0.00

$0.00

TOTAL PROJECT COST

$43.78

 

For more detail: A Budget Pachinko Machine Using Atmega644

Leave a Comment

You must be logged in to post a comment.

Read previous post:
‘Straintronic spin neuron’ may greatly improve neural computing

(Phys.org)—Researchers have proposed a new type of artificial neuron called a "straintronic spin neuron" that could serve as the basic...

Close
Scroll to top