Introduction: Digital Globe Lamp
Thanks giving day and my family’s birthdays made me as poor as a church mouse. Thinking about the coming black Friday...ORZ Think twice and I decide to make a simple but beatiful lamp to my girfriend to celebrate our 2nd year together. All I want to realise is to turn on the light just by simply lightly knocking on the table. Here, I use this BMI160 gyroscope accelerometer as the ultra-sensitive vibration switch.
10 piranha lamp beads
A small amount of acrylic pigment (green, yellow, blue and brown; if gray and white pigment is provided, the oil paint does not need to be prepared)
Light gray and white oil paint
A good-looking 2-foot button (I bought it on Taobao)Lead wire (2 mm) (If no, replace it with soft iron wire)
40 cm PVC hollow rod (I use the one with outer diameter 9 mm and inner diameter 5 mm)
A screw and nut with the length of 20mm
Step 1: BMI160 Test
Download the routine program of BMI160 on uno, then open the serial port to observe the data, and carry out data sampling through a series of knocking. Then, write the corresponding program through data analysis.
1. After I put it on the table, it barely shakes.
The first tree columns are gyroscope and the last three columns are acceleration. The data indicates that the gyroscope values fluctuate in the range of 0.30 and accelerometer values fluctuate in the range of 0.02 without shake and vibration.
2. After knocking.
After an evident knocking, the gyroscope values varied in the range of 17 approximately and the accelerometer values varied in the range of 0.20.Through repeated knocking and sampling with varied strength, the analysis concludes that, one knock can be determined when the value difference of gyroscope is greater than 0.30 and the value difference of accelerometer is greater than 0.03 in the meantime. Some friends may say, “it’s easy to cause incorrect knocking”. Yes. So, I finally adopt two knocks. There are two cases: 1. Two knocks are determined when the normal state is recovered in 1 s following one knock and then another knock is detected. 2. Two knocks are determined when the normal state of sensor cannot be recovered in 1 s following one knock and a difference value of accelerometer is 0.20 larger than the mean value of previous 5 difference values.
Step 2: Circuit Connection
The microusb port of charging panel is located outside the lamp holder shell for charging.
Step 3: Making Process
- Weld lamp beams: Weld into triangular prism shape with three beams on each side and the remaining one beam at the bottom.
- Color the earth model printed through 3D with propylene (I referred to the color of astroreality small earth model).
- Spray the button switch periphery and screw into gray (blocking the remaining part with textured paper).
- Take out the lead wire, start winding 10 rolls and provide the balance weight.
- Drill a small hole at the top of earth model for threading; paint the PVC tube into gray, and make notches at both ends for placing wires.
- Print the base model. There are model files below. After printing, spray white paint.
Step 4: Assembly
2. Mount it into the base and insert the periphery into the balance weight. Provide a charging panel slot on the back of model to expose the microusb port and paste bmi160 on the base plate.
3. Burn the program after assembly. I firstly tested its effect on uno; bmi160’s effect is great.
When you lightly knock on it, it can also feel. It seems that the whole table top has become a switch. You can turn on the light simply by knocking on any position for two times.
Step 5: With So High Sensitivity, Bmi1 Should Have Many Playing Methods to Be Developed by Geniuses
Step 6: Some Friends May Ask, “What Else Function Can Bmi160 Realize?” It Can Also Detect Your Hand Shaking!
The data analysis indicates that the shake will cause continuous value change of gyroscope and accelerometer, so I used multiple test difference values in program, and set the threshold value. In case the difference value change exceeds 0.2, all values will be equal to 0.20. You can judge whether bmi160 is shaking at this moment through the mean of 35 difference values.
Some friends may ask, “What’s the meaning for detecting hand shake?”
Haha, it means someone wants to use it and then it will be turned on and become a lantern to accompany you to walk at night. If you give it to a girl, she would feel delighted.