Connecting the Arduino to the Matlab

Hello I am a student electronic engineering I'm working on a project (the ball - on - plate) and I am having trouble connecting Arduino with matlab please help

Posted by aljaur 1 year ago


Real time plotting in Matlab

Hey ppl need some help, im working on a temperature controller that is based on 89c52 microcontroller, the sensor data is conv to digital by an adc0804 & the data is sent to the pc via the rs232 port, i need to plot a temp graph using matlab in real time, ive read that the hold function could be used but i havent had any success so far........ need help with the matlab code, the rest is fine... the baud rate is 9600

Posted by vedvern 10 years ago


i want to do a project in image processing where can i get it?

Asked by suryasreenu 9 years ago  |  last reply 9 years ago


Arduino & Matlab

Hi, I'm working on a project  the ball - on - plate, and I have a problem in controlling the model of the MATLAB eg PID parameter . Please Help

Posted by aljaur 1 year ago


using 2 x adafruit motor shield v2 in MATLAB

Hi, I set up an Arduino + adafruit motor shield v2 to control 4 x DC motors in a robot arm via MATLAB, which work fantastic. I mounted the robot arm on a 4WD base (each wheel has a separate DC motor), so now I have additional 4 more DC motors to control. I know the adafruit motor shield v2 is stackable, as long as you solder the I2C part on the second shield. I don't know if MATLAB supports 2 x adafruit motor shield v2 on top of Aurduino (2nd shield via I2c), to control 8 DC motors in total any advise or experience is highly appreciated

Asked by Begginer2017 1 year ago  |  last reply 1 year ago


how to implement fuzzy logic controller for dc motors using simulink?

I would prefer step wise instruction to implement it for a for a given transfer function

Asked by ankita13 6 years ago  |  last reply 6 years ago


PIC16F877A coding to interface with MATLAB(GUI)

Hello, i just to ask anyone who know how to interface PIC16F877A with GUI(graphical user interface) using MATLAB ? Thank you

Posted by esan 11 years ago


How to detect objects and location i.e. coordinates from an image in matlab?

I need to detect an object and its location from an image. I have used different techniques to get it but i am able to identify the object only but not its location.  

Asked by dkz 6 years ago  |  last reply 6 years ago



can i just call my matlab functions in the mex file containing my thread?

Hi guys,i am doing Oop in matlab and  i have to simulate 2 different networks and visualize the results at thesame time. i have all my functions writtten in matlab m-files.Matlab does not support multithreading .To use mex files will i need to re-right all my matlab functions in the c-pogramming language again or can i just call my matlab functions in the mex file containing my thread?

Asked by tabenash2002 9 years ago  |  last reply 8 years ago


Matlab code for object detection using Webcam?

Hello , I am using Arduino to control a car and i want to make it autonomous by using a webcam to see the object i want and make the car moves to this location i need several things 1) Matlab Code 2)Interface between Matlab and Arduino  3)How to connect between them (software not hardware) I need any tutorial to learn or any instructions to make my project I see many people done this before but unfortunately they   did not mention how to start in this kind of projects  I really really appreciate any help

Asked by mohamed.elseify 6 years ago  |  last reply 6 years ago


Matlab-Arduino Multi Servos "for" loop ?

Hi! I am new  to arduino. I am struggling with basic problem i guess. I need to rotate 2 servo slowly with for loop in Matlab. To rotate one servo from 90 to 120, I am using this code in Matlab: for i=90:120 fwrite(arduino, i); pause(0.03); end I found zoomkat sample multi servo code but it requires string command   like: fprintf(arduino,"%c", "700a,"); And of course ( for i=90:120 fprintf(arduino,"%c", "ia,"); pause(0.03); end ) Not working. I thought that first number of i may represent servo number. For example;  fwrite(arduino, 1100) -> Servo number 1 to 100 degree fwrite(arduino, 2050) -> Servo number 2 to 50 degree Arduino Code: #include Servo servo1, servo2;  void setup() {   Serial.begin(9600);   servo1.attach(6);    servo2.attach(7);  } void loop() {   if( Serial.available() )     {         int x = Serial.read();         int servoNum=x/1000;         int w=x-(servoNum*1000);         if (servoNum==1){           servo1.write(w);}         if (servoNum==2){           servo2.write(w);}      }      } And when i try fwrite command in matlab  arduino = serial('COM3','BaudRate',9600); fopen(arduino); pause(0.5) for i=60:90 a=2000+i; fwrite(arduino, a);  %Servo number 2  from 60 to 90  pause(0.02) end But this one also not working... How can i do that? Please help..

