General physics I: projectiles motion with Arduino and servo


For General physics I final, we were asked to prepare a simple physical experiment: in particular, we dealt with the study of projectiles’s motion. I developed a simple circuit that makes you able to handle the firing angle with high precision, using a servomotor connected to a little cannon. In this way, it’s simple to study how the projectile’s motion changes varying the firing angle.

In order to realize the circuit, you just need a servomotor, a LCD display (optional) and, obviously, Arduino. Read this post to know how to wire up the display; then, connect the servomotor to one Arduino digital pin (I used pin number 7)

The source code (you can find it here), takes the angle value in input from serial, updates the display and make the servomotor move.

IMG_20141219_122123 IMG_20141215_105034

IMG_20141218_145533Stay tuned!


KnockBox – (1) Introduction

This one is the most complicated project I have ever faced: a box whose lock only opens if you knock on it playing a specified rhythm. It is not a miracle, neither black magic: it is just an application of the innumerable possibilities of electronics.

Because of the compexity of the project, I have split up its presentation in three parts: the first one is the introduction (you are reading it); the second one deals with the electronic and software aspects; the third one talks about the locking system.

The whole device is based on a “piezo”: it can be used to riproduce sounds of a certain tone as well as a sensor (see How to – Piezo as Knock Sensor).

This is how the front of the box looks like: let’s analyze it in details in order to explain how KnockBox works.KnockBox_Scheme

  • The switch (1) connect the electric circuit of the box to the energy supply, that is 4 batteries type AA 1.5V.
  • When turned on, the box is locked. So, the red LED (2) is on.
  • To open the box, you have to knock in the “Knock Zone” (5), that is the zone corresponding to the position of the sensor.
  • Everytime the sensor receives an input, the blue LED (4) turns on.
  • If the input corresponds to the saved rhythm (for every knock a tolerance of 150ms is applied), then the box will open, e the green LED (3) will turn on.
  • To close the lock, press on the closing button (6). The red LED (2) will turn on again.
  • You can also record a new rhythm: first of all, open the lock, knocking with the correct rhythm. Then, press on the record button (7) and knock on the Knock Zone (5) with the new rhythm. The piezo will play the new rhythm. If you want to complete the recording, press again on the record button (7). Otherwise, press the closing button (6) to annul the process.
    • If you save the new rhythm, the box is closed automatically.
    • If you cancel the recording, the box stay open.
  • The play button (8) reproduce the current saved rhythm. It can be used only if the box is open.


  • The saved rhythm can be longer than 10 intervals (that is 11 knocks).
  • The input sequence is considered finished either if 3 seconds had passed from the last knock or if you have reached the 10 intervals limit.

In the next post we will discuss how to assemble the eletrical circuit and analyze the source code.

Stay tuned!