Hey according to command prompt, port 3 is opened, but no graph is appearing!! What should I do? Well not even empty graph is there, just two grey lines on the top
I'm trying to work through your tutorial but I get this when using the command prompt. C:\Users\mjgra\Downloads\SerIOGrapher-master>npm install command-line-args serialport socket.io socket.io-serialport 'npm' is not recognized as an internal or external command, operable program or batch file. Whats up with that? Thanks, matt
The npm command comes with node, so it sounds like node.js isn't installed properly. Node is supposed to add itself to your path so the command window will find it when you type out `node` or `npm` A couple of things you could try here: 1. reinstall node.js to see if that fixes things (also be sure to open a fresh command window after, since that path change won't be available in an existing command window) 2. if the above didn't fix it, check that nodejs is installed in "C:\Program Files odejs\" or "C:\Program Files (x86) odejs" If so you'll just have to use the full path so "C:\Program Files odejs pm" (here quotes are important) instead of just npm. Similarly "C:\Program Files odejs ode.exe" instead of node.
Hey just stumbled upon this video and the information on making a graph is extremely helpful thank you. I myself am working with the MPU and have started using Arduino this year and having 1 year experience in computing before that . Right now I'm trying to use the MPU 6050 to measure the acceleration on a servo at different delays. The MPU accelerometer speaks in G's and the output in the serial monitor is so fast and I can't seem to find a pattern. So I am basically trying to find the correlation between servo delay and acceleration in G's. Any reply at all would be very helpful. Thanks and keep uploading great content.
Okay so I struggled immensely with getting this to work, but after some problem solving I got it to work in my Windows VM (on my Macbook) and even on my Macbook in Mac OS itself! (Both): I advice downloading the older version of Node.js, probably the version shown in the video. With the newest version it didn't work, because the modules you're downloading didn't seem to align well with the Node.js (but I have to say that this error occurred in the beginning of my solving adventure, so maybe after with the below tweaking it might not be a problem). (Windows): when I tried downloading the node_modules with nvm in Windows (VM, but also on a fellow student's MSI laptop with boot Windows), it seems like it wouldn't download all the modules. Because of this it would generate an exception, because the application couldn't find the needed modules. I don't know why this happened, but when I copied the modules that were downloaded in Mac OS (there it seemed to download them all), it worked fine on Windows VM! (Mac): First, make sure to comment the process.exit, because the OS indeed isn't Windows or Linux, but you want the process to be able to continue. Second, since ports aren't numbers in Mac OS, but names, the parseInt of the port_number (imported from the commandline) will generate an NaN. By making the port_number a String, and deleting the parseInt around line 55 (I changed some things, so it may not be the same line). I know I wrote this very cryptically, but if anyone would like my rewritten code, let me know, and I'll upload it to GitHub. It isn't very universal, but you may understand better what to tweak. I may even be able to write a more universal version, that also supports Mac OS, but I know have to continue with my project that I needed this webinterface for haha.
OhNoWell. I know this video has been uploaded more than 4 years ago but can you still send me the modified code. my email: faissal.b@hotmail.com, thanks in advance.
Thank you for putting this demonstration together. I was hopeful I could give it a run, but it seems the node.js ecosystem moves too quickly? `brew install node` installs version 14.6.0, on my MacOS 15.16 and in my resulting environment, I cannot get the socket.io-serialport to install without error. All other prerequisites install without error. I'm not a node.js developer, so I'm at the mercy of a clean installation. Any ideas welcomed.
Thanks! Originally I had planned to include that as one of the steps in this video, but I decided before filming that it wasn't essential to understanding the process so I skipped it. I'd like to keep my videos as trimmed and concise as I can. Calibration isn't hard for this sensor though. Just run the IMU_Zero example sketch included with the MPU6050 library and it will give you offsets to plug back into your future programs.
I have tried to find tutorial on how to calibrate it, but unfortunately with no succes. Internet is full of examples and tutorials how to calibrate this sensor in just one plane. So relative changes can be considered quite acurate for lot of projects, but if one want to measure absolute position and changes in all three planes it is not sutable. As far as I know there should be 3 times 3 matrix describing relation between all planes and offset should be calculated as "right side of matrix" (not sure if this if right term in english). But creating such a matrix is far beyond my knowledge of physics :/
I never needed to calibrate beyond using the IMU_Zero sketch. Detecting my simple gestures doesn't require a great degree of precision. Perhaps one of these MPU6050 projects might help get you closer to what you need? hackaday.com/2016/09/13/bewegungsfelder-is-a-wireless-imu-motion-capturing-system/ hackaday.io/project/9165-2-axis-stabilization-w-6dof-mpu6050-and-arduino
When I open the graph there is no actual rectangle graphs for the data to show, it is just a grey line and a second grey line beside the first one. Anything I am doing wrong? All installs and commands have performed as instructed, but nothing showing for graphs.
Brett Becker I've been meaning to update the project to allow passing in the serial port number as a command switch or environment variable instead of hard coding. Just haven't gotten to it yet.
You previously did some videos about using hc-05 with HID to send physical keyboard and mouse commands. What about using HC-05 to send MPU6050 gestures as commands to the computer as HID? For example, turn hand upwards to scroll up, hand downwards to scroll down, mouse movement data, etc. It would be awesome if you would suggest me some way how to do this. Awesome videos btw
That's really interesting. It's certainly possible. The way I'm currently implementing gestures is kinda bone-headed though, they all need to be rigidly pre-defined in the arduino code. So FYI, If you wanted to be able to add/record gestures on the fly, my current technique wouldn't handle it. That said, it shouldn't be very hard at all to, for instance, fire a "page-up" key when lifting your hand instead of flashing the LED. Once you have the HC-05 wired in, it's just waiting for serial data to send to the host machine. All you have to do is add some lines to the gesture detecting function where you use Serial.write to send the keystroke. Something like this: Serial.write((uint8_t)0xFE); // BT-HID: Start Byte (shorthand version) Serial.write((uint8_t)0x02); // BT-HID: Data Length Serial.write((uint8_t)0x00); // BT-HID: no modifiers Serial.write((uint8_t)0x4B); // BT-HID: Page-Up Serial.write((uint8_t)0x00); // BT-HID: optional second keystroke
something is really strange I opened index.html and it shows nothing upon inspecting I suspect the html file is missing some code could any one verify and tell ,all i get is two dashed lines using chrome
Thanks for the code mate! I am making a calorie tracker for a skateboard and wish to know the road slope in order to calculate calorie expenditure. How would you suggest I deal with the false readings I get due to vibration?
Can't say how effective it might be for your particular use case, but in my situation the raw data was similarly noisy. I smoothed out the graph by taking an average of the previous N raw values. Don't recall what count I used, but It's likely very dependent on your sampling rate. You'll need to experiment, keeping in mind that values of N too high will over-smooth your graph and be practically useless.
No this was pretty simple and done in the code (on the arduino if I recall correctly, though it could just as easily be performed in the js app). I maintained an array of the previous N raw values per axis, and took their average for displaying the smoothed graph.
Razak Shafthar it could be that your serial port number is different than my hard coded default of com3. If you know your port number there's only 1 or 2 places it needs to be updated.
Hi - My serial on the Arduino IDE is working but the graph running on chrome, edge is blank. When I run; node acc_serial_socket.js -l I get: COM6 USB\VID_2A03&PID_0043\55338343539351117191 Arduino Srl (www.arduino.org). Not a FTDI Thank you in advance
I'm confused now, all accelerometer, gyroscope and magnetometer look they do the same job which detect tilt effects! What is the actual difference between these modules?
That will happen if your Arduino IDE is still listening to the serial port, or the command is listening to the wrong port. Check the port number in the Arduino software and be sure to kill any Serial Monitor windows that are active. Finally in the command, you can specify the port number with -p (as shown at 4:30 )
still didnt work thou,, when i install npm i get some warn like : npm WARN enoent ENOENT: no such file or directory, open 'D:\SerIOGrapher-master\package.json' npm WARN SerIOGrapher-master No description npm WARN SerIOGrapher-master No repository field. npm WARN SerIOGrapher-master No README data npm WARN SerIOGrapher-master No license field. is it the problem ? and can i use this to get the mpu data into C# ?
It looks like the you may not have typed the complete install command. It should look like this (all in the same line): npm install command-line-args serialport socket.io socket.io-serialport
After messing around for quite some time trying to get this working on OSX it suddenly struck me that it's easier to use the Serial Monitor that comes with the Arduino IDE.
Hi, Is there any possible way to record certain gesture? not in the hard coded way? I mean the gesture you suppose to record is limited from flat to vertical? I mean can you make like waving hands and so on that is not limited to the condition that you do in this video.
Currently it's just the one gesture, going from horizontal to vertical (with the timing constraints to avoid false positives). Eventually I'm going to incorporate it into my Sword of Omens prop in order to trigger some pulsing lights and if I can figure it out, maybe a sound effect as well.
great video very well explained, im working on a project where we need to decode gestures into text for people who use sign language and we needed something like this, i have a few questions to ask if u can give me ur email itll be great thanks
I'm not familiar with that accelerometer. In theory, yes, but the arduino code will be very different as your module depends on different libraries. I'd recommend working through Adafruit's guide to get the arduino set up for this acc. Once that's working, I think you should just be able to modify the serial.print statements to match the ones used in my arduino code. The node.js part should work without modification.
7 years later this is still extremely helpful.
I like the start of your video:D and not only! You are uploading very interesting stuff and I hope you will get more views on them! Cheers!
Tiko Ghazaryan Thanks! Yeah, I hope so too.
DastardlyLab
erotika
This was what i was look for hours for .thanks for make this video
Interesting content well explained. Great video! Thanks for sharing your knowledge.
Thanks! I hope you get some use out of it.
this is good, thanks for posting. Very relaxing to listen to. Just what a stressed coder needs while debugging :)
Damn cool video
my advice to you, look at dynamic time warping, you can normalize all three axis and get even more complex curves recognized very easy
Hey Šimun Čanić, did this work for you, cause it didn't xork for me. And I was wondering if you could explain it to me please. And thank you again.
Hey according to command prompt, port 3 is opened, but no graph is appearing!!
What should I do? Well not even empty graph is there, just two grey lines on the top
Great video
I'm trying to work through your tutorial but I get this when using the command prompt. C:\Users\mjgra\Downloads\SerIOGrapher-master>npm install command-line-args serialport socket.io socket.io-serialport
'npm' is not recognized as an internal or external command,
operable program or batch file.
Whats up with that?
Thanks,
matt
The npm command comes with node, so it sounds like node.js isn't installed properly. Node is supposed to add itself to your path so the command window will find it when you type out `node` or `npm`
A couple of things you could try here:
1. reinstall node.js to see if that fixes things (also be sure to open a fresh command window after, since that path change won't be available in an existing command window)
2. if the above didn't fix it, check that nodejs is installed in "C:\Program Files
odejs\" or "C:\Program Files (x86)
odejs" If so you'll just have to use the full path so "C:\Program Files
odejs
pm" (here quotes are important) instead of just npm. Similarly "C:\Program Files
odejs
ode.exe" instead of node.
Hey just stumbled upon this video and the information on making a graph is extremely helpful thank you. I myself am working with the MPU and have started using Arduino this year and having 1 year experience in computing before that . Right now I'm trying to use the MPU 6050 to measure the acceleration on a servo at different delays. The MPU accelerometer speaks in G's and the output in the serial monitor is so fast and I can't seem to find a pattern. So I am basically trying to find the correlation between servo delay and acceleration in G's. Any reply at all would be very helpful. Thanks and keep uploading great content.
Hey Bro, I am working on Hand Gestures Recognition with the help of MPU 9250. Do you have dataset about this project?
Okay so I struggled immensely with getting this to work, but after some problem solving I got it to work in my Windows VM (on my Macbook) and even on my Macbook in Mac OS itself!
(Both): I advice downloading the older version of Node.js, probably the version shown in the video. With the newest version it didn't work, because the modules you're downloading didn't seem to align well with the Node.js (but I have to say that this error occurred in the beginning of my solving adventure, so maybe after with the below tweaking it might not be a problem).
(Windows): when I tried downloading the node_modules with nvm in Windows (VM, but also on a fellow student's MSI laptop with boot Windows), it seems like it wouldn't download all the modules. Because of this it would generate an exception, because the application couldn't find the needed modules. I don't know why this happened, but when I copied the modules that were downloaded in Mac OS (there it seemed to download them all), it worked fine on Windows VM!
(Mac): First, make sure to comment the process.exit, because the OS indeed isn't Windows or Linux, but you want the process to be able to continue. Second, since ports aren't numbers in Mac OS, but names, the parseInt of the port_number (imported from the commandline) will generate an NaN. By making the port_number a String, and deleting the parseInt around line 55 (I changed some things, so it may not be the same line).
I know I wrote this very cryptically, but if anyone would like my rewritten code, let me know, and I'll upload it to GitHub. It isn't very universal, but you may understand better what to tweak. I may even be able to write a more universal version, that also supports Mac OS, but I know have to continue with my project that I needed this webinterface for haha.
my email : mynameismuhammadfaisal@gmail.com tq in advance
OhNoWell. I know this video has been uploaded more than 4 years ago but can you still send me the modified code. my email: faissal.b@hotmail.com, thanks in advance.
Thnku 🙌
Thank you for putting this demonstration together. I was hopeful I could give it a run, but it seems the node.js ecosystem moves too quickly?
`brew install node` installs version 14.6.0, on my MacOS 15.16 and in my resulting environment, I cannot get the socket.io-serialport to install without error. All other prerequisites install without error. I'm not a node.js developer, so I'm at the mercy of a clean installation. Any ideas welcomed.
Absolutely fantastic :) Do you plan to do video about calibrating this sensor?
Thanks! Originally I had planned to include that as one of the steps in this video, but I decided before filming that it wasn't essential to understanding the process so I skipped it. I'd like to keep my videos as trimmed and concise as I can.
Calibration isn't hard for this sensor though. Just run the IMU_Zero example sketch included with the MPU6050 library and it will give you offsets to plug back into your future programs.
I have tried to find tutorial on how to calibrate it, but unfortunately with no succes. Internet is full of examples and tutorials how to calibrate this sensor in just one plane. So relative changes can be considered quite acurate for lot of projects, but if one want to measure absolute position and changes in all three planes it is not sutable.
As far as I know there should be 3 times 3 matrix describing relation between all planes and offset should be calculated as "right side of matrix" (not sure if this if right term in english). But creating such a matrix is far beyond my knowledge of physics :/
I never needed to calibrate beyond using the IMU_Zero sketch. Detecting my simple gestures doesn't require a great degree of precision.
Perhaps one of these MPU6050 projects might help get you closer to what you need?
hackaday.com/2016/09/13/bewegungsfelder-is-a-wireless-imu-motion-capturing-system/
hackaday.io/project/9165-2-axis-stabilization-w-6dof-mpu6050-and-arduino
When I open the graph there is no actual rectangle graphs for the data to show, it is just a grey line and a second grey line beside the first one. Anything I am doing wrong? All installs and commands have performed as instructed, but nothing showing for graphs.
I am using COM4 and was getting blank graphs. Hard setting the port to COM4 in public/index.html and public/main.js fixed my issue.
Brett Becker I've been meaning to update the project to allow passing in the serial port number as a command switch or environment variable instead of hard coding. Just haven't gotten to it yet.
Looks like serial node from Emerging Technology advisors is down. Is there a way to get around that? Every time I do the npm install it fails ...
You previously did some videos about using hc-05 with HID to send physical keyboard and mouse commands. What about using HC-05 to send MPU6050 gestures as commands to the computer as HID? For example, turn hand upwards to scroll up, hand downwards to scroll down, mouse movement data, etc. It would be awesome if you would suggest me some way how to do this. Awesome videos btw
That's really interesting. It's certainly possible. The way I'm currently implementing gestures is kinda bone-headed though, they all need to be rigidly pre-defined in the arduino code. So FYI, If you wanted to be able to add/record gestures on the fly, my current technique wouldn't handle it. That said, it shouldn't be very hard at all to, for instance, fire a "page-up" key when lifting your hand instead of flashing the LED.
Once you have the HC-05 wired in, it's just waiting for serial data to send to the host machine. All you have to do is add some lines to the gesture detecting function where you use Serial.write to send the keystroke.
Something like this:
Serial.write((uint8_t)0xFE); // BT-HID: Start Byte (shorthand version)
Serial.write((uint8_t)0x02); // BT-HID: Data Length
Serial.write((uint8_t)0x00); // BT-HID: no modifiers
Serial.write((uint8_t)0x4B); // BT-HID: Page-Up
Serial.write((uint8_t)0x00); // BT-HID: optional second keystroke
when i run the "node acc_serial_socket.js -l" command, i get stuck on listening on 8080
Just a heads up, the acc_serial_socket does not work with npm_serialport version 5.0.0.
something is really strange I opened index.html and it shows nothing upon inspecting I suspect the html file is missing some code could any one verify and tell ,all i get is two dashed lines using chrome
Now days there is a plot monitor on Arduino ide > tools
Thanks for the code mate! I am making a calorie tracker for a skateboard and wish to know the road slope in order to calculate calorie expenditure. How would you suggest I deal with the false readings I get due to vibration?
Can't say how effective it might be for your particular use case, but in my situation the raw data was similarly noisy. I smoothed out the graph by taking an average of the previous N raw values. Don't recall what count I used, but It's likely very dependent on your sampling rate. You'll need to experiment, keeping in mind that values of N too high will over-smooth your graph and be practically useless.
i need to connect 5 mpu9250 to ardino . What to do?
How did you work out the running average? Did you use MATlab or another type of signal processing software?
No this was pretty simple and done in the code (on the arduino if I recall correctly, though it could just as easily be performed in the js app). I maintained an array of the previous N raw values per axis, and took their average for displaying the smoothed graph.
i just need 10 values each after 3 sec wat changes i have to make in the code
I am getting stuck on the graph part. My serial is working on the Arduino IDE but no pattern(blank) is showing in the accelerometer graph in chrome. .
Razak Shafthar it could be that your serial port number is different than my hard coded default of com3. If you know your port number there's only 1 or 2 places it needs to be updated.
nice work!!!, i cant find the smooth mpu6050 ino code, how you smooth the raw data?
Hi - My serial on the Arduino IDE is working but the graph running on chrome, edge is blank.
When I run; node acc_serial_socket.js -l
I get:
COM6
USB\VID_2A03&PID_0043\55338343539351117191
Arduino Srl (www.arduino.org).
Not a FTDI
Thank you in advance
I'm confused now, all accelerometer, gyroscope and magnetometer look they do the same job which detect tilt effects! What is the actual difference between these modules?
can you please help me fix a code for a arduino seismograph? will remain ever grateful
i want to make gyroscope joystick controller and butons with arduino uno are you can help me thx
when i open port using cmd, the arduino stop working and give me message "port is busy" and when i close cmd, the arduino work again, any solution ?
That will happen if your Arduino IDE is still listening to the serial port, or the command is listening to the wrong port. Check the port number in the Arduino software and be sure to kill any Serial Monitor windows that are active.
Finally in the command, you can specify the port number with -p (as shown at 4:30 )
still didnt work thou,, when i install npm i get some warn like :
npm WARN enoent ENOENT: no such file or directory, open 'D:\SerIOGrapher-master\package.json'
npm WARN SerIOGrapher-master No description
npm WARN SerIOGrapher-master No repository field.
npm WARN SerIOGrapher-master No README data
npm WARN SerIOGrapher-master No license field.
is it the problem ? and can i use this to get the mpu data into C# ?
It looks like the you may not have typed the complete install command. It should look like this (all in the same line):
npm install command-line-args serialport socket.io socket.io-serialport
Hey, i have the same error. Did you find a solution?
why the HTML file is not displaying nothing
just blank page
solved thank you
also same problem. how did you solve?
After messing around for quite some time trying to get this working on OSX it suddenly struck me that it's easier to use the Serial Monitor that comes with the Arduino IDE.
Hi, Is there any possible way to record certain gesture? not in the hard coded way? I mean the gesture you suppose to record is limited from flat to vertical? I mean can you make like waving hands and so on that is not limited to the condition that you do in this video.
Forgive my ignorance but what are the units on that vertical graph once you got it recording real time?
How many different gestures do you have?
Currently it's just the one gesture, going from horizontal to vertical (with the timing constraints to avoid false positives). Eventually I'm going to incorporate it into my Sword of Omens prop in order to trigger some pulsing lights and if I can figure it out, maybe a sound effect as well.
Im very interested in your sword of omens prop project, will you make a guide/video on more and advanced gestures ?
great video very well explained, im working on a project where we need to decode gestures into text for people who use sign language and we needed something like this, i have a few questions to ask if u can give me ur email itll be great thanks
On my screen, range of the mapping for the graphs are just at the 20K. How can I expand it to 40k just like yours?
If i use adxl345 its stil work or not
I'm not familiar with that accelerometer. In theory, yes, but the arduino code will be very different as your module depends on different libraries. I'd recommend working through Adafruit's guide to get the arduino set up for this acc. Once that's working, I think you should just be able to modify the serial.print statements to match the ones used in my arduino code. The node.js part should work without modification.
Bro can you please help me to connect two mpu6050 to single arduino
it doesn't work..
Interesting content well explained. Great video! Thanks for sharing your knowledge.