Asked by mr61 4 years ago  |  last reply 4 years ago


How can I import stock option prices into Matlab automatically (without copy pasting)?

How can I import that bid and ask for diffrent stock options from a site such as yahoo finance into matlab without manually copying and pasting and editing the information? I Don't need historical data, only the current bid and ask. thank you

Asked by 10 years ago


MATLAB Simscape Power Systems & Electronic ?

Hello! I need tutoring MATLAB Simscape Power Systems and Electronic. I am working on a project in which I am trying to simulate Photo voltaic panel charging battery with controller ( dc-dc buck-boost converter) with Maximum Power Point Tracker and without it. I need to calculate efficiency for both cases. I have stared part of it with searching online Please, if you can help let me know

Asked by skumu 2 years ago  |  last reply 2 years ago


Using Adafruit Motor Shield in MATLAB

Hi All, I am quite new to robotics, facing an issue and looking for expert advice, appreciate if you can guide me. I got Aurdino Uno connected to the laptop, set up all good. connected a potentiometer to the board, and could read the voltage in MATLAB from 0 to 5 V, all ok. Connected a DC motor to Adafruit Motor Shield, connected 5 V DC power to the motor shield. connected the motor shield to the Aurduno board (put it on top of the board, but loose, no soldering involved).  MATLAB is not recognizing the shield and see error message like the hardware disconnected. This might be a silly question, I can use  stackable pins, solder to the motor shield and then connect it to the Aurduino board. In that case, every input/output pins of the Aurdino will be connected to the corresponding terminal in the Adafruit Motor Shield and also available from the top (by stackable pins) to connect potentiometer etc... Is that how i can get the Adafruit Motor Shield recognized by MATLAB? need to use a few potentiometer for my project, so need to have the analog pins available. Also, just wondering: which pins establish the communication between Aurduno and Adafruit Motor Shield? using stackabke pins will connect all of them, but i can not figure out how connecting the analog pins of Aurdino to the motor shield adds any value... Thank you

Asked by Begginer2017 1 year ago  |  last reply 1 year ago


Unified power flow controller, matlab/simulink?

Please somebody should help me change the default port of UPFC to 2 input, 2 output matlab/simulink I need to do some simulation with 2 input, 2 output port, so anybody who can help should email me tchubabyboy@gmail.com to send my circuit diagram. i have attached files I am using matlab/simulink 2012a

Asked by tchut 5 years ago


is it possible to control a stepper motor using matlab?

I've bin workin on an adaptive control system of an aircraft using neural networks... so i need to control the angle of the ailerons using steppers... i've created and trained the neural network in matlab but i dunno how to make a closed loop control by interfacing it with a stepper motor... can any1 help me out with this???

Asked by ravimaiden 9 years ago  |  last reply 9 years ago


When Zombies Attack!

From the University of Ottowa:A mathematical modeling of an outbreak of Zombie infectionWith citations, graphs and MATLAB code.As seen in the movies, it is imperative that zombies are dealt with quickly, or else we are in a great deal of trouble.

Posted by lemonie 9 years ago  |  last reply 9 years ago


is there an interactive programming language like matlab or labview which can be used to program microcontrollers ?

Thing is... i hav a gr8 interest in robotics and automation... n i am pretty good in matlab and labview... but these are applications for developing and modelling control systems... so is there an application which can help me control robots interactively?????????????

Asked by ravimaiden 9 years ago  |  last reply 9 years ago


Converting NTSC camera to Webcam?

Hi, I was wondering if it is possible to use NTSC camera as a webcam by converting the output to USB. I want it to be a webcam so that I can play around with it in MATLAB. Cheers, Jas

Posted by jasubhi 1 year ago  |  last reply 1 year ago


How to develop electronic differential for articulated rear drive e-trike using the steering angle in Matlab/Simulink?

One wheel at the front and two wheels at the rear,steering mechanism

Asked by SachinK114 2 years ago  |  last reply 2 years ago


can anyone help me with this ? Answered

