Below I list some projects for the Arduino microcontrollers that can be used in a Physics or Engineering laboratory as well as projects for the hobbiest.
In this project we use the Arduino Nano and the MPU-6050 accelerometer. The Arduino Nano receives the data from the accelerometer via the I2C SDA and SCL pins. The wire connections are very simple as shown in the figure on the right: |
![]() |
After reading the byte values, the code calculates the x-, y-, and z- components of the acceleration in units of cm/s2.
In this project we check the bluetooth function of the Arduino Nano. The bluetooth module HC-05, or HC-06 is connected to the Nano as shown in the figure on the right. We use pin D2 to transmit the data from the Nano, which is connected to the RX pin of the HC-05. Pin D3 would receive data from the HC-05 and is connected to the TX pin of the HC-05. The 1K and 2K Ohm resisters serve as a voltage divider, since the RX pin of the HC-05 can only handle 3.3 Volts. The voltage on the digital pins on the Nano are 0 or 5 volts. The battery connected to VIN consists of four AA batteries yielding 6 volts. A voltage converter in the Nano reduces this value to 5 volts for the Nano's operating voltage. |
![]() |
In this project we use the Arduino Nano with the MPU-6050 accelerometer and the HC-06 (or HC-05) bluetooth module to measure acceleration and transfer the data via bluetooth. The Arduino Nano receives the data from the accelerometer via the I2C SDA and SCL pins. The bluetooth module HC-05, or HC-06 is connected to the Nano as shown in the figure on the right. We use pin D2 to transmit the data from the Nano, which is connected to the RX pin of the HC-05. Pin D3 would receive data from the HC-05 and is connected to the TX pin of the HC-05. The 1K and 2K Ohm resisters serve as a voltage divider, since the RX pin of the HC-05 can only handle 3.3 Volts. The voltage on the digital pins on the Nano are 0 or 5 volts. The battery connected to VIN consists of four AA batteries yielding 6 volts. A voltage converter in the Nano reduces this value to 5 volts for the Nano's operating voltage. |
![]() |
To program the Arduino and read the output, we use a Raspberry Pi.
The Arduino Nano is programmed with the code:
BTaccel.ino
using the Arduino IDE software. The six byte values for ax, ay
and az are sent to the bluetooth module via serial bluetooth. The bytes
are received and read by the Raspberry Pi from the dev file /dev/rfcomm0 using the C code:
BTaccelread.c.
After reading the byte values, the code calculates the x-, y-, and z- components of the acceleration in units of cm/s2.
The overflow interrupt therefore produces two unsigned int variables tim1 and tim2. These two variables along with TCNT1 yield a 48 bit counter that increases at the rate set by the prescaler. in Timertest.ino we have set the prescaler to 1, TCCR1B |= (1 << CS10);. With the prescaler set at 1, TCNT1 increases at a rate of 16X106 times per second. The three 16 bit numbers (tim2, tim1, and TCNT1) are each separated into their bytes (t0, t1, t2, t3, t4, and t5) and sent via serial to be re-combined for an accurate time stamp. One can reduce the timing rate by changing the prescaler. If the prescaler is changed, then one might need fewer bytes for the timing.