From Sensors to AI: Building a Safer, Smarter Culinary Space
Before building, ensure your environment is ready:
This project uses the Arduino Uno control board, which connects to a plethora of auxiliary devices to perform various actions. The specifics of the Arduino Uno are as follows:
The project also includes a battery pack and charger as shown:
The power supply can only charge one battery at a time. When the charging indicator light goes out, it means the left battery is fully charged. Swap the positions of the two batteries and continue charging the other battery.
When using the mainboard motor drive, this power supply is required, and a 3.7V output is sufficient. Unplug the power cord when not in use.
The main structure consists of a number of wooden components and auxiliary devices. Below are the steps on how to properly assemble them into the Smart Campus model:
Take wooden plate #5 and screw four M3*6 countersunk screws through the screw holes and into the copper pillars. Pay attention to the orientation shown in the diagram.
Using 3 more M3*6 countersunk screws, attach the Arduino Uno to the copper pillars as shown.
Attach the OLED screen to the space at the top of the wooden plate #2 using four of the black fasteners shown in the image. (Do not separate the two parts of the black fasteners, simply push them through the holes as indicated in the diagram until they tighten.)
Take the right wall plate (wooden plate #3) and fasten the button and human sensor modules as shown.
Take the left wall plate (wooden plate #4) and fasten the fan module in the position shown, then attach the fan head to the motor shaft.
Take the back wall plate (wooden plate #6) and fasten (from left to right) the clock module, temperature and humidity sensor module, and the sound receiver module. Note the different widths of wire holes to account for different sized wire bundles (5-wire, 4-wire, etc.)
Connect the wall plates with the middle floor plate as depicted, and use the small rubber bands to secure the wooden tabs in place.
Connect this assembly to the two-part base plate (wooden plate #1) in the orientation depicted, again using rubber bands to hold the wooden tabs on the bottom of the structure.
Take the school gate backboard (wooden plate #20) and attach the two 180-degree servo motors in the positions shown, fastening them to the board with a pair of long M2 screws and nuts. (Note: take care to use the 180-degree servos and not the 360-degree servo - despite their similar appearance, they are labeled accordingly on their bags.)
Affix the plastic servo arms to the servo heads in the positions shown, and then attach the wooden barrier arms (wooden plates #22 and #23) using the servos’ shaft screws.
Affix the gate assembly to the base plate #1 in the position shown, and connect the gate front plate and roof plate (wooden plates #19 and #21, respectively), fastening the whole gate assembly together with rubber bands on the wooden tabs.
Take the left canteen wall plate (wooden plate #9) and fasten the MP3 module to it as shown.
Assemble the left canteen wall plate together with the right canteen wall plate (#10), the canteen front plate (#8), and the canteen back plate (#11) to complete the canteen structure, and fasten the wooden tabs with rubber bands.
Attach the RFID module to the canteen roof plate (wooden plate #12) as shown, then attach the canteen roof plate to the top of the canteen structure with the RFID module closer to the left wall and secure the wooden tabs with rubber bands.
Attach canteen building to platform base in the orientation shown, with the back wall facing the outside of the campus area, and secure the wooden tabs on the bottom of the base plate with rubber bands.
Assemble the flag platform base with wooden plates #13, #14, #15, #16, and #18 as shown in the diagram.
Take the flagpole (wooden plate #17) and insert the 360-degree servo through the rectangular hole, securing it with two M2 screws + nuts. Fix the large pulley wheel to the servo shaft using the servo shaft screw, then connect the small pulleys to the other end of the flagpole and run the large rubber band between the small and large pulleys.
Insert the flagpole into the slot in the flagpole base, attach the flag to the rubber band at the top of the flagpole, and use four rubber bands to stabilize the structure underneath the base plate, as shown in the diagram.
Note that the 360-degree servo cable should be routed through the hole in the bottom of the main structure to reach the Arduino.
Attach the RGB light strip to the inside of the main building’s front wall.
Fix the rain sensor, light sensor, IR receiver, and AI OLED screen modules to the main building roof plate (wooden plate #7) as shown; with their cables routed through the designated holes.
Attach the roof plate to the top of the main building and secure it in place with rubber bands.
Using lights, displays, and sounds to communicate system status to the user.
brightness.brightness to 255.brightness (0–255).brightness by -1.brightness by 1.
state.state by setting it to 1 - state.state is equal to 1:
use a variable to remember the current mode instead of only reacting directly to the button.Implementing sensor-based "Watchdogs" to prevent accidents.
switch.switch < 2, increase switch by 1.switch = 2, set switch to 0
One variable can represent a mode (gear), and each mode maps to a different output level.temperature and Simulated values.temperature variable.
temperature on OLED or serial output to understand typical values.Simulated values variable.Simulated values.
Infrared receiver and Simulated values.Infrared receiver.
Infrared receiver on OLED or serial output to understand typical values.Simulated values to 255.Simulated values to 200.Simulated values to 0.Simulated values by 5 or -5, respectively.Simulated values.
Use abd control of servo motors and servo-driven devices.
state.state:
state.state = 1.state = 0.
Infrared receiver and Mark.Infrared receiver.Mark> = 0:
Mark = 1.Mark = 1:
Mark = 0.
Mark variable is the program’s memory of where the flag should be now.Mark before moving, we avoid “over-raising” or “over-lowering” the flag.Hour, Minute, and Mark.Hour and Minute.Hour and Minute on the OLED screen.
Hour or Minute if their values are below 10, to reflect real clock formatting.Mark = 0:
Mark = 1.Mark = 1:
Mark = 0.
Mark variable prevents the board from repeating the same action many times during that minute.Parked Num (initial value 5), Avail Num (initial value 45), and Infrared receiver.Infrared receiver.Infrared receiver = 1):
Avail Num by 1.Parked Num by -1.Infrared receiver = 3):
Avail Num by -1.Parked Num by 1.Infrared receiver = 4, close the exit gate.Infrared receiver = 6, close the entrance gate.
Parked Num is a simple model of how many cars are inside.Avail Num, it can also display how many spaces remain.Using a variety of physical conditions based on surroundings to control or trigger different tasks.
Sound sensor data and Sum of data.Sound sensor data.Sum of data.Sound sensor datasound sensor data on the OLED screen, along with a label such as "Noise:".
Raindrop sensor.Raindrop sensor.Raindrop sensor > 1000: display nothingRaindrop sensor > 800 → "Light rain"Raindrop sensor > 600 → "Moderate rain"Raindrop sensor value corresponds to a lower amount of rainfall.
Sound sensor data, Sum of data, Hour, and Minute.Sound sensor data.Sum of data, before reading it back into Sound sensor data.Sound sensor data on OLED line 1.Sound sensor data.Hour and Minute.Sound sensor data is high (e.g. over 60), have the RGB light strip rapidly flash red.Sound sensor data is medium (e.g. between 40 and 60), have the RGB light strip flash yellow.Sound sensor data is low (e.g. under 40), have the RGB light strip shine green.
Raindrop sensor.Raindrop sensor.Raindrop sensor on OLED line 1.Raindrop sensor is below a certain value (e.g. 800):
Human body sensing and Switch.Human body sensing.Switch.Human body sensing ≥ 1 and Switch = 0:
Switch to 1.Hman body sensing.Switch = 1:
Switch = 0.
Switch to remember:
Using digital modules to manage and display numerical and text data.
Hour and Minute.Hour and Minute.
Hour or Minute are less than 10 (e.g. 8 becomes 08).
Hour and Minute.Hour and Minute.
Hour and Minute.Hour and Minute.
Using identification tools like facial recognition and personal smart cards to control devices and trigger certain events.
Student A balance, with an initial value e.g. 100.balance ≥ cost:
balance.
ID.ID is one of the known IDs (1–4):
State (0/1) to remember whether a message has already been played for the current face.
personA, personB, etc. with initial value 0.personA = 0:
personA to 1.
personA, personB, etc.) to record their status.personA, personB, etc.)