I need to change the default ports of Unified Power Flow Controller (UPFC) to 2 inputs, 2 outputs using matlab/simulink 2012a or earlier. I have upload the picture changing 'from' to 'to'. I need this steps urgently for simulation of FACTS devices.

Asked by tchut 5 years ago  |  last reply 5 years ago


metal detector

​i want to make a metal detector using tda0161, when the detector detects the metal from a specific distance the buzzer sounds but as the metal comes near and near the buzzer sound increases!! so anyone guide me for this i want to use this with arduino and to interface it with matlab and want its code too!!

Asked by mati ur rehman 3 years ago  |  last reply 3 years ago


Guidance & Info about Quadcopter Project?

Hello everyone, I am working on a collision avoidance protocol for my masters thesis and need guidance and information especially from people who have done the same or similar project.The implementation is in two stages: 1. simulation (a) i want to construct a 6 dof quadcopter model in simulink (b) create the collision avoidance protocol with matlab and it will include: (i) ultrasonic range improvement protocol (ii) Kalman filter(for data fusion of ultrasonic and infrared sensor data) (b) I want to be able to integrate the collision algorithm created in matlab into the model created in simulink and test its functionality using simulink 3D animation. 2. Construction (a) i want to construct a quadcopter to validate all that has been done in the simulation. (b) I want it to be FPV type to record videos on flight. Please need your input as to how you think i should go about it from softwares, hardwares,simulation & construction etc.

Asked by emmaotsapa2013 2 years ago  |  last reply 2 years ago


how to interface the remote control and laptop?

I need to do the vision-based robot soccer movement control.i used two remote control car as a robot soccer.i want to control car using pc  via the matlab coding.so how can i done this work?can i interface pc and remote control using arduino and make the car move as i want?please help me...

Asked by dekya 6 years ago  |  last reply 6 years ago


plot serial data? Answered

Hello  i need to know how to plot serial data on computer , i have a data that comes from sonar sensor via xbeee to pin 19 rx on arduino mega , i can read those value but i need to plot it versus time and save its value  for pid results. i tried simplot and it work but it dosent save data, and im stuck on matlab and i couldnt make it work.

Asked by adiga123 5 years ago  |  last reply 5 years ago


How to get ROV or RC Submarine to surface?

1) I plan to do a ROV so i gathered some information, But i need more help how to get the ROV from deep water to surface? 2) I have to take pictures from underwater and i have to do some image processing through Matlab so suggest me some best underwater cameras? 3) Please explain me about UROV thrusters?

Asked by athuv 3 years ago  |  last reply 3 years ago


Wireless Face Recognition Final year project? Need Help at the wireless part ?

Were using open cv for the face recognition part and we need a wireless interface between the computer and image acquisition device.  we originally planned on using matlab for the face recognition part but decided to stick with open cv ...... For the image acquisition device we wanted to make a bluetooth camera using a cmos camera and bluetooth modules . I need a suggestion if the project is possible and how to interface the system . Thanks  

Asked by khowsrow 6 years ago  |  last reply 6 years ago


Sensitive Accelerometer Chip

I've seen some projects that use accelerometer chips with arduinos to get readings (e.g. in MATLAB). I'm looking to do this but I'm going to be measuring very low amplitude, low frequency vibrations so, I imagine, the types of acceleromters I've seen used (e.g. the MMA7341L) won't be sensitive enough. Does anyone have a suggestion for which accelerometer would be appropriate (I know that MEMS are a popular brand - there's a list here: http://www.analog.com/en/mems-sensors/mems-accelerometers/products/index.html)  Many thanks for your time! Oli

Posted by ocheadle 4 years ago  |  last reply 4 years ago


Pixel by Pixel Image?

There are many uses for a pixel by pixel image generated using simple values, however there doesn't seem to be an easy way to do it.  I have used excel and its shading by value feature, but this isn't always the most effective method.  So assuming you have two coordinates and a value between 1 and 1000 (like a temp or rf intensity) how would one easily create an image from this data (array or matrix). Matlab or Mathematica? The goal is to make a kind of radio telescope that measures rf intensity with an arduino and then creates an image based on the values spread across a matrix.

Asked by seedorfj 3 years ago  |  last reply 3 years ago


Guidance & Info about Quadcopter Project?

