All paths

Build a vending machine

Build a real vending machine piece by piece: a keypad, a screen, coins and change, spirals, a drop sensor and service mode.

Arduino Uno R3Free6 lessons5 h3 chapters1,512 XPMaker · Advanced+250 XP

0 of 6 done

Start the course freeA keypad to choose withBuild it as a kitRetails for about $39, free on Mokxi.Lesson plan for teachers
What you will build

2 projects, built step by step

6 lessons in 3 chapters, about 5 hours on a simulated Arduino Uno R3. Free, in your browser, every step checked by the simulator.

Chapter 1 project

A screen for prices

Add a 16x2 LCD on an I2C backpack, so the machine can show prices, credit and messages with only two signal wires.

Open it in the simulator
Chapter 2 project

Did it really drop

Add an infrared beam across the bin, so the machine only takes your money when it sees the item fall, and tries again when it does not.

Open it in the simulator
The map

Chapter by chapter

Each lesson opens when the one before it is done, and each chapter ends in a project.

Chapter 1

The front panel

A keypad to choose with and a screen that talks back.

  1. Open189 XP

    A keypad to choose with

    Start the vending machine with a 4x4 keypad: sixteen keys on eight pins, read by scanning rows and columns, and a selection like B2.

    0 of 4 steps

  2. ProjectLocked378 XP

    A screen for prices

    Add a 16x2 LCD on an I2C backpack, so the machine can show prices, credit and messages with only two signal wires.

    0 of 4 steps

Chapter 2

Selling

Take money, turn a spiral, and make sure the item really fell.

  1. Locked189 XP

    Coins, bills and credit

    Add a coin switch and a bill switch, count credit in whole cents, and give a refund on the star key.

    0 of 4 steps

  2. Locked189 XP

    The first spiral

    Turn slot A1 with a continuous servo: pay, choose, and the spiral turns once and pushes the item off the end.

    0 of 4 steps

  3. ProjectLocked378 XP

    Did it really drop

    Add an infrared beam across the bin, so the machine only takes your money when it sees the item fall, and tries again when it does not.

    0 of 4 steps

Chapter 3

The finished machine

Four slots, stock counts, change for every price and a service code.

  1. Locked189 XP

    Four slots and service mode

    Finish the machine with four spirals, a speaker, sold out counts, change for every price, and a code that opens service mode.

    0 of 4 steps

Syllabus

Every lesson in the course

All 6 lessons, in order, each with what it covers. Any of them opens in the editor right away.

Chapter 1

The front panel

  1. A keypad to choose withStart the vending machine with a 4x4 keypad: sixteen keys on eight pins, read by scanning rows and columns, and a selection like B2.
  2. A screen for pricesAdd a 16x2 LCD on an I2C backpack, so the machine can show prices, credit and messages with only two signal wires.
Chapter 2

Selling

  1. Coins, bills and creditAdd a coin switch and a bill switch, count credit in whole cents, and give a refund on the star key.
  2. The first spiralTurn slot A1 with a continuous servo: pay, choose, and the spiral turns once and pushes the item off the end.
  3. Did it really dropAdd an infrared beam across the bin, so the machine only takes your money when it sees the item fall, and tries again when it does not.
Chapter 3

The finished machine

  1. Four slots and service modeFinish the machine with four spirals, a speaker, sold out counts, change for every price, and a code that opens service mode.
Keep going

The next course on your track

Build a vending machine is part of the maker track, a ladder of courses from zero to expert.

Next course

Build a word clock

A letter grid on WS2812 LEDs that spells the time: words as numbers, a snake-wired panel, a DS3231, brightness by light and animations.

Open the next course
Track

Maker track

Follow the starter kit you already own, then build a claw machine, a balance bot, a handheld console or an LED cube, each a short course checked by the simulator.

See every course on the track
Kits

Build it on your bench too

Every lesson runs in the simulator with nothing to buy. When you want the real thing, these kits have the parts.

The kit for this course

Vending Machine Kit

A keypad, a price screen, coin and bill slots, four spirals and a drop sensor.

Open the kit
Have a kit already?

Find your kit

Pick the starter kit you own and run every lesson in its manual with the same parts on the same pins.

See every kit
Questions

About Build a vending machine

Is Build a vending machine free?

Yes. All 6 lessons of Build a vending machine are free and run in your browser, with nothing to install and no parts to buy before you start.

Do I need a real Arduino Uno R3?

No. Every lesson runs on a simulated Arduino Uno R3 with its parts on the canvas, and the simulator checks each step as you go. When you want to build it for real, the same wiring and code work on a real board.

How long does Build a vending machine take?

About 5 hours: 6 lessons in 3 chapters, each one a few short steps. Your progress is kept, so you can stop after any lesson and pick up where you left off.

What will I build?

Each chapter ends in a project that puts it together: A screen for prices and Did it really drop.

Where do I start?

With "A keypad to choose with", and each lesson builds on the one before it. New to circuits? Electronics basics is the course that starts from zero.