Small digital compass

Небольшой цифровой компасHow to build a digital compass to the microcontroller ATtiny85 we learn from this article. ATtiny85 is a high – performance microcontroller with low power consumption. It has an 8 KB programmable flash memory. Assembly of the device is simple and almost everyone. Well, the case, when there is no access to a 3D printer, you can pick up another.
Tools and materials:
For compass:
-ATtiny85 Microcontroller;
-The magnetometer HMC5883L;
OLED display SSD1306 I2C or 0.96 “128×64
-Push button switch;
Li-polymer battery 3.7 V 300mAh;
For the charger:
Two of the Board – 17×10 mm and 13×18 mm;
Module charger Micro USB 5V 1A TP4056;
-3D printer;
-Soldering accessories;
-Pin the connectors;
Step one: a 3D printer
First you need to print the details of the body of the compass and the charger. Files for printing are attached.
Step two: code
Next you need to install the library ssd1306 from Alexey Dynda. To upload code to ATtiny85. Code can be downloaded below.
Step two: the scheme
The scheme is quite simple and should not cause difficulties during installation.
Небольшой цифровой компасStep four: installation
Then the wizard proceeds to installation. Prepare two 10-inch two conductor cable. Cleans in the middle of the wire.
Небольшой цифровой компасНебольшой цифровой компасFurther primaeval first wire to SDA (pin 5) and SCL (pin 7) ATtiny85. The second wire pribivaet to GND (pin 4) and + V (pin 8) of the ATtiny85.
Небольшой цифровой компасНебольшой цифровой компасPrimaeval four-wire ATtiny (SDA, SCL + V and GND) to the appropriate terminals of the OLED display and sticks it to the hull.
Небольшой цифровой компасThe terminals of the charger makes pins. Bend them and insert one in the enclosure wall, the second wall of the cover.
Небольшой цифровой компасНебольшой цифровой компасНебольшой цифровой компасSticks HMC5883L magnetometer to the lower lid as shown in photo. Primaeval wire SCL and SDA from the ATtiny to the corresponding contacts of the magnetometer, primaeval GND. Solder wire + V and GND from the ATtiny to the appropriate contacts.
Небольшой цифровой компасНебольшой цифровой компасНебольшой цифровой компасPrimaeval minus of the battery to the ATtiny pin 4 and a positive contact of the charger into the side of the body.
Небольшой цифровой компасНебольшой цифровой компасНебольшой цифровой компасPrimaeval wire from terminal of the charger to one switch contact and the second contact pribivaet + V magnetometer. Check the work of compass and attached lid.
Небольшой цифровой компасНебольшой цифровой компасStep five: calibration
Next you need to calibrate the device. For this purpose it is necessary to turn and rotate 360 degrees.
Step six: build the charger
Now you need to collect the charger.
Cut two pieces of the PCB is 17 mm x 10 mm and 13 mm x 18 mm. Drill a hole in the smaller Board. Primaeval wire and assigns the cost of a niche case.
Небольшой цифровой компасНебольшой цифровой компасНебольшой цифровой компасPrimaeval wire to the second circuit Board and sticks it in the photo.
Небольшой цифровой компасНебольшой цифровой компасCollects two of the charger. The wires primaeval outputs of the module TP4056.
Now charging to place the case on the charger contacts to the pads of the charger and connect the charger module to any USB device.
Небольшой цифровой компасНебольшой цифровой компасНебольшой цифровой компас


Show More

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button

Please disable your ad blocker

We know you are here for the stories. Not the ads. But we need the ads to keep the lights on. So please whitelist