Greetings lads, I'm new in forum and since I made some research the past days I'd like to get some guidance about constructing & programming a Quadcopter from scratch since I'm completely new on a project like that. Quadcopter Frame: Thinking about to construct an aluminum 70cm diameter frame which will weight around 500g. What kind of motors should I get in order the frame with the board,motors etc. will be able to lift? Board: I'm thinking to use Arduino Uno or Raspberry Pi 2.0 ( With a little bit of research I made I conclude that Raspberry could make my life a little bit easier since you can add wifi on it. The quadcopter will be controlled via a pc/laptop through wifi). What can you suggest and why? ESC: As far as I've seen in most of similar projects people using ESCs in order to control the motors throttle. Can you avoid that, with programming PIDs that make the same job in order not to use more hardware? About PIDs and Code in General: Thinking about to simulate the whole project in Simulik, Matlab and somehow (if it's possible) to convert the Matlab Code into C++ and download it on the chip. What do you think about that? About the whole project: I'm trying to minmize the hardware as much as it's possible (use only 4x motors, the board with the chip on it, cables and probably some sensors) in order to minimize the total weight of construction and ofc the price. That's all for a start. I'm gladly waiting for your answers and ideas. Cheers  :)

Asked by Gidovoskos 4 years ago  |  last reply 4 years ago


Need Help with Arduino code for gesture controlled robotic arm?

Hello! I'm doing a project on gesture controlled robotic arm. I'm using MATLAB for gesture recognition, and have interfaced it with the arduino board. When a gesture, say up, is recognised, a pin is made high. How do I go about programming the arduino to make the arm move up (i.e control the servo motor in one direction) as long as I show up, and make it move back down when I show the gesture for down (make the servo motor rotate in the opposite direction for as long as the gesture is shown)?  I only know how to do this for analog inputs, not digital ones. I'm sorry if this is a silly question, I'm new to Arduino. Thank you for your time!

Asked by AnjanaRao 4 years ago  |  last reply 4 years ago


Advice for hydraulic master thesis.

Hello, I’m a civil engineering student and I’ve always had a special interest for electronics, sensors, and arduinos. I’m finishing my degree for which I have to develop a thesis. After some research and based on some articles, I proposed to my hydraulics Professor to monitor the solids transportation (at the bottom of a river) using a hydrophone. This idea consists on measuring the intensity/quantity of sediments (like rocks and muds) passing through a certain spot. These measurements are made using a hydrophone put underneath a seel plate – when the sediments pass beneath this plate they create impulses or frequencies, which will then be analyzed. What I would like to know is the best way to capture these frequencies through the hydrophone – mobile recorder, daw, arduino? I intend to connect the hydrophone to the computer, either through the arduino or through a sound plaque, but I’m afraid these solutions are more prone to the appearance of noise. The frequency range to analyze is between 10Hz and 30kHz. Will it be a good solution to connect the hydrophone to the arduino? Another issue in my mind is the handling of the data gathered – should I use excel, matlab or python? Thanks, Carlos Esteves

Posted by amagro 5 years ago  |  last reply 5 years ago


Thoughts on Arduino/Raspberry Pi Idea?

Hi everyone, I am part of a research group at UC Berkeley working on a product involving the Arduino/Raspberry Pi. We are conducting market tests, and would really appreciate your help answering these questions. Thank you for your time! If you use Arduino/Raspberry Pi, how often do you use it? How do you use it? Would you consider it mostly a hobby or do you use it for school/industry as well? How were you first introduced to it? What are your general thoughts on the Arduino/Raspberry Pi? Did you learn to program by using the Arduino/Raspberry Pi or did you have some prior experience? If you had prior experience, how much? What languages are you well-versed in? Would you be interested in a model-based approach to programming Arduino/Raspberry Pi functions? This would be something akin to Matlab’s Simulink or Labview’s visual programming (flowcharts). The basic idea would be to remove the need to code in C. If you are not interested, why not? If you are interested, what specific features would you enjoy? Do you believe such a tool would be an efficient way to teach/introduce students to programming? In addition, here is a 1-minute survey (on a similar subject) if you are interested: Survey: https://docs.google.com/forms/d/1dkwyhC59I7h8IOuNFyL_tbjo7AFucTP0KQS0mYH1qy4/viewform

Posted by RobertB3 4 years ago


build my own powered / electric wheelchair out of manual wheelchair?

