Great video and thank you for taking the time to trace the source of the code! Thumbs up from the Netherlands.
@RalphBacon7 жыл бұрын
Absolutely great to hear from you Joop! Your videos were very impressive demonstrating your drones' self levelling capabilities which is what inspired me to experiment here! It's a small world... Thanks for the thumbs up too!
@juanherrero9117 жыл бұрын
Thanks Ralph for showing what this device is capable of; it is very impressive. On order along with some neopixels!
@RalphBacon7 жыл бұрын
That's great, Juan, that it has motivated or inspired you to experiment! And you will love those neopixels! Thanks for your post!
@DrexProjects8 жыл бұрын
I have one of those still in the anti-static bag. Time to get it out and give it a go. You always seem to kick me in the ass and get me going. Thanks Ralph.
@RalphBacon8 жыл бұрын
Yes, Darrell, I have my Arduinite ass-kicking boots on most days, heh heh! Glad to motivate you to try this out!
@WildSccotsman8 жыл бұрын
I played around with one of those a few months back and was amazed by the how smooth and accurate they were. About 20 years ago I designed a golf training aid for a company to help keep your head still when playing golf (mostly while putting) it sounded a buzzer and lit a particular pair of LEDs fitted under the peak of a golf hat. The circuit used piezo film with weights on and op-amps in a bridge configuration. It was suggested at the time I looked at using an accelerometer. This however was way to expensive, my how times have changed..
@RalphBacon8 жыл бұрын
So perhaps, WildScotsman, you have found a niche business opportunity by re-inventing your 20-year old device with one of these? As you have the rest of the design (albeit probably running on valves/tubes if it's that old) this will be child's play for you. Just goes to show there is never a new idea out there, or one that hasn't been thought of already. (If you do relaunch this, and are successful, I claim 10% commission!) Thanks for posting, fantastic idea.
@Gaatech8 жыл бұрын
nice video. could two if these units be used to measure vibration on all three axis. one would be mounted on say a drones body and the other on a anti vibration mount and then some how show the difference between the two reading. i am not a coder but would like to try this and just require some guidance. was hoping to use esp2866
@RalphBacon8 жыл бұрын
HI Gaatech! Now the measurement of vibration is actually covered in the two videos by Joop Brokking, as he straps his Gyro to a motor to emulate the vibration. If anyone has the answer, he does in that video. But he takes into account the vibration, he doesn't measure it separately. However he does it, it obviously works beautifully for him. Go and check out his videos (links in my video description), I reckon they will help. I don't see why an ESP8266 could not be used, it's a powerful unit so could do all the required calculations a lot quicker than an Arduino.
@timothycox28427 жыл бұрын
Yes. I want to understand how to receive a byte manipulate the bits and decipher their meaning. How to apply this on anything that may be using bits to communicate with the arduino
@RalphBacon7 жыл бұрын
OK, I think this will be covered when I do the video on the Tiny85 using the pin extender unit, as you have to manipulate the bits of each byte to switch various pins on and off (it's fairly simple binary arithmetic using AND and OR). I've moved it up the backlog and might address this sooner than later after your nudge, so thanks for that!
@jeffbluejets26266 жыл бұрын
The problem with the little bubble level is, as we recently found, when viewed from an angle it can "appear" to be off level when indeed, viewing from directly above it is actually spot on.
@RalphBacon6 жыл бұрын
Are you talking about the actual bubble in (non-electronic) spirit levels, Jeff? This is even true for the standard levels, you have to look at the bubble with just one eye, straight on.
@jeffbluejets26266 жыл бұрын
Yes, bubble non-electronic type. We hadn't realised it before we encountered it the other week, but then again I'm a lecky so there ya go as they say. :)
@TheBarthewАй бұрын
What is the INT used for? Thanks
@RalphBaconАй бұрын
In this context, INT is short for interrupt (but you don't have to use it with an interrupt in your code) and indicates that data is available to read. You could just check this pin and decide to read the data at your leisure although it is designed to act as an interrupt for your main sketch, where you might set a flag to indicate that data is available.
@happygunawan40728 жыл бұрын
Hey, thanks for the video i really appreciate it.. on the progress of my work, i have succeed to get the yaw pitch roll of the sensor and make model on the C# based program.. i use esp8266 to send the data OTA, when i connect it via usb to the comp, the HMI can operate but if i send the data OTA the HMI show error,, i dont know what cause it, when i saw on the serial monitor the angle data seems alright thou..
@RalphBacon8 жыл бұрын
I don't know what the issue is you're facing here, it's outside of my experience of drones and Gyros and the like. You could post your question on the Arduino forum (forum.arduino.cc/index.php) they have many experts who have seen it, done it and got the T-shirt all before. Just state your problem clearly so they can see the work you have already done (they hate doing someone's homework) and I reckon you'll find at one person who can help. If you get it resolved do let us all know here too!
@happygunawan40728 жыл бұрын
okay, im currently trying to solve it with my friends.. hope it will worked out..
@williammiller75435 жыл бұрын
Great video, My washer/dryer is in the basement and we don't hear the dryer buzzer all the time. I'm thinking about using this unit to tell me when the dryer is running,and more importantly when it has Stopped. I'll then try to send a SMS message to my cell phone, which is always nearby. I'm thinking on just using one of the axis (x) to let me know if there is movement. Your video explains how to segregate the x axis. You have always been a great source of info, Thanks again.
@RalphBacon5 жыл бұрын
That's a novel idea indeed, William. Does you dryer move enough for you to identify that it has stopped moving? I'll be interested if you ever get this working (probably on a breadboard to start off with).
@williammiller75435 жыл бұрын
@@RalphBacon I am looking at the gyroX movement to make it simple. I took a 30 second period and looked at the max and min of the reading. The delta is around 25 points. I'll monitor all the time, turn on a flag once I see 3 consecutive periods of activity and then look for 3 consecutive periods of no activity. With no activity the delta drops down to 4 so it is an obvious shift. Then I'll issue a pushbullet message to my cell phone, then go back to monitoring for the next cycle. I also plan on 2 LED's. The first would turn on when my device is monitoring (is it alive). The second would come on when the device detects a cycle in process. As an aside, I am not worried about calibrating the MPU6050, I'm just looking for the delta. I used ThingSpeak to gather and display the data to determine if the concept was feasible. I plan on a WeMos mini with the MPU on a stack in a small box 2-sided taped to dryer. I saw a recent video on a dryer project by Kevin Darrah but I wanted a simpler detection device and I think the gy-521 was my solution. The key is to have the device firmly attached to the dryer to pick up its movement thus the 2 sided tape.
@maxim25o23 жыл бұрын
I need help, My gyroscope GY-521 dont display Z axis, and it looks like it is a level sensor, not gyroscope, anyway, If this is gyro, then how I can fix problem with Z axis? In Your Tutorial Z axis is working
@RalphBacon3 жыл бұрын
I see from a later comment that you figured it out, phew!
@milthon578 жыл бұрын
Great videos you have. So helpful, really. I have used Brokking's arduino code for the MPU6050 but so far i have not been able to read Yaw values. It would be great if you could give me some hints to read yaw angle. I want to display all angles to built a spirit level. Thank is advance.
@RalphBacon8 жыл бұрын
I chose the X angle purely for the demo (almost at random). I wonder if it would do something different if I used the Z-axis (yaw) or, indeed, the Y-axis. Let me experiment a bit to see whether it works as expected. And thanks for the positive feedback, Milthon, always good to know these videos are adding value!
@mattkaczmarczyk69536 жыл бұрын
gr8 work keep living, sharing & being a top dude
@RalphBacon6 жыл бұрын
Thanks for that, Matt Kaczmarczyk, nice to hear from you.
@douglasthomson29866 жыл бұрын
Great demo again Ralph. You manage to explain it well. Have had an idea for an accelerometer for a little while, so maybe splash a little cash an have a go sometime soon. Cheers.
@RalphBacon6 жыл бұрын
Thanks for your post, Douglas Thomson, good to hear from you, glad you liked the video.
@kouashamdi8493 жыл бұрын
I need programme gyroscope for my robot i need it to be balanced . it work with 4 servo . can u send me this program please
@RalphBacon3 жыл бұрын
Ha! Not a chance! The idea behind this channel, Kouas, is that you try stuff out, make mistakes, try alternatives and learn the way forward yourself!
@ammarsyaf30355 жыл бұрын
I had to design vibration measurement instrument using this module. Is there any possible reference that I could refer to? Thank you.
@RalphBacon5 жыл бұрын
I think in this instance, Google is your best friend! Sorry, I can't help more.
@oncledan2825 жыл бұрын
Good day again, Ralph ! I was looking for the code I wrote a few months back and I could not find it. You just provided this one for my new Father/Son project. As for the two axises project, I recommend using the 16 x 16 version of the Neopixel's strip. I've seen this one on Amazon and many other on-line stores. for 50$ CAD, you could fave this matrix. I know, I know. It's not cheap, but it would be a great experience to make. Thanks. for providing the source code for this one. I'll use it for sure. Have a great week and take good care, my Friend !
@RalphBacon5 жыл бұрын
I thought for a moment you were going to burst into song with Cat Stevens (we should call him Yusuf Islam) when you mentioned the Father & Son thing! Did you say CAD $50???!!! That's a king's ransom! No idea why it's so expensive. About time some enterprising Asian factory started producing them at $10 a piece. I live in hope. I'll write to you soon, Daniel, I'm at least up and about this week.
@oncledan85095 жыл бұрын
Cat Stevens (aka Yusuf)! Yes! I remember that song. Hahaha! Go easy, my Friend. No rush to write. Remember that Priority One is your health. Have a nice rest and when time comes, you will write back, but for now, rest your eyes from any possible strain, including unnecessary blood pressure in that area. Take good care my Friend .. and God Bless !
@wannydrago38735 жыл бұрын
What, kindly wanted to know if it is possible to make it work with an arduino nano card? and I wanted to ask if you can always kindly provide a link to the colored bubble I see in the video, thanks!
@wannydrago38735 жыл бұрын
I would like to make an electronic bubble like yours, if possible ...
@RalphBacon5 жыл бұрын
Yes, Wanny, this will work with a Nano in the same way that it does with a Nano, no difference. I'm afraid the "coloured bubble" (called a spirit level) was some cheap thing I got years ago and just used for this demo, so no link, sorry. But you can pick up similar ones from eBay, I'm sure.
@stereomatzel8 жыл бұрын
Another 3-axis sensor is a Nintendo Wii Nunchuk controller. But i think the MPU6050 is more precise than the Nunchucks 3L02A chip and for sure cheaper then the controller.
@RalphBacon8 жыл бұрын
Well it certainly was cheap, stereomatzel, that's for sure. I only bought it because it looked interesting (as well as cheap) so I thought I'd take a punt and find out. I reckon it worked pretty well considering we were just manipulating the raw values, thanks to Joop Brocking's maths functions. There are a few 3-axis controllers but this is the only one I've played about with. Good to hear from you.
@HammadKhan-rc4vg5 жыл бұрын
Hello Ralph, Thank You for the wonderful explanation in the video. Is there a way we can track the movement of the object and orientation ? In this video the MPU 6050 is used for tracking the Orientation. if there is a pen or any object in my hand and i want to track its position + Orientation. Will we require any other sensor for it ? If you can assist would really appreciate that. Thank you. Hammad
@RalphBacon5 жыл бұрын
I can't remember, Hammad. If you build this the same way I did in the demo you may find the answer, or else Google may help. Someone, somewhere just have done this!
@richgrisham6 жыл бұрын
Great video. Can the sensor be programmed, and work independent of the software - smaller circuit package with a band of maybe 0 -15 degrees of tilt upright (just for instance) with a buzzer or some other kind of feedback?
@RalphBacon6 жыл бұрын
As Amazon Echo "Alexa" constantly says to me, "I'm not sure about that", Rich, sorry. It's been a while since I programmed this device (and did this video) and all I recall right now is that I could read the data back OK and act upon it, but I don't know whether it can run independently and "do stuff" that an Arduino would normally be used to do. You could always use a much smaller Arduino, though, if you're just after a smaller footprint. Such as the ATTiny85 and Sparkfun Pro Micro to just name a couple. I'm sure my answer is as useful as my Echo, sorry.
@timothycox28427 жыл бұрын
I can't tell if you've covered this subject or not. Can you cover in one of your videos how to handle bits, bytes, operations of bits. For example in IR remote control.
@RalphBacon7 жыл бұрын
Hello Timothy! I've covered some BCD (binary coded decimal) calculations in video #8 but if you're after how to manipulate bits (binary arithmetic) for something like the Pin Extender (where you receive a full byte but only want to set/unset a single bit) then I do have this in mind for a future video. Can you expand a little on what you are hoping such a video would cover? Good suggestion!
@tseckwr37832 жыл бұрын
thanks Mr. Ralph
@RalphBacon2 жыл бұрын
You're Welcome Mr KWR37... er, that can't be right 😁
@tseckwr37832 жыл бұрын
@@RalphBacon I repaired that equipment. There is a Canadian that has a website about KWR37's. North Korea got a few of these in 1968 off the USS Pueblo.
@RalphBacon2 жыл бұрын
You mean these things: en.wikipedia.org/wiki/KW-37 ? 😲
@alanpowell3287 жыл бұрын
Hi Ralph, In the Pseudo-library, can you explain the name " __GYRO__ " that you have used in your #ifndef statement, I've seen the double underscore before but don't understand it. How does it relate to the contents of the library? What "name" should a library builder use in that #ifndef statement? Kind Regards Alan
@RalphBacon7 жыл бұрын
Hey Alan! the name used in an #ifndef statement is simply one that is (almost) guaranteed to be unique. It can be anything. The reason underscores are used (before, after, both) is simply to make it even more unlikely anyone will use that name elsewhere. It has no actual relationship to the library although logic dictates it should somehow be related to it. But you could call it __Fred__ and it would still work. Good question, thanks for posting.
@alanpowell3287 жыл бұрын
Ralph, Could you please explain Line 63 of the code; x=x(lots of strange stuff with more x's). I've seen this before, possibly in one of your videos, but cant find the reference. Kind regards Alan
@RalphBacon7 жыл бұрын
Sure thing Alan, good that you asked this as I can clarify to anyone reading this post. For the purpose of this reply I'll simplify the line in question with this: int direction = x > 180 ? 360 - x : x + 10 This means, the integer variable direction will be assigned according to the aptly named "? :" operator (shorthand "if"). This can be expressed as: condition ? first expression : second expression, so here we are asking: (condition) is x > 180 ? if so, use the (first expression) 360 - x (so if x were 190, the result of this would now be 170) otherwise (second expression) x + 10 (so if x were 10 the result would be 20) You can always rewrite (less succinctly) the above expression as: int direction; if (x > 180) { direction = 360 - x; } else { direction = x + 10; } You can see why the shorthand is preferred by developers. Incidentally, I think Alan has made up a new technical term to describe this construct ("lots of strange stuff with more x's"). Love it.
@alanpowell3287 жыл бұрын
Fame at last!
@109ha2877 жыл бұрын
Hello Sir! I was looking a simple mercury-swich at first place, to add to my project, later i'we seen that i can't buy one, coz they are banned in EU. I'm wery scared about gyros & accelerometers till i saw Your video. Now I'II try out if I can make a simple measurement unit, after Your instructions. Thank you so much of encuraging me, with this tutorial, it seems easyer for me now to begin with MPU6050.
@RalphBacon7 жыл бұрын
Yes, do that Andras, it's not scary at all really, just unknown. You can get "mercury" switches that are not mercury switches at all, see my video #67 that covers this in some detail.
@thomasvnl8 жыл бұрын
Arduino IDE and Processing do have a lot in common. Processing does get used a lot in data visualisation, Arduino can be used in data gathering. I think the developers didn't want to build the IDE from scratch and I can't blame them. The shared looks is nice for people who are acquainted with one or the other. Nowadays the Processing IDE looks a lot more modern than it used to look like, it used to look a lot more like the Arduino IDE ;)
@RalphBacon8 жыл бұрын
I must admit, Thomas, that it looked a bit "Mac-like" to me - attractive though, and different from the Arduino IDE which could do with a facelift. But then again, that's why I did my video on Sublime Text, an alternative IDE which offers many advantages over the regular IDE (not just a pretty face!) but is still very usable for beginners that have outgrown the original. No, I don't blame the Arduino developers for taking an existing IDE and making it work for them, not one jot. Thanks for posting, good to hear from you.
@irfanjaffar31617 жыл бұрын
hi sir, if im using the arduino mega, the setup will remain the same or i have to change the code a bit? thank you sir
@RalphBacon7 жыл бұрын
I'm pretty sure you don't have to change a thing, Irfan (other than selecting the correct board in the IDE). If you get problems, let me know.
@TYGAMatt4 жыл бұрын
Maybe time to revisit the MPU6050 with the ESP32 Ralph. I tried Joop's code with the ESP32 and having some issues. Then of course there's the MPU9250 too. Just a thought :-)
@RalphBacon4 жыл бұрын
And a thought it will remain for the moment, I'm afraid, I have too many other things to do. And don't forget I'm still trying to move house (if someone ever buys mine) which will cause massive problems for my KZbin channel not to mention any kind of electronics.
@farmlandtiger13776 жыл бұрын
So ADXL345 can't detect yawing, but MPU6050 can detect. Right?
@RalphBacon6 жыл бұрын
MPU6050 can most definitely detect it (the demo proves this with the mini plane sketch). Not sure about the ADXL345 though, but Google will probably help you there.
@evdru90285 жыл бұрын
Thanks for the information, I have just subscribed and watched your other videos as i have managed to build this project with great success, I would like to take my project futher with making it wireless, between the gyro and the LED strip as I was inspired by your rain sensor for your cat, I know what extra hardware I require but I can't workout the code to bring them together, any help would be appreciated, thanks for the great videos
@RalphBacon5 жыл бұрын
Thanks for subscribing! If you find my email address in the About tab of this channel we can discuss the wireless aspect of your project.
@evdru90285 жыл бұрын
Ralph S Bacon thanks for your reply, it will be in the new year before I get the extra hardware, in the meantime I will study your code for your wireless rain sensor and add extra code for pitch to this project , hope to get intouch in the new year for help for wireless code, Merry Xmas
@llIIllIlIIllX_XIillIIllIIllIll3 жыл бұрын
I watched like 7 reviews of the same piece, NONE OF WHICH talked about the Accelerometer! Where is the code that determines the DISTANCE this robot has traveled?
@RalphBacon3 жыл бұрын
Sorry, I didn't cover that, the gyro was such hard work I stopped when I got that working.
@maxim25o23 жыл бұрын
Ah now I understand, You use accerometer to calculate Z axis, and combining time You can calculate how much rotation on Z axis was made. I look at tutorial about that chip, and cunstruction is based as measuring mass against earth. If I rotate more in Y axis or Z axis, then values are bigger, but Z axis is unavaible of cource. Then is coming to play accerometer, This way values of X and Y rotated on Z axis can be calculated how big force was used to turn, and using time, is posible to calculate overal rotation. But rotation is not static, is cjhanging back to zero when module is not moved for longer time.
@RalphBacon3 жыл бұрын
Glad you got it figured out, it was a long time ago when I did that video.
@SpeccyMan8 жыл бұрын
You've strayed into my particular area of interest. No build video as I prefer to make gadgets rather than make videos but here is a link to some photos of my multirotor build from last year. imgur.com/a/hRqZj The flight controller has one of those devices on board. This particular machine is now back in pieces on my workbench as I am in the process of a rebuild as I want to add the "extras" such as GPS assisted flight modes.
@RalphBacon8 жыл бұрын
My mother told me I strayed a lot, mostly "from the straight and narrow". But how about that, me doing a video on a device that you must know very well, and on a quadcopter too! What I don't know (mainly because I don't know drones) is how this device, together with a microcontroller, actually keeps the quadcopter stable. What does it do with the motors, or whatever? Or does it feed info into the onboard receiver/controller? Nice pics, by the way, I see you have the same scope as me. Great minds and all that...
@SpeccyMan8 жыл бұрын
It is something called PID and it is very tricky to explain (I sure couldn't manage as physics was never my forte.) There are plenty of good explanations on the web and a couple of very good videos by the more skilled multirotor builders out there. The firmware on the flight controller and the configuration software deal with all the "nitty-gritty." Me, I just like to build them and fly them. If you want to find out more Google for a document entitled "PID without a PhD"
@RalphBacon8 жыл бұрын
I'll do just that Nick, just to satisfy my own curiosity, thanks for the information.
@SpeccyMan8 жыл бұрын
If you are curious, this is a link to the flight controller board I use, www.unmannedtechshop.co.uk/naze-32-full-10-dof-flight-controller-rev-6/ Lots of amazing features for a quite modest price. There are newer and better flight controllers out there now but this one has a good track record.
@RalphBacon8 жыл бұрын
A whole world of Naze controllers, it would appear. I wish I had time to actually fly a drone. The tiny ones I have are good fun for an hour on a *very* calm summer's day but I really want one to shoot HD quality video so I can inspect my roof, gutters, chimney and the like. Now *there's* a business idea...