Model 8: Candy machine

Give me candy!

Grade
6-8
Time required
2 Double lessons
Difficulty level
Modell: medium, Programming: hard
Model type
Vending machine: a stationary device, individually fillable for dispensing various small items (candies, pills, dietary supplements)

MODEL DESCRIPTION / TASK

Students plan and implement a vending machine for storing and dispensing small items, such as candies. The selection of the desired product on a motorized turntable is done using a button. The product is visible but not yet accessible. Only through an access system using a magnetic switch (Reed contact) can the product be retrieved. This opens a motorized access security mechanism.

To expand the system, an alert lamp (LED) can be integrated to indicate when the product can be safely retrieved. Before closing the security mechanism, this lamp blinks as a warning.

EVERYDAY RELEVANCE

The automatic operation of a machine and the dispensing of an (edible) item have a strong motivational effect on students. Many comparable solutions are known from everyday life (gum vending machine, beverage dispenser, bumper cars, etc.). However, the incentive to manipulate a professional system to one's advantage is also recognized. This leads to considerations on designing their own solution to be transparent yet also as tamper-proof as possible.

Key questions

  • What functions need to be fulfilled for the encoded triggering of an operation? (Communication and collaboration)

  • How can the goods contained in the machine be selected by the user? (Communication and collaboration)

  • How can the goods in the machine be protected from access or how can access be granted? (Creativity and critical thinking)

  • What aspects of the design need to be considered to protect the machine from manipulation and ensure robustness? (Creativity and critical thinking)

Fächerbezug

Informatics
Basics of programming, switches, sensors, time loops
Mathematics
Angle of a circle
Economics
Sales strategies
Physics
Capturing physical quantities (rotational angle, end stop)

Lesson progression

Introduction phase

Classroom discussion (without app)

  • Inquire about everyday applications where processes are initiated by code-controlled systems.
  • Discuss the possibilities of manipulating such systems and measures to protect against manipulation.
  • Discuss the advantages and disadvantages of various methods of tamper protection.
  • Specify which sensors and actuators should be used. The functioning principle of the sensors and the actuator will be discussed.
  • Possibly provide initial prospects for differentiation.
  • The basic function to be achieved by the system will be defined by the teacher and discussed together.

If necessary, provide assistance.

  •  Show sensors, actuators, and components from the construction kit, using presentation media if needed.
Planning phase

Classroom discussion (with app)

  • The teacher guides the process using the app's workflow steps.

Partner or individual work (with app)

  •  Students familiarize themselves with the app and download the corresponding task.
  • Students complete two tasks for planning the system in the app.

Optional partner or group work (without app)

  • Students sketch a possible system, discuss the results, and agree on a design.
Construction phase

Partner or individual work (with app)

  • Students use the app to build the dispenser machine. The app guides them step by step through the program.
Programming phase

Partner or group work (with app)

  • Students write the program for the dispenser machine. The app guides them step by step through the program; help is available within the app.
  • The program is transferred to the RX controller.
Experimenation and test phase

Partner or group work (with app)

  • The machine is put into operation and tested.
  • Possible disruptions in the operational sequence must be identified and resolved. Assistance is provided within the app.
  • Any optimizations in the programming (time loops for closing the dispensing) need to be made.
  • The protection of the system against manipulation is tested if necessary.
Final phase

Optional: Presentation and assignment of differentiation (with app)

  • If applicable, students identified for differentiation are approached by the teacher. This includes clarifying optimization possibilities for the system (visual display).
  • The app guides the quick learners through the necessary steps.

 

Plenum discussion

  • Post-project discussion within the class
  • Strengths and weaknesses of the solutions are identified and applied to everyday automatons.

 

Information and notes

Methodical and didactic tips

Differentiation options

The system can be supplemented with a green LED and programmed to provide visual clearance (green LED) when the product can be removed. A blinking function can also be programmed to indicate the closing of the access lock.

Motivationale Aspekte

Sweets themselves have a certain effect on students. However, the automated dispensing of tangible items (as opposed to just information) also holds an allure. The associated topic of manipulating information (in this case, input information) is familiar to students and relevant in many other aspects of life. Both factors contribute to fostering intrinsic motivation.

Additional material

  • Optional: Drawing media (paper, whiteboard, or projection surface)

Functions of the model and their technical solutions

 

Functions of the Actuators/Sensors

Technical solutions


Detecting a signal for the rotation of the goods warehouse


Analyzing the input button signal


Rotation of the goods storage


Control of the motor of the rotating carousel


Stopping position of the merchandise storage


Evaluating the cam-operated signal from the position switch


Verification of the legitimacy of the dispensing


Triggering the reed contact


Opening the access protection


Controlling the barrier motor using a time loop


Waiting time of the motor control for the product retrieval


Time loop


Closing of the access guard


Actuation of the barrier's motor via a time loop


Turning off the motor of the access barrier


Evaluating the signal from the limit switch


Differentiation 1: Visual indication that goods can be removed


Green LED blinking


Differentiation 2: Optical indication that access protection is about to close


Green LED blinking

Material list

Material list basic circuit vendor machine

Sensors

Functions


1 Push button


Signal for gearbox motor 1


Push button


Limit switch for gearbox motor 1

 
Push button


Limit switch for gearbox motor 2


1 Reedswitch


Signal for gearbox motor 1

 


Actuators

Functions


1 Gearbox motor 1


Rotation of the storage unit


1 Gearbox motor 2


Opening of the access guard

 

 

Material list Differentiationtask vendor machine

 

Actuators

Function


1 LED, green

 


Visual inspection lamp


cd-green-58bb58464c-46z77