Tilt Compensated Digital Compass based on AVR

  Рет қаралды 14,842

MCUatWork

MCUatWork

Күн бұрын

Пікірлер
@xt1200z1
@xt1200z1 3 жыл бұрын
Very interesting project. Thanks for sharing the code. I plan to modify for my dual axis solar tracker and replace the LDRs.
@MrFrisky88
@MrFrisky88 3 жыл бұрын
Good luck with your project
@xt1200z1
@xt1200z1 3 жыл бұрын
@@MrFrisky88 Thanks again. For anyone else interested in trying this with the QMC5883L, I found header and parameter files. I'm not smart enough to do, so thanks to the author of these also.: api.riot-os.org/dir_5cce5766881baaa3953e3e6827950470.html
@251piyushbandre3
@251piyushbandre3 9 ай бұрын
Code was running in arduino IDE software?
@gemeus
@gemeus 6 жыл бұрын
Nice work, I wonder to understand how does it works. Did you require a MPU6050 calibration to get the readings ? i was doing some tests and nothig was like your results.
@MrFrisky88
@MrFrisky88 6 жыл бұрын
I did not calibrate the magnetometer (HMC5883L), but calibration is needed for correcting any magnetic field present in the area. So this is not a perfect solution and may not be very accurate for all case. MPU6050 is used to get accelerometer reading only and calibration is not needed for this application. If you examine the code, I have only applied the standard method given by application notes for tilt compensation using magnetometer and accelerometer readings.
@251piyushbandre3
@251piyushbandre3 9 ай бұрын
Please provide me hex file of thus code 🙏🏻
@thomazedson2761
@thomazedson2761 4 жыл бұрын
Good evening, it is possible for this code to run on the arduino displaying the azimuth and pitch roll information on the serial monitor. thanks.
@MrFrisky88
@MrFrisky88 4 жыл бұрын
Sorry, code needs modification to send output through serial port.
@thomazedson2761
@thomazedson2761 4 жыл бұрын
would it be possible for you to show me how to modify?
@thomazedson2761
@thomazedson2761 4 жыл бұрын
It's very important to me.
@thomazedson2761
@thomazedson2761 4 жыл бұрын
help me please
@thomazedson2761
@thomazedson2761 4 жыл бұрын
thomazedson882@gmail.com
@xmj1131
@xmj1131 6 жыл бұрын
Yes, do you have time to record the whole process of production? Thanks
@MrFrisky88
@MrFrisky88 6 жыл бұрын
Sorry, I could not record making this, but it is only a matter of soldering these components together according to the circuit diagram.
@pratikgurudatt8867
@pratikgurudatt8867 5 жыл бұрын
Hey, nice project you've made here, What are the configurations of the sensors you have used? Both for the magnetometer and the accelerometer?
@MrFrisky88
@MrFrisky88 5 жыл бұрын
Magnetometer (HMC5883L): Continuous Measurement mode, Output rate: 15Hz Gain: +/- 1.9 Ga, Averaging: 8 samples Accelerometer (from MPU6050): MPU6050 is configured in Accelerator only low power mode. Accelerometer full scale range: +/- 16g
@gorangoran2955
@gorangoran2955 4 жыл бұрын
Hi Thanks for code and schematic diagram. It is possible for this code to run on some slightly larger display?
@MrFrisky88
@MrFrisky88 4 жыл бұрын
This code will work only for SSD1306 display.
@seanocansey2956
@seanocansey2956 5 жыл бұрын
Cool project, but isn't the needle supposed to rotate in the other direction, so that the needle is stationary? 🤔
@MrFrisky88
@MrFrisky88 5 жыл бұрын
Right, the dial should have rotated keeping the needle at centre. But that would take more program memory. For this program, ATmega8 took almost the whole flash memory.
@Hoaqn
@Hoaqn 5 жыл бұрын
Perfect, it cost me only 10$. Nice project!
@251piyushbandre3
@251piyushbandre3 9 ай бұрын
Please provide me hex file of this code
@_a.z
@_a.z 3 жыл бұрын
Are there actually any ecompassing chips available today?? It seems that the market is in limbo between obsolete and very long lead times, apart from all the dev PCB's!
@MrFrisky88
@MrFrisky88 3 жыл бұрын
There are many chips having 3D accelerometer + 3D Magnetometer integrated to function as eCompass (like LSM303 from ST). But they are usually available in LGA package, difficult to hand solder. So using their dev. board is ideal for small project like this. As for the availability, I have no knowledge of the current situation.
@sukhee5
@sukhee5 5 жыл бұрын
Hello. The HMC5883L compass X or Y which one will point magnetic north?.
@MrFrisky88
@MrFrisky88 5 жыл бұрын
X and Y reading from HMC5883L are used to calculate the Magnetic north direction. If you hold the module with X arrow directly pointing to North, the X reading will be maximum and Y reading = 0. Similarly if you point Y arrow to North, Y reading = Maximum and X = 0. So, X and Y reading varies according to the module orientation. From the X, Y reading you can find the Azimuth angle, that is angle between Magnetic north and Forward direction. Here, X arrow of the module is used as forward direction. So, if you get Azimuth = 90 deg, you are holding the module with X arrow pointing directly at East.
@sukhee5
@sukhee5 5 жыл бұрын
MCUatWork so in the video X is pointing North, Y is pointing West. is that correct? 0:43
@MrFrisky88
@MrFrisky88 5 жыл бұрын
@@sukhee5 No, at 0:43 X is pointing West and Y is pointing South.
@MrFrisky88
@MrFrisky88 5 жыл бұрын
@@sukhee5 In this datasheet: www.jameco.com/jameco/products/prodds/2150248.pdf on page 21, 22 you can find the formula for Azimuth for different conditions of X and Y.
@shlokjadhav2005
@shlokjadhav2005 4 жыл бұрын
What is that P and R given on the oled display ?
@MrFrisky88
@MrFrisky88 4 жыл бұрын
Pitch and Roll
@owenpowell3282
@owenpowell3282 3 жыл бұрын
Help please. I got the error "cannot set sck period. Upgrade usb firmware "
@MrFrisky88
@MrFrisky88 3 жыл бұрын
I guess you can ignore this error and should not be affecting the programming of the chip. (This happens due to the programmer having Chinese firmware which sets SCK automatically)
@shlokjadhav2005
@shlokjadhav2005 4 жыл бұрын
And what is H ?
@MrFrisky88
@MrFrisky88 4 жыл бұрын
Heading (or Yaw)
@sankarsaikumar7701
@sankarsaikumar7701 10 ай бұрын
I want this product brother
@DonEldarreiny
@DonEldarreiny 3 жыл бұрын
HELP: Hi, i tried the code and everything but when i run the make all command, i keep getting error "../../common/ssd1306/ssd1306.c:467: warning: 'y' may be used uninitialized in this function" Please assist.
@MrFrisky88
@MrFrisky88 3 жыл бұрын
It's fine. This is not an error, only a warning that you can ignore. The output hex file will be generated anyway.
@251piyushbandre3
@251piyushbandre3 9 ай бұрын
Please provide me hex file of thus code
@anupteke2007
@anupteke2007 6 жыл бұрын
Hi, Thanks for uploading videos and code. I just want to know whether its possible to get Pitch or Roll in +180 to -180? Currently its + 90 to -90 Degree...
@MrFrisky88
@MrFrisky88 6 жыл бұрын
The formula used here for finding Pitch and Roll gives result in the range -90 to 90 only (which sufficient for tilt compensation calculations). To get full 3D rotation angles you will need to change the formula, which I don't have enough knowledge about. I think you can easily find some implementation by little bit of search. Good luck.
@owenpowell3282
@owenpowell3282 3 жыл бұрын
Hi could you show me how to programme this?
@WagonLoads
@WagonLoads 4 жыл бұрын
Hi, will this work with just the MPU-9250 alone?
@MrFrisky88
@MrFrisky88 4 жыл бұрын
MPU9250 alone is sufficient for the project. But additional code for MPU9250 is required to retrieve magnetometer and accelerometer readings.
@WagonLoads
@WagonLoads 4 жыл бұрын
@@MrFrisky88 that sounds great! My first tablet had a working compass, which allowed me to use Google Sky Map. My current tablets don't have a compass. I was wondering if there was a way to get Sky Map to see the MPU-9250 ,so that my tablet will show me what star my telescope is pointed at?
@MrFrisky88
@MrFrisky88 4 жыл бұрын
@@WagonLoads Great idea. Though, I don't know how you would pass the sensor data to the tablet so it can be used by Sky Map. May be you could use Bluetooth (BLE).
@emmetray9703
@emmetray9703 4 жыл бұрын
Hi. Thanks for code. I copied your code, compiled, did everything by the same way, BUT compass is changing when I'm tilting it. I can't understand what I'm doing wrong. I'm working in Atmel Studio (Windows) , I'll send you my project, circuit pictures,.can you help me please? I'm begging you, please.
@MrFrisky88
@MrFrisky88 4 жыл бұрын
Hi, I guess the magnetometer and accelerometer modules are not aligned perfectly. Make sure that X-axis of magnetometer and accelerometer point in the same direction.
@emmetray9703
@emmetray9703 4 жыл бұрын
@@MrFrisky88 Hi. I aligned them . May I add you in skype and send my circuit pictures, code ? Please?
@MrFrisky88
@MrFrisky88 4 жыл бұрын
@@emmetray9703 ok, may be email is enogh
@emmetray9703
@emmetray9703 4 жыл бұрын
@@MrFrisky88 Thank you ! tell me your email please, my email is "giorgigelava@yahoo.com"
@Cris_Izagui
@Cris_Izagui 6 жыл бұрын
Works like a charm. Is possible change MPU6050 for ADXL345? Can you help me?
@MrFrisky88
@MrFrisky88 6 жыл бұрын
Yes, an ADXL345 accelerometer module can be connected instead of MPU6050 module. Code needs to be adjusted for accessing registers of ADXL345. I don't have a module with me and also need to refer the datasheet of ADXL345 to know more.
@Cris_Izagui
@Cris_Izagui 6 жыл бұрын
@@MrFrisky88 Ok. I will be try. Thanks!
@Cris_Izagui
@Cris_Izagui 6 жыл бұрын
Hello. This code works directly on Arduino ? Thanks!
@MrFrisky88
@MrFrisky88 6 жыл бұрын
Hi, if it works on ATmega8, it should definitely work on Arduino. Unfortunately, I never worked on Arduino platform, but only with C on AVRs. I think, creating an Arduino project with the source code of this project should work without any problem. Try it.
@fatih1922
@fatih1922 5 жыл бұрын
Thanks for the video sir. Your source code helped me a lot. I did this with arduino for rapid prototyping purpose.
@xt1200z1
@xt1200z1 3 жыл бұрын
What changes did you make to the code? I'm trying to do the same. I did find the address for my HMC5883 was 0x0D, but still not working.
@kadrimetin
@kadrimetin 3 жыл бұрын
@@xt1200z1 it can be qmc5883l chip. registry address are different.
@xt1200z1
@xt1200z1 3 жыл бұрын
@@kadrimetin Right, found the datasheet and got the correct registers, think also the LSB and MSB are backwards plus the order X,Y,Z. All is working now with atmega328p but compass is not correct. Thinking the data coming from the qmc5883l is different from the original HMC5883L.
@251piyushbandre3
@251piyushbandre3 9 ай бұрын
Please provide me hex file of this code
@7grounds
@7grounds 6 жыл бұрын
will this compass work when installed on a vertical wall
@MrFrisky88
@MrFrisky88 6 жыл бұрын
When this compass is installed with its flat face parallel to the wall, the tilt will be 90 degrees (roll or pitch). But the readings will never show 90 degrees. That's a problem in this case. It will show a reading near to 90 deg (85 to 89) for roll or pitch. I think it will be better to install the board perpendicular to vertical wall (parallel to ground) and place the OLED display for vertical reading.
@pjwlk
@pjwlk 5 жыл бұрын
Thanks for sharing, very useful.
@251piyushbandre3
@251piyushbandre3 9 ай бұрын
Please provide me hex file of thus code please 🙏🏻
@ScottyGolf
@ScottyGolf 4 жыл бұрын
Can I buy that one from you?? please I'm serious message me back. Thank you
@MrFrisky88
@MrFrisky88 4 жыл бұрын
Sorry, I don't have this one with me now. Anyway shipping cost will be much more than cost to build this. I guess you can build this without much difficulty.
@ScottyGolf
@ScottyGolf 4 жыл бұрын
MCUatWork I just ordered the parts 👍🏼
@cyklop1977
@cyklop1977 3 жыл бұрын
Ok
GY-271. Digital magnetometer and Arduino. Make a compass
12:09
Wednesday VS Enid: Who is The Best Mommy? #shorts
0:14
Troom Oki Toki
Рет қаралды 50 МЛН
진짜✅ 아님 가짜❌???
0:21
승비니 Seungbini
Рет қаралды 10 МЛН
JISOO - ‘꽃(FLOWER)’ M/V
3:05
BLACKPINK
Рет қаралды 137 МЛН
Adventures in Science: Using a Magnetometer as a Compass
7:45
SparkFun Electronics
Рет қаралды 47 М.
How to easily use HMC5883L Compass Sensor
5:43
miliohm
Рет қаралды 46 М.
How to Calibrate a Magnetometer | Digi-Key Electronics
26:21
Interfacing HMC5883L / QMC5883 Digital compass with Arduino
5:31
Arduino Prototyping Inputs #60: Digital Compass
5:32
Marc de Vinck
Рет қаралды 12 М.
How MEMS Accelerometer Gyroscope Magnetometer Work & Arduino Tutorial
9:57
How To Mechatronics
Рет қаралды 784 М.
Build an Electronic Level with MPU-6050 and Arduino
33:37
DroneBot Workshop
Рет қаралды 327 М.
Wednesday VS Enid: Who is The Best Mommy? #shorts
0:14
Troom Oki Toki
Рет қаралды 50 МЛН