Hello, Newbie here! I was hoping to convert my manual wheelchair into an electric powered one.. What would be the best way to go about this? Could I just install hub motor on the real wheels? Or would a gear motor be better? I was planning to control it using arduino as I would eventually want to make it gaze-controlled (working on the eye tracking code at the moment..if anyone has any advice for that to that would be great!) It is a really important project following an ALS diagnosis and it would mean everything if I could make this work somehow..I am not based in the EU but have family in the UK who could send me over the parts if they don't deliver. I know it can be cheap to just buy a second hand powered wheelchair but where I am it is not so easy to come across and eventually I would have to adapt it to anyway..I also thought it could be a fun project for me to work on as I was an engineering student.  Also is arduino the best way to control it, I am using the viola-jones eye tracking algorithm in matlab.. Thanks for any help! Also if you cant help directly even links to pages that can help would be useful :)))

Asked by NadaA2 2 years ago  |  last reply 1 year ago


Should I work at Squid Labs/Instructables - A questionnaire

I just discovered this gem of a mock questionnaire kinawera wrote a few months ago that is a primer for prospective Squid Labbers. While it's full of inside jokes, I still think you'll find it humorous. Employment questionnaire:SHOULD I WORK AT SQUID LABS?Has something you learned on MythBusters saved your life? How many times?A) OnceB) TwiceC) More than twiceThe difficulty with string theory is:A) it's too short at one endB) the wrong gauge of stringC) not enough of it is made into bridlesOn a one-to-ten index of snuggling, where would you position yourself?How would you characterise your approach to body odour?A) TolerantB) Very tolerantC) (There is no third option on this one)Are at least three major components of your car entirely constructed out of kitchen implements and/or braise?Have you ever used an air compressor for personal hygiene?Can you perform rudimentary kiteboarding maneovres, including permanently alienating beachgoers, preferably through incidents requiring ongoing hospital treatment?Do you have a communal attitude to futons and 40 foot school buses?Define: Mank, munted. Use both in a sentence.Do you like squid?Is a sense of shame a strong, medium or weak motivator in your daily life?You are given a pair of Crocs. What colour are they?Have you ever mapped out a sexual position on Solidworks and/or Matlab?Define the term: bicycle

Posted by ewilhelm 11 years ago  |  last reply 10 years ago


Project Collaboration?

I'm REALLY bored at work at the moment and need a personal project to distract me. The problem with past projects is I often run into problems or lose interest and they fall by the wayside. I was thinking that if the project was a collaboration I'd be more motivated and could call on people with better skills than me. Anyways I'll propose a few projects, and let me know if you are interested. Or if you've got an idea, post it up. I'd love to do something robotics related, but m programming skills aren't great. I can use "wrapper" environments, like Matlab and Arduino, but raw C++ isn't a strong point. I've got access to all the CAD stuff that would ever be needed, Pro/E, Solidworks, AutoCAD, ANSYS, Strand7. I've got some skills in and access to composite manufacturing, like carbon fibre and glass but no vacuum baggin facilities anymore. My first project idea is a bargraph type watch - kind of like the awesome binary watches here, but the time increments on a bargraph. I think only one bargraph to show the minutes would be necessary - you pretty much know the hour most of the time, and you could work it out using the minutes if it's around the hour. A ten segment display would give resolution of 6 minutes - good enough for most purposes. I could do the hardware layout and manufacturing for this project, but I don't think I could do the programming. how about a homemade SMS device? not the most practical when mobile phones are so small and cheap and would be WAY more fully featured, but I think it would be cool to have a homemade device that could at least send SMSs. Open source, single sided PCB, would be awesome. obviosuly as small as possible but maybe aim for something the size of a blackberry of treo? Not stylish maybe but maximum hacker cred thumb keyboard ---> microcontroller ---> cellular module&LCD GPS based car locator - I know this functionality exists in modern cars but certainly not my 1994 feroza - a box that sits in your car that SMSs you GPS coordinates if your car alarm is activated. I've been looking for this for ages in a commercial product but the prices are outrageous. Other more outlandish projects are a CNC machine and single sided, through-hole, no (or very little) programming MP3 player Any ideas?

Posted by trialex 12 years ago  |  last reply 12 years ago


Sub-mm precision ultrasonic or inductive distance sensor for use with Raspberry Pi?

