Chocolate Vending Machine

This working model of a vending machine uses electronics and mechanisms which were probably used in real vending machines. It was first built in 1995 and has since been re-painted and re-built with a more reliable mechanism.

Using the machine

Insert a 2p coin into the coin slot on the left of the machine. The yellow button will light. Select a sweet by turning the black knob to one of the three positions. Press the yellow button.

How it works: The electronics

The vending machine uses a simple circuit with two relays wired up to ‘latch’ on when power is applied to the relay coil. The relays stay on until the power is removed.

When a coin is inserted into the coin slot, it pushes a micro-switch S4 which switches on the money relay RL1. The button lamp L3 and the lamps above the sweet dispensers L4–6 will now be lit. When the button S5 is pressed, the button relay RL2 is switched on, activating one of the three motors depending on the position of rotary switch S6. The diodes D1–3 stop current passing the wrong way through the other motors via the other lamps. The motor rotates, pushing out a sweet, until one of three normally-closed micro-switches S7–9 is activated by one of the gear wheels. This breaks the circuit to the money relay RL1 and switches it off. In turn, button relay RL2 is also switched off. The motor and lamps are now off ready for the next customer.

How it works: The mechanics

Each of the three sweet dispensers is driven by a 9V motor which has a worm gear on its axle. This meshes with a 19-tooth pinion which in turn meshes with a 57-tooth gear. The axle on which this gear is placed runs down to the base of the dispenser where a 19-tooth pinion meshes with a 57-tooth gear that pushes out the sweet. On the underside of this gear is a right-angle bracket that pushes against a micro-switch S7–9 to reset the system after one revolution.

Operating the machine

To open the side door of the machine requires the key to be inserted into the key-switch at the rear of the machine. The rear door is simply held closed by a magnet. Behind the side door, there is access to the money tray and three switches. The system on/off switch turns the machine on and off. The light switch operates three lamps to light the inside of the machine. An empty button is provided to allow each dispenser to be quickly emptied. When pressed, the motor of the chosen dispenser turns rapidly and the system is not reset after each revolution.

To load sweets into the machine means first flicking the system on/off switch. The dispenser to be filled is selected using the rotary switch, and the empty button is pushed momentarily.

A Meccano axle rod is inserted at the base of the dispenser to stop the sweets falling out as the dispenser is loaded. The back of the dispenser is on a hinge and is opened by pulling down a catch at the top. After loading the sweets, the back of the dispenser is put back into place, the axle rod is removed and the system on/off switch is flicked again.

This procedure may seem like a lot of hassle, but it is better than the procedure for loading the original machine: the whole mechanism had to be removed, and it was awkward putting it back into place!


Hello, I’m doing a GCSE project for construction at school and I’m hoping to do a sweet dispenser, but I need to know the price of competitive products. So if you were to sell this what would be the price? Thank you, William.

Haven’t got a clue, I’m afraid! This a Meccano model, not a product that one would sell.

Thanks Tim for your great effort and support. I would like to get some clarifications for the circuit! What is the use of S10A & S10B, are they used to empty the dispensers? ? What are E1 & E2 — are they inductors? And what is the use of using an inductor? What kind of motors to do you suggest. Finally what is the FRAME at the bottom of the circuit? What kind of diodes could be used? Are they normal ones? Thanks and regards.

Hi Rima, S10a and S10b are both poles of a double-pole button. When it is pushed, all the motors turn so that the machine can be emptied easily. E1 and E2 were electromagnets that opened the rear door when the key in the key switch was turned. I believe the motors I used were 9V, probably brought from Maplin or Rapid. The ‘frame’ is the metal chassis of the model — I connected this to 0V to make wiring up the lamps easier since the lamp holders have one of their connections at the fixing post (these were salvaged from an old pinball machine). The diodes were 1N4001 — nothing special. Basically they need to be able to handle the motor load current, which in this case was under the 1A that the 1N4001 can pass. Hope this helps!

pls give details how it will sense different type of coin (denomination) as well as what is the motor used in the circuit.

Jenat: It didn’t sense the denomination at all — there was just a microswitch positioned so a coin of the right diameter would activate it. I’m afraid I have forgotten where the motors came from, but they were all the same type.

Your e-mail address will not be displayed in public and will not be added to mailing lists. Please see our privacy policy for further information.

Please wait while we post your message…