How to collect and publish data using Bluetooth Low Energy with Arduino

In this post, I illustrate operation of an Arduino with BLE (Bluetooth Low Energy). As usual, physics being my field, I do not discuss a generic example (the equivalent of “Hello, World!”), but a concrete physics application. Sometimes, for brevity or clarity, I will not be rigorous, and purists may turn up their noses, but, as I read on a A. Zee’s books, “sometimes, too much rigor soon leads to rigor mortis”.

WARNING: I assume you are familiar with Arduino and C/C++ programming. If you are not, you will hardly understand the content of this article.

What I write here…


General relativity is one of the most technically difficult physics theories, as it requires uncommon knowledge and mathematical skills. However, it is possible to calculate the relativistic effects induced by the curvature of space-time with good precision, and even to derive its formula, with a few simple arguments.

We know from special relativity that time flows more slowly in a moving system than in a stationary one. Given t as the time elapsed aboard the moving system, the time elapsed for the stationary one is 𝛾t, with 𝛾>1. In other words, time for those moving flows more slowly. A striking…


Almost like a flush toilet, indeed…

Transistors are the building blocks of our electronic gadgets: from smartphones to computers, toys, cooking devices, cleaning tools, etc.

Despite their ubiquity, only a few people know about how they work. In fact, understanding their principles of operation is not so hard.

The diode: a transistor building block

In order to understand how a transistor work, we need to understand what a diode is. In fact, a transistor, in practice, is nothing but two diodes.

A diode, essentially, works as a valve for electric current. It lets a flow of electrons flow in one direction only, opposing the movement of electrons in the opposite direction, just…


So, how does it melt the ice?

Image for post
Image for post
Deicing roads requires spreading salts over them. Photo by Simon English on Unsplash

In a previous post of mine, I illustrated a brief history of temperature scales in which I recalled that the reason for which 0 °F corresponds to -18 °C is that the latter was the lowest temperature that Daniel Gabriel Fahrenheit could achieve in his laboratory.

Such a temperature can be easily reached mixing water, ice and ammonium chloride. This was, in fact, a very common method to produce a frigorific mixture before the invention of the freezer. The melting of the salts in water, in fact, is a chemical reaction that requires heat to proceed. Indeed, as every Italian…


The most widely adopted temperature scale is the Celsius or centigrade scale. Nowadays, we use these terms as synonyms, but, in fact, they were not such, originally. The Celsius temperature scale was invented by Anders Celsius that, in 1742, proposed its use by publishing “Observationer om twänne beständiga grader på en thermometer” (Observations of two constant gradations on a thermometer).

Image for post
Image for post
Anders Celsius’ paper on the Documents of the Royal Swedish Academy of Sciences

In his paper, Celsius reported the observations, according to which the temperature of melting ice (marked as C) and that of boiling water (marked as D) appeared to be constant, if measured with a mercury thermometer.

He then proposed, on…


An introduction to the concept of an electrical current

Most physics textbooks are similar. They differ (little) for the sequence and for the choice of the mathematical details with which topics are presented. Most authors and teachers do not even ask themselves why they illustrate topics that way. Apparently, there is only one way to introduce something.

I believe this is not true. At least, I find stimulating trying to find alternative ways to introduce something in a different way. It is a difficult task, of course, and that is, maybe, why it is rewarding.

Let me be clear: I am not stating that alternative ways of teaching something…


Calculus

Many programmers believe that the use of higher order integration algorithms, combined with a large number of integration interval divisions, is useful (and sometimes necessary) to achieve good accuracy. In this article we show that this is not always true.

Myth No. 1: Higher Order Methods Are Better

Browsing Cantor’s Paradise articles, one of my favourite publications on Medium, I found an article written by Kazi Abu Rousan, in which the use of the trapezoidal rule for numerical integration is advocated (I am attracted by articles about physics, numerical methods and programming, as well as about the interplay between art and science). It is a well written article…


A non-metaphoric explanation

If you have an elementary knowledge of physics, it is very possible that you are unsatisfied about the metaphoric explanations of the role of the Higgs boson in “giving mass to other particles”. On the other hand we do not explain gravity and electromagnetism in a similar way. We teach them using mathematical equations, whose meaning is very clear and precise, and allow for the computation of measurable quantities.

Image for post
Image for post
An event collected by the CMS collaboration at LHC showing a Higgs boson decaying into a pair of photons (the two long green towers, representing energy deposits into the photon detector)

In a recent post by Ethan Siegel, he correctly pointed it out that most of the mass of the Universe comes, in fact, from strong interactions inside nucleons (protons and neutrons)…


How a small error may lead to a disaster

Numerical integration methods are those that allow the calculation of the definite integrals of a function, using computers. Simply stated, numerical integration is the process that leads to the evaluation, in many cases approximate, of the area between a curve y=f(x) and the x-axis, in a region x∈[a,b].

Image for post
Image for post
The integral between a and c of the function f(x) represents the grey-shaded area T; the integral between c and b is the area indicated with U. The integral between a and b represents the sum of the areas T+U. Image taken from Wikimedia Commons (thanks to Juliusross~commonswiki).

One of the simplest and, at the same time, most widely used method of numerical integration dates back to the time of Isaac Newton (this demonstrates that numerical calculation is not at all, as is believed, closely related to the use of computers). It consists of dividing the interval [a,b] into a…


A how-to guide

Practically all the exercise books I have (publishers send me some from time to time) are all the same: only the set of exercises changes. The same exercise, in fact, can be dressed in a different way and, therefore, they are not so different either. I must confess that I do not like any of them.

Image for post
Image for post

Rather then teaching how to solve a problem, the chapters of these books usually open with a reference to the fundamental formulas concerning the subject dealt with, and then propose a series of exercises, of increasing complexity, followed by their solution, which are almost…

Giovanni Organtini

Professor of Physics at Sapienza Università di Roma. Member of the CMS and PADME collaborations. Arduino advocate and phyphox ambassador.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store