Assignment #18
Machine design

The eighteenth Fab Academy assignment is machine design. It involves designing and assembling the electronics for the machine developed during the mechanical design week. This assignment was also completed with students from Open Dot in Milan. In particular, Federico Cirelli made a major contribution to the electronics and code.

1 – the circuit

It’s time to make the machine move, so first we need to choose the electronic components. An Arduino Nano will control a servo motor, a DC motor, and an ultrasonic sensor that detects a user standing in front of the machine. The following diagrams show the circuit and the position of each component.

Assignment 18 documentation image: ass19 2 Assignment 18 documentation image: ass19 3 Assignment 18 documentation image: ass19 1

2 – the code

First, we used the Servo library to program the servo motor to move the bubble wand from the tank to the fan.

Next, we worked on the fan. Initially, we tried powering the DC motor with a 9 V battery and controlling it from an Arduino pin through a MOSFET and diode. However, this caused problems with the servo’s operation. We therefore connected the DC motor directly to the battery on a separate circuit controlled by a switch.
Then we added the fan to turn the movements of the motor into a gentle wind.

Assignment 18 documentation image: ass19 4 Assignment 18 documentation image: ass19 5

Once the basic mechanism worked, we automated it using an ultrasonic sensor to detect someone approaching the machine. We created a distance variable and used an “if” statement to update another variable that determines the motor’s position.

Assignment 18 documentation image: ass19 6

So, here is the code!

3 – assembly

Once the circuit was ready, we assembled the whole machine and attached the breadboard to its central leg. Our machine was complete!

Assignment 18 documentation image: ass19 7

The machine is far from perfect, but working remotely as a team during the COVID-19 emergency was challenging. We are very happy with the collaboration, both personally and professionally.

Source files

Here are all the source files for the machine design assignment:
1 - Arduino code