Hi there, I am trying to keep my hardware/ coding skills alive and spruce up my bicycle wheel truing stand. I need to figure out the required hardware + software for the following: I want to build a non-contact distance measurement sensor system and get the output "into" my computer for display in a graphical user interface. I know I could omit the latter step with going directly onto a mini-LCD screen, but trying to use this a learn-another-programming-language learning experience (I've coded Matlab galore, pondering Python for this project). General system components: Sensor - [something - RasPi or Arduino I guess] - laptop (running debian) - GUI displaying continuous sensor reading Sensor: I've web-searched the hell out of this, but not finding anything quite answering my questions. I want to continuously measure the distance from the sensor to a bicycle wheel rim braking surface. Material is aluminium, shiny, though not smooth. Biggest problem with the web-search is being swamped by proximity sensor results (on/off) rather than a distance proportional output signal and much lower resolution projects. I rule out IR or optical sensing, now stuck between ultrasonic and inductive sensing, though tending to the latter for a faster response/adjustment to change time. Sensor criteria (other than reasonable $$): - total sensing range: ca.5mm - sensing accuracy 10 to 100micron/ 0.01 to 0.1mm - don't ask if that's needed, a bit of overkill, I know, but a bit of OCD doesn't do any harm, eh? - fast-ish sampling rate (so that when I turn the wheel, the number on the screen updates nice and fast, guess >25Hz is sufficient). [Something - RasPi or Arduino]: I know that I could omit the laptop GUI part (mini-LCD, LED array, etc), but keen to learn/ practice a little Python with this project, so I guess I am tending to the RasPi, but I am open minded. All I want is the analogue sensor out to end up as a digital reading "inside" my computer to be passed to my GUI as a reading. Essentially a mini A2D converter. Not fussed whether the output is in actual distance units or in arbitrary units/ current units (I guess the sensors put out a proportional current signal?). GUI: Depending on the above, how do I best get the signal "into" a Python program? A moderate fast sample rate >25Hz should suffice. Any help with this would be greatly appreciated!

Asked by lasercycle 3 years ago  |  last reply 3 years ago


<5mm distance sensing, <100micron accuracy, GUI, RasPi or Arduino?

Hi there, I am trying to keep my hardware/ coding skills alive and spruce up my bicycle wheel truing stand. I need to figure out the required hardware + software for the following: I want to build a non-contact distance measurement sensor system and get the output "into" my computer for display in a graphical user interface. I know I could omit the latter step with going directly onto a mini-LCD screen, but trying to use this a learn-another-programming-language learning experience (I've coded Matlab galore, pondering Python for this project). General system components: Sensor - [something - RasPi or Arduino I guess] - laptop (running debian) - GUI displaying continuous sensor reading Sensor: I've web-searched the hell out of this, but not finding anything quite answering my questions. I want to continuously measure the distance from the sensor to a bicycle wheel rim braking surface. Material is aluminium, shiny, though not smooth. Biggest problem with the web-search is being swamped by proximity sensor results (on/off) rather than a distance proportional output signal and much lower resolution projects. I rule out IR or optical sensing, now stuck between ultrasonic and inductive sensing, though tending to the latter for a faster response/adjustment to change time. Sensor criteria (other than reasonable $$): - total sensing range: ca.5mm - sensing accuracy 10 to 100micron/ 0.01 to 0.1mm - don't ask if that's needed, a bit of overkill, I know, but a bit of OCD doesn't do any harm, eh? - fast-ish sampling rate (so that when I turn the wheel, the number on the screen updates nice and fast, guess >25Hz is sufficient). [Something - RasPi or Arduino]: I know that I could omit the laptop GUI part (mini-LCD, LED array, etc), but keen to learn/ practice a little Python with this project, so I guess I am tending to the RasPi, but I am open minded. All I want is the analogue sensor out to end up as a digital reading "inside" my computer to be passed to my GUI as a reading. Essentially a mini A2D converter. Not fussed whether the output is in actual distance units or in arbitrary units/ current units (I guess the sensors put out a proportional current signal?). GUI: Depending on the above, how do I best get the signal "into" a Python program? A moderate fast sample rate >25Hz should suffice.  Any help with this would be greatly appreciated! LaserCycle

Posted by lasercycle 3 years ago  |  last reply 1 year ago