The forums are retiring and are now closed for new topics and comments. The existing content will remain online and accessible through 2020 to provide everyone the opportunity to save any relevant information. In the spring of 2021, these Community forums will be taken offline.

Search for arduino mega in Topics

Arduino - Mega or Duemlianove?

I have been thinking about getting an arduino from Adafruit Industries. They carry two - The arduino duemlianove with the Atmega328 and the more powerful Mega with atmega1280 chip. I am having difficulty choosing between the two microcontrollers. My main focus will be on larger projects like the Garduino( but again also on smaller robotics projects like advanced balancing robots(multiple accelerometers and sonar sensors)or even arduino smart drones(aircraft).Some of the factors in my descision will depend on: Price Weight Dimensions Power requirements Flash ROM Output pins Protoshield/other shield capabilities PWM control XBee wireless support Integration with logic systems Support for multiple(3) LCD screens/Dot Matrix displays Multiple Servo support Sound/Media support Please help me choosing this microcontroller.I will only buy once in maybe 4-5 years so I want it to be good buy. Also tell me which shields should I buy for my requirements: either the sound shield or the servo shield.I think I will buy the servo shield because it will give me greater control over my robotcs projects Kabir 

Question by mhkabir    |  last reply

Arduino - Mega or Duemlianove

I have been thinking about getting an arduino from Adafruit Industries. They carry two - The arduino duemlianove with the Atmega328 and the more powerful Mega with atmega1280 chip. I am having difficulty choosing between the two microcontrollers. My main focus will be on larger projects like the Garduino( but again also on smaller robotics projects like advanced balancing robots(multiple accelerometers and sonar sensors)or even arduino smart drones(aircraft).Some of the factors in my descision will depend on: Price Weight Dimensions Power requirements Flash ROM Output pins Protoshield/other shield capabilities PWM control XBee wireless support Integration with logic systems Support for multiple(3) LCD screens/Dot Matrix displays Multiple Servo support Sound/Media support Please help me choosing this microcontroller.I will only buy once in maybe 4-5 years so I want it to be good buy. Also tell me which shields should I buy for my requirements: either the sound shield or the servo shield.I think I will buy the servo shield because it will give me greater control over my robotcs projects Kabir

Topic by mhkabir    |  last reply

Arduino Mega with Sim900

Recently I bought Sim900a module and Arduino Mega 2560 to run my old code for sending sms and call, but now there is a problem as I am unable to send sms or either call, my code is attached below. #include SoftwareSerial gsm(2,3); void setup() { gsm.begin(9600); // Setting the baud rate of GSM Module Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino) delay(100); } void loop() { if (Serial.available()>0) switch( { case 's': Send(); break; case 'r': Recieve(); break; case 'S': Send(); break; case 'R': Recieve(); break; } if (gsm.available()>0) Serial.write(; } void Send() { Serial.print("Sending"); gsm.println("AT+CMGF=1"); delay(1000); gsm.println("AT+CMGS=\"+xxxxxxxxxxxx\"\r"); // Replace x with mobile number delay(1000); gsm.println("Hello I am GSM modem!!!");// The SMS text you want to send delay(100); gsm.println((char)26); // ASCII code of CTRL+Z delay(1000); } void Recieve() { Serial.print("Receiving"); gsm.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS delay(1000); }

Topic by vicky58911  

Arduino mega fried/not working?

Hey guys I was using ramps 1.4 for a CNC project of mine.When I was trying to upload a code for repatier when the ramps 1.4 was already connected to a 12v source, this forced my laptop to shutdown as well as forcing the mega to get heated up bad. Now I think the laptop ram is fried cause the display is not working and mega (even though the lights are blinking),the code cannot be uploaded

Question by chrissunny94    |  last reply

Library for Ili9341 + Arduino Mega?

Im working on a project, and I am trying to get this to work. I have one of the 2.4 inch, red tft diplays from china, but I cant get it  to work. I need help finding a library+ doing mods to the library to get it working. I have run a couple of sketches, the touchscreen works fine, its just the screen wont show anything. One sketch said it found the Ili9341 driver on it. 

Question by headslant  

I fried the arduino mega?

Ok i was using an arduino mega and ramps 1.4 motor controller for my home build cnc.During the time of testing ,there was ahuge back current and probably the mega is fried. This is the state now,when i plug the mega on to my computer : 1)The Green ON led lights up 2)device detected ,but not recognized.( tried  re installing the drivers ,but no use ) 3)Reset button does not make the L light blink. 4)RX-TX not lighting up. I want to know if this arduino can ever be used again. And for the safe use of the cnc,what micro-controller/micro-controller precautions/PLC   should be used. Can i fix this MEGA by replacing some components , i really dont want to spend more on the cnc(i have already spend around 400$ till date)

Question by chrissunny94    |  last reply

Arduino Mega 2560 timeout? Answered

I have tried uploading the simple "Blink" sketch onto a 5v Mega Pro from Spakrfun using their 5v FTDI programmer. Despite my best efforts I have kept getting this error... Binary sketch size: 1,632 bytes (of a 258,048 byte maximum) avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_ReceiveMessage(): timeout avrdude: stk500v2_getsync(): timeout communicating with programmer I have know I am using the correct COM port and I have the right board selected. I have tried to re-install the driver but to no avail. Nothing I have found online has worked.

Question by GenAap    |  last reply

Programming a Arduino mega 2560 Answered

Can someone help me program a Arduino mega 2560 with a proximity sensor so that when a car comes into a garage parking spot, the stop light will either go to yellow or red. I already have the stop light, and the Arduino board.?

Question by dansaul0413    |  last reply


I want to buy an arduino either a uno or mega which ine should i buy i want the prices of both. my focus will be on robotics projects as well as light effects

Question by robot1398    |  last reply

help on mutiple steppers on arduino mega

Hello, I am hoping to get some help for my project here. I have three steppers that would like to control using an arduino mega first question is: is this possible? in other words can i connect the wires from stepper (bi-polar and 4-wire) directly to the arduino pins? secondly, is there a sample code that i can use to make the steppers sweep independently? are there specific libraries i need to use? Regards, Behzad.

Topic by karim_bj    |  last reply

Help programming attiny85v with arduino mega?

Alright so I followed the high-low tech tutorial to the letter, however I can't program the attiny85v. I currently don't have a filter capacitor (looking for one to use in my board box), however I've read that it isn't necessary. So anyways, I hit upload ad this is what I get. avrdude: stk500_getsync(): not in sync: resp=0x00 I also tried jumping GND and reset with a wire and I get the same thing, so what's going on?

Question by XOIIO    |  last reply

r/c commuication with the arduino mega

I was wondering if anybody knows what pins have to be used on the arduino mega to get the r/c signal converted so that i can drive a store bought motor driver. I am lost  on the wire connections. Thanks for the help

Topic by mfm5024    |  last reply

Computer not recognizing arduino mega?l7805cv

Suddenly today, my computer quit recognizing my arduino mega. I have a circuit built using an L7805cv voltage regulator to power the board, while I plugged it in with usb to update the program. I have done this previously without issue, but I'm not sure if maybe having the arduino powered by this power supply and plugging it in with usb caused issues. My desktop and laptop are both running Windows 8.1, and both recognize my Uno, however neither recognize the mega. For the uno, windows beeps signifying that a USB device was plugged in, however that doesnt happen for the mega. Also, on my laptop, the mega shows up in Device manager as an Other device with a yellow exclamation, but does not show up at all in device manager on my desktop. What steps can I take? Edit: I was able to use an arduino nano as an FTDI, simply connecting the power, ground, reset, tx and rx pins between the nano and mega, and I could load sketches and view the serial monitor fine. SO is there an issue with the usb port on the mega?

Question by DELETED_MakiY2    |  last reply

2.8"TFT display on Arduino Mega

My name is Leo van Staveren from the Netherlands.I have followed the instructables to apply a 2.8"TFT display with my arduino Mega.I got the UTFT into my library files. However as a ZIP file, which my IDE asked for.After uploading the sample (step 4) of the instructable, my display remains blanc.What I noticed on my display board, was that the Rs,Wr,Cs,Rst fit the analog inputs 2,1,3,4.So I changed this in my sketch but unfortunately without result.What did I de wrong??

Question by abby1010    |  last reply

GPRS SM5100B for Ardunio Mega

This Project show how to send GPRs packet Using SM5100B  Module with Ardunio Mega you need 1- Ardunio Mega 2- GSM SM5100B 3- IP  address of server we're connecting to 4- name of the host at this IP address if you don't have IP & Host  you can use  it's  free . Referunce :

Topic by IYAD.J    |  last reply

Which Arduino should I buy?

Hello community, I had a question- which Arduino is the best? I want get get an Arduino with my birthday money and I want to know which board I can get the most bang for the buck.  If somebody could point out which Arduino board is best that would be awesome! Thanks, Oh, BTW, my budget is around 75 dollars

Topic by HavocRC    |  last reply

How to fix this Arduino error?

Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"C:\Users\3dpri\Downloads\Marlin-1.1.x (3)\Marlin-1.1.x\Marlin\Marlin.ino:45:110: fatal error: U8glib.h: No such file or directory #include // library for graphics LCD by Oli Kraus ( ^compilation terminated.exit status 1 Error compiling for board Arduino/Genuino Mega or Mega 2560.This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.This is the Arduino error I am running into. It says that U8glib library isn't installed when it obviously is because I have installed and updated it in the Arduino library manager. Why am I running into this error when I am trying to verify that the newest version of Marlin Arduino is working? How can I fix it? Thanks!

Question by nschreiber0813  

Arduino Mega WaiveShield 48 Button sampler (Advice ?)

This will be my first project, and original reason I found Arduino in the first place! I was searching for an affordable portable music machine. What has developed in my mind has become progressively bigger, but  I digress. I currently have 2 Mega 2560's, Wave Shield, and an assortment of switches, pots, and buttons robbed from "trash ?". In the mail as I type is a Beat707, QuadRam, R.C. MIDI Shield, Mux 2 Shield, 3x 555 Timers, and a  PT2399 delay. My plan of action was to beef up one mega with the quadram, waive shield, MIDI shield, and Mux 2. If this is possible, it would make a 48 Button sampler with SD card slot, MIDI in and out, and just maby 8-10 bit recording capabilities? Mean wile take the timers and delay and create a funky sounding distortion box that can be positioned anywhere in the circuit. The second Mega is dedicated to the Beat707. Question being, what do you think? I have tons of hardware experience, and soldering hours under my belt, but programming is a new one for me. Im not sure how to judge if the Mega will stand up to the challenge of the first combination, but my biggest requirement going into this, was I wanted something portable, that ran off batteries, but was not just a toy. I started calling it the pocket studio, although I doubt it will fit in a normal pocket.    

Topic by GunzoZabuza    |  last reply

Trying to use keypad with arduino mega. please help

I have a 4X4 keypad (the same one they use here: wired to my arduino mega on ports 14-21. I have a piezo on pwm8. I need a program that plays a diffrent note when each key is pressed, using keypad library here: The code on the first link is my base, I just cant get the if statments to work. please help.

Question by TheRealRocketBurns    |  last reply

Should I use Arduino mega to control a Hexapod?

I'm planning to make a Hexapod with this design Instead of using servo controller board like Linuxmotion, can I use an Arduino mega instead? I'm using this model Because Arduino is more flexible, I want to use it instead of servo board, which only have 1 function. If you can control by the Arduino mega, may I have the code? Starting from ground up is hard (I only want the move ahead and spin code, raising up and down is cool too) Another thing, can I cut the cost by changing the servo on that project? I'm using 9g instead of 12g. Because it's printed, 9g can stand, right?

Question by Shizen    |  last reply

500W electric scooter control and instrumentation with Arduino mega

1. Introduction DC 500W motor control with an Arduino mega to limit starting current and to vary the speed of the scooter. The battery is in 24V, 10A.h. The following table summarizes their characteristics: 2. Bibliography: Link download : sketch_escooter_feed_back_reel_V1.ino escooter_ampli_SIMULINK.mdl escooter feed back ISIS.DSN youtube  :  "study trotinette electric e-scooter 100W et 350W, wiring"  youtube;=75&list;=PLfZunVn_gcq7EOurXuWU2sRFmh6CbiUiL Article: «Study of electric scooters 100W and 500W (Arduino), Revue 3EI 2017» Pdf? Book «I realize my electric vehicle» at DUNOD 3. Open loop program To test the programming, we simulate the program in ISIS, as can be seen in the following figure. In addition, we have an LCD display to display data (duty cycle corresponding to the PWM at 32Khz, motor current, motor voltage, action on the pushbuttons, 4 push buttons are used. BP1 to manually increment the duty cycle, BP2 decrement it. BP3 set the duty cycle to 0, corresponding to the brake contact. The speed of the motor is practically proportional to the duty cycle We made our own current amplifier called a step-down chopper but it is possible to buy a shield There are many cards for Arduino to control DC motors especially of low powers and also of great powers as can be observed on the following links. But all these chopper shields measure the current internally but there is no current limitation. In order to have a current limitation, an analog current loop is required using specialized AOP or IC or a fast digital current loop. But what should be the value of the limitation current? The choice of the current value is normally for the 1-hour operation service in order to be able to carry out relatively long climbs without reaching the critical temperature of the engine. In our case, the limitation current must be Limiting motor = Power / Upper battery = 500W / 24V = 20A In addition, the power transistor of the chopper can only support 50A in our case. But in open loop, it has no current regulation, so as not to exceed the maximum current, a ramp of the duty cycle will be used. A 0.1 second interruption routine will be used to measure the voltage of the current (sample measurement, sample). This sampling time is arbitrary but does not allow to be faster than the rise time of the current because the electric time constant of the motor is L / R = 1.5 ms. Open loop operation with a 25.5s (8bit) ramp and 0.1s interrupt routine provides a good understanding of the operation of a DC motor drive. The display will only be done every 0.2s to have a stability of the digits on the screen. In addition, a digital filtering will be done on the current and the voltage on 4 values therefore on 0.4s. [b] Algo open loop [/b] Interrupt Routine All 0.1S Read voltage and current Loop loop (push button scan) If BP1 = 1 then increment PWM If BP2 = 1 then decrement PWM If BP3 = 1 then PWM = 0 Displaying variables every 0.2s Code: [Select] // include the library code: #include #include #include #define SERIAL_PORT_LOG_ENABLE 1 #define Led     13       // 13 for the yellow led on the map #define BP1     30       // 30 BP1 #define BP2     31       // 31 BP2           #define BP3     32       // 32 BP3 #define LEDV    33       // 33 led #define LEDJ    34       // 34 led #define LEDR    35       // 35 led #define relay   36       // 36 relay #define PWM10    10      //11   timer2    LiquidCrystal lcd(27, 28, 25, 24, 23, 22); // RS=12, Enable=11, D4=5, D5=4, D6= 3, D7=2, BPpoussoir=26 // Configuring variables unsigned   int UmoteurF = 0;  // variable to store the value coming from the sensor unsigned   int Umoteur = 0; unsigned   int Umoteur2 = 0; unsigned   int Umoteur3 = 0; unsigned   int Umoteur4 = 0; unsigned   int ImoteurF = 0;  unsigned   int Imoteur = 0; unsigned   int Imoteur2 = 0; unsigned   int Imoteur3 = 0; unsigned   int Imoteur4 = 0;            byte Rcy=0 ;    // 8bit duty cycle unsigned    int temps; // the setup function runs once when you press reset or power the board void setup() {   pinMode(Led, OUTPUT);   // Arduino card   pinMode(LEDV, OUTPUT);   pinMode(LEDR, OUTPUT);   pinMode(LEDJ, OUTPUT);   pinMode (PWM10,OUTPUT);     // Pin (10) output timer2   //  digitalWrite(LEDV,LOW);   Timer1.initialize(100000);         // initialize timer1, and set a 0,1 second period =>  100 000   Timer1.attachInterrupt(callback);  // attaches callback() as a timer overflow interrupt   lcd.begin(20, 4);    Serial1.begin(9600);   TCCR2B = (TCCR2B & 0b11111000) | 0x01;         //pin 10  32khz                                                   //   //   analogWriteResolution(bits) lcd.setCursor(0,1); lcd.print("Rcy"); lcd.setCursor(10,1); lcd.print("Um"); lcd.setCursor(5,1); lcd.print("Im"); lcd.setCursor(10,1); lcd.print("Um"); lcd.setCursor(20,1); // 4 lines display * 20 characters lcd.print("BP1+"); lcd.setCursor(25,1); lcd.print("BP2-"); lcd.setCursor(29,1); lcd.print("BP3=0"); } // Interruptions  tous les 0.1s void callback()  { temps++; //toogle state ledv for check   if ( digitalRead(LEDV)== 1 ) {digitalWrite(LEDV,LOW);}     else {digitalWrite(LEDV,HIGH);}     analogWrite(PWM10,Rcy);   // frequency Umoteur=analogRead(A0); Imoteur=analogRead(A1); Imoteur2=Imoteur; Imoteur3=Imoteur2; Imoteur4=Imoteur3; ImoteurF=(Imoteur4+Imoteur3+Imoteur2+Imoteur)/4 ; Umoteur2=Umoteur; Umoteur3=Umoteur2; Umoteur4=Umoteur3; UmoteurF=(Umoteur4+Umoteur3+Umoteur2+Umoteur)/4 ;   }// End routine // Loop corresponding to main function void loop() {    // BP + LED   if ((digitalRead(BP1))==1) {     lcd.setCursor(20,0);      // Column line     lcd.print("BP1");     digitalWrite(LEDR, LOW);        digitalWrite(LEDJ, LOW);     Rcy++;                        // PWM incrementation     if ( Rcy>254)  {Rcy=254;}     delay(100);               //8bits * 100ms = 25S increment 25ssecond slope     }        if ((digitalRead(BP2))==1) {     lcd.setCursor(20,0);     lcd.print("BP2");             Rcy--;      if ( Rcy<2)  {Rcy=2;}  // PWM almost at 0, engine stop         delay(100);      digitalWrite(LEDR, HIGH);     digitalWrite(LEDJ, HIGH);     }   if ((digitalRead(BP3))==1) {     lcd.setCursor(20,0);     lcd.print("BP3");      Rcy=2;               // PWM almost at 0, engine stop     } if (temps>=2)  { lcd.setCursor(0,0); lcd.print("                "); // Erase line lcd.setCursor(0,0);     lcd.print(Rcy); lcd.setCursor(5,0); ImoteurF=(ImoteurF)/20;     //resistance (5/1024)*(10/0.25ohm) si ACS712 66mV/A                            // For resistance 1ohm (ImoteurF) / 20; Simulation 5/25 lcd.print(ImoteurF); lcd.setCursor(10,0); UmoteurF=UmoteurF*10/38;                              //10/38   10/30 simula if (Umoteur>ImoteurF){UmoteurF=UmoteurF-ImoteurF;  }  //U-R*I lcd.print(UmoteurF); temps=0; }// End if time    } // End loop Since there is a limit of 9000 characters in the forum below Open loop program feature previous The interrupt routine lasts only 250 microseconds, the loop of the main program which scans the action of push buttons is 13micros and the display time of all data is 11ms. Thus, it is possible to improve the sampling period and thus the speed of the regulation of the current. The Arduino makes it possible to make the instrumentation of the scooter so to know the power, the consumption in Ah and Wh, to measure the speed, to know the consumption according to Wh / km, to measure the temperature of the engine, Have a safe operation. But for now we will see how to limit the current 4. Closed loop program, limited current control The sampling period will increase to 0.01 seconds (interrupt routine) If the current is less than the desired value, then the duty cycle can be increased or decreased to the desired value which is the setpoint. On the other hand, if the motor current is greater than the limiting value, there is a rapid decrease in the duty cycle. So as not to exceed the value of the duty cycle if it is saturated to 254 maximum and to the minimum value 6. Code: [Select] if (Imoteur<4000)                    // No current limitation at (20A * 10) * 20 = 4000   {if (consigne>Rcy)   {Rcy=Rcy+1;}   // Pwm ramp + 1 * 0.01second pure integrator    if (consigne    if ( Rcy>254)  {Rcy=254;}           // Limitation of duty cycle    analogWrite(PWM10,Rcy);   // Frequency 32kHz timer2}         } if (Imoteur>4000)  { Rcy=Rcy-5;              // No current filtering, to be faster                     if ( Rcy<6)  {Rcy=5;}       // Rcy is not signed, nor the PWM therefore Rcy minimum must not be less than 6                   analogWrite(PWM10,Rcy);   // Frequency 32kHz timer2}                        } 5. Closed Loop Program, Limited Current Control with Acceleration Handle An acceleration handle provides a 0.8V voltage when not operated and a 4.5V voltage when the handle is fully engaged. Instead of using pushbuttons to increase or decrease the speed setpoint, an acceleration handle will be used Code: [Select] Upoignee=analogRead(A3); // The relation in Upoign and the setpoint which corresponds to the duty cycle corresponds to if (Upoignee>100) { consigne=(Upoignee/2);     //0=a*200+b    et 255=a*800+b                      consigne= consigne-100;                   }                            else { consigne=0;   }               if (Upoignee<100) { consigne=0;  }     // redundancy     6. Temperature and safety program of the motor with the current measurement The outdoor temperature measurement can be easily performed by the LM35 component which charges 0.01V by degrees Celsius Code: [Select] temperature=analogRead(A2); //lm35 0.01V/°C temperature=temperature/2;       // Temperature coefficient lcd.setCursor(5,2); lcd.print("      "); lcd.setCursor(5,2); lcd.print(temperature);   // Display in ° C lcd.setCursor(9,2);      // Erasing secu display lcd.print("     ");   if (temperature>80 ) {lcd.setCursor(9,2);         // If motor external temperature is above 80 ° C                      lcd.print("secuT");                       Rcy=0;} In addition, thermal safety by measuring the motor current will be added. If the limitation current is greater than 10s then the motor will no longer be powered for 30s. A "secu" display will appear on the LCD display. This safety makes it possible to cut the motor on slope too high and when blocking the engine but it would be necessary to add the measurement of the speed in the latter case Code: [Select] if (timesecurite>=10000 ) {flagarret=1;      // If limitation current for a current of more than 10s                               timerepos=0;                               consigne=0;                               Rcy=0;                                 timesecurite=0;}       //   Then stop engine during a downtime    if (flagarret==1 ) {lcd.setCursor(9,2);         // If limiting current for a current of more than 20s                      lcd.print("secU");  }     //   Then stopping the motor for a stop time and display                                                     if (timerepos>=30000 &&  flagarret==1) {flagarret=0;                                           lcd.setCursor(9,2);      // After a rest time here of 30s                                            lcd.print("       ");   }   The display can be observed if the temperature is above 80 ° C Thermal safety by measuring the motor current (digital thermal relay) which allows to know the image of the internal temperature of the engine would be ideal. But for this, it is necessary to know well the thermal modeling of the motor. 7. Measurement of the energy capacity of the battery The energy capacity of a battery is in A.H, we will display the value in mA.H to have a high accuracy. The capacity will be in A.Second in the following equation. So to have in mA.H, it will be divided by capacity by3600. Capacity (A.s) n = I * Te + Cn-1 with Te = 0.01s and I multiplied by 10 So in the interrupt routine Code: [Select] capacity=ImoteurF+capacity ; And in the display Code: [Select] lcd.setCursor(0,3); // Display of energy capacity lcd.print("C mA.h="); capacity1=capacity/(18000);   //18000=3600*5  5=> Current measurement coefficient lcd.print(capacity1); To check a current of 10A with an adjustable resistor and after 30s, the capacity must be 83mA.H 8. Power and modeling with SIMULINK Modeling helps to understand the vehicle and its control. In addition, it is possible to compile the control part directly into the Arduino program from simulation under Simulink. But it will not be possible to simulate the instrumentation with the LCD display. In the following figure, we can observe the simulation of the programming of the chopper with the current limitation with Simulink. In the following figure, the green box shows the duty cycle control to vary the speed and the red border the current limitation. The controller of the control is here a simple integrator but it is possible to carry out a multitude of control. In the previous figure, it can be observed that the current is well limited to 25A from 2s to 9.5s. Then, the current reaches 10.8A under established speed regime at 22.5km / h. The dynamics are similar to the tests carried out. With a slope of 5%, the cyclic ratio reaches only 100% as can be seen in the following figure. The speed will reach painfully 19km / h with a current of 24A and a motor power of 580W. See article: Study of electric scooters 100W and 500W (Arduino), 9. First conclusion It is easy to control a 500W DC motor with an Arduino and some components So repair many scooters that are in DC motors. But it takes some knowledge (automatic, engine) to know how to properly manage the engine and limit its current so as not to damage it The display of the speed, the distance, the operating time to know the / km can also be realized with a menu 2. The .ino program as an attached file, But it is not possible to put an attached file in ISIS electronic labcenter? What is this forum? It would be desirable that the compiler could generate the.cof to debug in Isis and test the program line by line .... Arduino still has to make a lot of effort to be on the same level as other microcontrollers 10. speed measurement (tachometer) Velocity measurement is carried out using a hall effect sensor SS495 or A1324 which counts each revolution of the wheel. It is enough to enter the perimeter of the wheel of the scooter (130mm of radius therefore 0.816m in the case To have the speed, it is enough just to divide the number of turn of wheel on an arbitrary time of 1s to have a minimum speed of 0.81m / s therefore of 2.93 km / h. In addition, an average filter with 3 values will be used to display the speed. At 25km / h, there will be 8.5 laps. To count the turns, an external interrupt routine will be used on input INT0 21 of the mega card. To simulate the speed, a pulse on input 21 will be used with a duty cycle of 10%. Code: [Select] void INT0b21() {   Tspeed++;   // External interruption to count the number of turns } // In the set up declare the interrupt routine when the 5V edge of the magnet detection is done   attachInterrupt(digitalPinToInterrupt(21), INT0b21, RISING );  // External interruption // In loop if (temps09>=5)  {        // 1 second loop lcd.setCursor(13,2);      // Erasing speed lcd.print("kph     "); lcd.setCursor(16,2); speed1=Tspeed*2937;      //1tour*816*3.6/1s=2.937km/h speed2=speed1;           //Tspeed (rate/seconde) speed3=speed2; speedF=(speed1+speed2+speed3)/3000;   // To put in kph lcd.print(speedF,1);    // Display to the nearest tenth Tspeed=0;   // Reset counter temps09=0;  //reset time } To improve the accuracy of the velocity measurement, it is possible that the sampling time of the velocity measurement is dependent on the velocity. For example: For speeds less than 10km / h sample at 1second, but above 10km / h sample at 2 seconds. 11. Distance measurement for autonomy The distance corresponds to the total number of turns of the wheel multiplied by the perimeter of the wheel. So do not set the number of turns to 0 for each sample. On the other hand, the reset of the distance will be done when pressing the reset of the Arduino Mega. The distance display will be displayed to the nearest second. At 32km / h, it will take 2 minutes to do 1km as can be seen in the following figure: Code: [Select] void INT0b21() {   Tspeed++;   // External interruption to count speed   nbrRate++; } lcd.setCursor(13,4);      lcd.print("km      ");  // distance=(nbrRate*816)/1000;  //distance m distance=distance/1000;  //distance km lcd.setCursor(15,4);      lcd.print(distance,1);  You can observe the electrical installation with the chopper, the arduino, and the display when the program is set up 12. Synthesis The RAM space is used only at 4% and ROM space at 3%, for an Arduino mega. So we could take an arduino a little smaller. But, there are 8 Lipo cells to make the 24V power supply to power the engine via the chopper. Therefore, the voltage measurement of each element will be on the Arduino with a JST connector. This measurement makes it possible to know if a cell with an internal resistance which begins to pose a problem and to know if the balancing of each cell has indeed been carried out. It is possible to switch to 36V with 12 cells also with the arduino mega without using an external shield that multiplex 24 analog inputs on input A0 It is possible to send all data to a smartphone via Bluetooth HC06 via pins 20, 21, RX1 and TX1. But the application under android realized under JAVA Studio can not be shared on this forum. This part will not be explained. After having made the instrumentation of this scooter, a study should be carried out on the precision of the measurements, it is possible to read "Instrumentation of a low-power electrical motor vehicle" eco marathon "type Revue 3EI N ° 81, July 2015

Topic by Iutgeiisoissons  

Usb keyboard as lots of switches for arduino? Answered

I was just wondering if anybody here knows what would have to be done to use a usb keyboard with the arduino mega ADK to control the outputs of the mega basically a big keypad

Question by FarmerKJS    |  last reply

Arduino eeprom&water flow?

Hello friendsanyone can help me how to save water flow meter in arduino mega eeprom

Question by ahmedhodhod  

Why the stipulation of using the Arduino IDE, and not the Arduino hardware?

I see that the new Arduino contest rules stipulate that your project must use the Arduino IDE. I was actually thinking of making a cool new Instructable using an Arduino Mega, but using avr-gcc instead of the Arduino "framework". Would that be permissible for entry into this contest?

Topic by matthewbeckler    |  last reply

Arduino bluetooth control

So, I've been on a project where i am trying to use a generic bluetooth gamepad to control dc motors through a HC05 bluetooth module connected to an arduino. I have no idea on where to start. I did some research about it but there dosent seem to be much information thats appropriate for this project. here is what im using now: -ipega bluetooth controller -arduino mega 2560 -HC-05 bluetooth module

Topic by thomasmanman    |  last reply

Arduino wifi sniffer

Is it possible to connect an Arduino Ethernet Shield R3 (official) to a wifi router then connect to a different router though the first router? I want to do this so I can make a robot that when it finds a known network it connects to it then dumps the data from the sd to an online server. Can anyone help me with this? I have an Arduino Uno R3 (official) and an Arduino Mega 2568 (clone).

Question by tzq33tdq    |  last reply

can you use the microcontroller of the arduino mega in the decimilla or Duemilanove? Answered

I havnt had a chance to see the microcontroller for the mega but im pretty sure its the same size and pin number of the decimilla and Duemilanove

Question by helloworld1    |  last reply

How to use PC keyboard input with Arduino Mega 2560?

I wanted to read in input from the keyboard of my computer so that the motor connected to my arduino reacts a certain way when I press a certain button. How would I read in something like numbers or letters being typed in on the keyboard. Is there something like "cin<< ;" like there is in other C++ software? For example if the number "1" is pressed then my motor will turn on and if a "2" is pressed then it will turn off.   

Question by Science102    |  last reply

how to use 6V 1.3A battery with my arduino mega?

I am making a line follower robot.i am using my 6V battery for my motors which can provide 1.3 A current...i have to use another battery which can provide less current for my arduino.some people told me that if I connect my arduino with that 6V 1.3A battery it will damage my there any way to use that battery with my arduino?

Question by TanvirM1    |  last reply

did I destroy my arduino mega and ramps 1.4?

I was using an arduino mega and ramps 1.4 motor controller for my 3d printer.During the time of testing ,i switched the power polarities in the ramps 1.4 , then I put 12V in the arduino then the mega chip got hot. This is the state now,when i plug the mega on to my computer : 1)The red ON led lights up and the L lights up. 2)device not detected. 3)Reset button does not make any change. 4)RX-TX  lighting up. when i plug the 12 in the ramps: 1) the red ON led lights up, the green doesn't I want to know if this arduino and the ramps 1.4 can ever be used again. please help!! thanks in advance!!

Question by joee1    |  last reply

Hola, Necesito ayuda con arduino mega master y slave arduino leonardo

Hola amigos! tengo una placa usb con controlador atmega 32u4 que perdio el bootloader (error de novato) y me prestaron un arduino mega 2560 para reprogramar el arduino chino que el ide lo conecta como un arduino leonardo, pero nunca usé un arduino master para reprogramar otro, no sé que pines tengo que conectar ( no tengo protoboard solo jumpers) adjunto fotos, si me pueden ayudar se los agradecería.

Question by Agl3dz77    |  last reply

Newbe + Arduino Mega via codevision + AD9850 = Guidance needed?

Hello,Im very new to 'C' and codevision and have set myself a task to get a AD9850 module working. But there are two things in my way and they are understanding datasheets and writing C code. So first question would anyone help guide me through writing the necessary drivers? or is anyone aware of a web page with the necessary information. I have had the AD9850 working in the Arduino using 3rd party library. I would like to learn how to do this myself (with guidance) but I am a (young) family man with limited time to spend on myself, hence the call for guidance. I was thinking of using the SPI port to send the serial data out, tho this is different to how the arduino boys wire the module up. I know this isn't much information to go on but I am leaving up to you to ask me questions as to not make this intro too long and boring. Last thing is I am planing to post my experience on learning C using the arduino mega on the big bad web so the information might be useful to other newbies or add it to other someone else's site. Many thanks in advance.

Question by DELETED_MakiY2    |  last reply

Timer,Temprature & Humidity Based Relay Switching with Arduino Mega.? Answered

I am making a Climate Controler for my Green House. Please help me about Arduino code for Four Relay operation. relay1 will be high when Temp will rise higher then Temprature value defined and will low when reach under defined value. relay2 will be high when Humidity will rise higher then Humidity value defined and will low when reach under defined value  relay3 will be high for 10 Minutes in every 120 Minutes. relay4 will be high for 10 Minutes in every 120 Minutes.  I am Using DHT11 sensor with Mega2560 Board. Currently using this code. Its working for Temp & Humidty based Relay operation only. Need to add two relay with Timer based operation. System needs to check Humidity and Temprature value in every 10 minutes. Please Help.  I am very new for Arduino and making this for my personal use. #include #include #include /*-----( Declare objects )-----*/ // set the LCD address to 0x27 for a 20 chars 4 line display // Set the pins on the I2C chip used for LCD connections: //                    addr, en,rw,rs,d4,d5,d6,d7,bl,blpol LiquidCrystal lcd(20, 19, 18, 17, 16, 15); // Set the LCD I2C address dht11 DHT11; /*-----( Declare Constants, Pin Numbers )-----*/ #define DHT11PIN 22 #define RELAY1  6                        #define RELAY2  7                        #define RELAY3  4                        #define RELAY4  5 #define TempTarget 30 #define HUMTarget 50 void setup()   /*----( SETUP: RUNS ONCE )----*/ {   Serial.begin(9600); //(Remove all 'Serial' commands if not needed)   lcd.begin(20,2);         // initialize the lcd for 20 chars 4 lines, turn on backlight     // Print a message to the LCD.   //lcd.setCursor(0, 1);   lcd.print("SHOURYA's GARDEN");   // Initialise the Arduino data pins for OUTPUT   pinMode(RELAY1, OUTPUT);         pinMode(RELAY2, OUTPUT);   pinMode(RELAY3, OUTPUT);   pinMode(RELAY4, OUTPUT);   }/*--(end setup )---*/ void loop()   /*----( LOOP: RUNS CONSTANTLY )----*/ {   int chk =;   Serial.print   ("GARDEN DATA SENSING ");   switch (chk)   {     case 0: Serial.println(" OK"); break;     case -1: Serial.println("Checksum error"); break;     case -2: Serial.println("Time out error"); break;     default: Serial.println("Unknown error"); break;   }   lcd.setCursor(0, 1);   lcd.print("TempC=");   lcd.print((float)DHT11.temperature, 0);   Serial.print("Temperature (oC): ");   Serial.println((float)DHT11.temperature, 2);   //lcd.print(" F=");   //lcd.print(Fahrenheit(DHT11.temperature), 0);   //Serial.print("Temperature (oF): ");   //Serial.println(Fahrenheit(DHT11.temperature), 2);     lcd.print(" Hum=");   lcd.print((float)DHT11.humidity, 0);   lcd.print("%");   Serial.print("Humid(%): ");   Serial.println((float)DHT11.humidity, 2);    //Serial.print("Temperature (K): ");   //Serial.println(Kelvin(DHT11.temperature), 2);   //Serial.print("Dew Point (oC): ");   //Serial.println(dewPoint(DHT11.temperature, DHT11.humidity));   //Serial.print("Dew PointFast (oC): ");   //Serial.println(dewPointFast(DHT11.temperature, DHT11.humidity));        if (DHT11.temperature > TempTarget)       { Serial.println("Turning on Exaust Fan"); //lcd.print("Turning on Exaust Fan"); digitalWrite (RELAY1, HIGH); delay(1000);     }      if (DHT11.temperature < TempTarget)     { Serial.println("Turning Off Exaust Fan"); //lcd.print("Turning off Exaust Fan"); digitalWrite (RELAY1, LOW); delay(1000);     }       if (DHT11.humidity < HUMTarget)     { Serial.println("Turning on HUMIDIFIER"); //lcd.print("Turning on HUMIDIFIER"); digitalWrite (RELAY2, HIGH); delay(1000);     }      if (DHT11.humidity > HUMTarget)     { Serial.println("Turning Off HUMIDIFIER"); //lcd.print("Turning off HUMIDIFIER"); digitalWrite (RELAY2, LOW); delay(1000);     }       digitalWrite(RELAY3,HIGH);           // Turns ON Relays 3    digitalWrite(RELAY4,HIGH);           // Turns ON Relays 4    delay(10*1000);     digitalWrite(RELAY3,LOW);          // Turns Relay Off    digitalWrite(RELAY4,LOW);          // Turns Relay Off   }/* --(end main loop )-- */ /*-----( Declare User-written Functions )-----*/ // //Celsius to Fahrenheit conversion double Fahrenheit(double celsius) {         return 1.8 * celsius + 32; } //Celsius to Kelvin conversion double Kelvin(double celsius) {         return celsius + 273.15; } // dewPoint function NOAA // reference: double dewPoint(double celsius, double humidity) {         double A0= 373.15/(273.15 + celsius);         double SUM = -7.90298 * (A0-1);         SUM += 5.02808 * log10(A0);         SUM += -1.3816e-7 * (pow(10, (11.344*(1-1/A0)))-1) ;         SUM += 8.1328e-3 * (pow(10,(-3.49149*(A0-1)))-1) ;         SUM += log10(1013.246);         double VP = pow(10, SUM-3) * humidity;         double T = log(VP/0.61078);   // temp var         return (241.88 * T) / (17.558-T); } // delta max = 0.6544 wrt dewPoint() // 5x faster than dewPoint() // reference: double dewPointFast(double celsius, double humidity) {         double a = 17.271;         double b = 237.7;         double temp = (a * celsius) / (b + celsius) + log(humidity/100);         double Td = (b * temp) / (a - temp);         return Td; } /* ( THE END ) */

Question by achauhan13    |  last reply

Arduino What to buy and how?

Hi,  im really intrested in the what arduino can do can someone advise me on what board to buy (im thinking of geting a arduino mega) And how do i program it and upload it thanks :)

Question by Daniel Deacon    |  last reply

how can I connect my ramps 1.4 and arduino mega to my Laptop?

Hello guys. I need to ask you on how to connect my ramps 1.4 &arduino mega to my laptop, because in the first time I fried my arduino and my ramps 1.4. can I plug the power to my arduino from my laptop and my ramps to the power supply  simultaneously?

Question by joee1    |  last reply

Control steppers with arduino or raspberry pi?

We have this robotic arm at our school that is broken and we are trying to make it work. The motors are shot and we have no idea were the controller went. We are just going to put stepper motors instead. The problem is we have no idea how to control the motors. So my question is: How can you control 6 stepper motors individually using an arduino uno, arduino mega, or raspberry pi?

Question by JohnM703    |  last reply

How to know if Arduino is working?

I bought the RAMPS and Arduino Mega 2560 and 5 stepper drivers. I plugged in everything to the pc and everything was working perfectly. I installed all my arduino drivers easily. Then at my friends place when I plugged the psu to the mains and turned everything on, 1 of the stepper drivers started smoking from the chip attached to it and got fried. I think it was  due to too much voltage. After a while removing the burnt driver when I connected my Arduino to the pc, the pc does not find its hardware. Only this 1 light stays on and nothing happens. I don't see that there is any physical damage to the board.. but there might be .. I am not sure what to do now.. I want to know if I can check wether the board is still working and how can I connect it to the pc?

Question by SowmenD    |  last reply

Connecting 12 Servo to Arduino

Hi all, I am building a spider-bot using an Arduino and 12 servos (at finish it will be 18 I am waiting for the Arduino mega to arrive) do I need to set something in my Arduino so it will be able to control so many servos?it seems that if I try to connect more then 2 it goes nuts. Thank you.?

Question by YotamB    |  last reply

HELP....Flysky with arduino

Hello, Basically i am making a robot for a competition called "robowars". I want to control the robot with the transmitter i.e. the flysky transmitter, like if i want a rotating disc to cut someone, or a hammer, etc i will have to control it with the transmitter right and i want to use the arduino for this, for example, to change the speed of the disc or change the speed of thee robot itself.I want to read the stick values and assign them for different tasks. My robot is about 15 kg, so i need a high power battery to run it, . I guess i can use a BEC for this....i just need help in reading the stick values from the transmitter.Please help in the hardware and software. I am using an ARDUINO MEGA 2560. I am totally new to robotics and have no experience so[b] please [/b]help. I need the code and the connections. Thanks in advance

Topic by vkarpuram    |  last reply

how can i control 6 motors with arduino Mega using PWM?

I have arduino mega and 6 motor of 7.4 V each . i want to create a drone so i want to control each motor . can anyone of you tell me the circuit or may be any Arduino shield that i can use.

Question by FaheemK1    |  last reply

Can I use an arduino mega and a R.A.M.P.S. board to run a CNC machine? Answered

Right now, I`m planning to use an arduino duemilanove, and 3 EasyDriver Stepper Motor Drivers. RAMPS board: EasyDriver Board:

Question by Stuffses    |  last reply

Which arduino borad to buy?

Http:// Hello! And i am interested in starting arduino! But i am not familiar with the hardware spec of arduino boards. I have some electronics and programming bg as an physics student. I read the above tutorial, the led matrix looks like a easy/cool starter project. However, i have a question, For 4 by 4 matrix, it need 4 outputs and 4 grounds. With 14 i/o pins on an arduino uno (0to13), is 7 by 7 the maximum for upscaling this design without multiplexing? Or if i can get a "shield" that add more pins to the uno? Should i just get a arduino mega with 54 I/O pins? Since it is not that expensive, Is the tutorial compatible with a mega? Actually my target build is two 15 by 15 matrix displaying identical image. Can i rig up two identical led matrix, connect both in parallel to the same board? Thank you in advance! for your replies!!

Topic by mchau2    |  last reply

sutable title?? Answered

What will be a sutaible title for a arduino flashing sos

Question by robot1398    |  last reply

How do i wiring my Cyber Glove (Arduino Mega + Flex Sensors + Bluetooth + Gyroscope) ?

Hi guys! I need  a help on wiring for my Cyber Glove and i'll be using  1) Arduino Mega 2) Bluetooth Module (Cytron) & Bluetooth Shield (Cytron) 3) 2 Flex Sensors 4) 3 Gyroscope Can anyone help me on the wiring by showing the schematic and etc.  Thanks :)

Question by naqibzainudin    |  last reply

Controling 10 RGB LEDS with an arduino.

Hi, I had an idea to build a mood light colum of 10 rgb leds. I have established that each rgb led needs 3 digital pins on the arduino. one program I would like it to do would be to respond to sounds around it. I have this one covered programming wise but i am struggling to work out how to program the mood light settign where each led scrolls through the colour spectrum. Any ideas? thanks, Joe, 16, England

Question by joearkay    |  last reply

firgelli L12 -I with adafruit motor shield v2 + arduino mega 2560...not sure how to run it!!

Hello, I am trying to turn on and control a Firgelli L12 -I actuator using a Adafruit Motor Shield connected on top of a Ardunio Mega 2560. I connect the red/black/white set of wires from the actuator to the set of pins labeled as servo (there are two sets of three pins labeled as servo 1 and servo 2). There are no examples I could find for Servo control using Adafruit on top an Arduino!! Could someone please elaborate on this a bit, so I can find the right connections from firgelli to the Shield, How would I connect it if I do not have the Shield, and then what code should I use? Many Thanks, Karim.

Topic by behzadjk    |  last reply

What do you want in an arduino?

Inspired by the Illuminato Arduino clone (can't really say clone because it's so much better!) really wants me to create my own Arduino clone. I've been thinking of making a clone for the Arduino Mega, but it'd need so feature that the original Arduino can't offer (like the boarduino is breadboard compatible, Sanguino has way more pins, Illuminato is the most beautiful PCB I've ever seen and has a lot of I/O's). So, I'm asking you guys! What features would you want in an arduino? If this "new" arduino is so much better than any other existing one I'll make kits (if the majority is through hole) for people to buy (no more than 40 dollars, probably, the 65 dollar price tag is a real turn off for the Mega) or just assembled if the majority is smd. Also instructable :P

Topic by guyfrom7up  

I want to make a line follower using arduino mega, motor shield, 2pcs of tracker sensor (3pins) and 2pcs of dc motor but i do not know how to code with this motor shield. Can anyone help me?

I want to make a line follower using arduino mega, motor shield, 2pcs of tracker sensor (3pins) and 2pcs of dc motor but i do not know how to code with this motor shield. Can anyone help me?

Question by CarlC78    |  last reply

Arduino Coding help? Answered

I need some guidance on how to write some Arduino code. The physical side is an Arduino mega ADK connected to some buttons and leds. On the code side, I modified the button sketch. I am stuck on how to add multiple buttons. in the void loop. I just need someont to show me how to add 1 after that i can figure out how to add the rest. Thanks,  Kaden const int button1 = 24;     // the number of the pushbutton pin const int button2 = 25; const int button3 = 26; const int button4 = 27; const int button5 = 28; const int Bucket1 = 2; const int Bucket2 = 3; const int Bucket3 = 4; const int Bucket4 = 5; const int Bucket5 = 6; const int Bucket6 = 7; const int Bucket7 = 8; const int Bucket8 = 9; const int Bucket9 = 10; const int Bucket10 = 11; const int Bucket11 = 12; const int Bucket12 = 13; int buttonState1 = 0;         // variable for reading the pushbutton status int buttonState2 = 0; int buttonState3 = 0; int buttonState4 = 0; int buttonState5 = 0; void setup() {   // initialize the LED pin as an output:   pinMode(Bucket1, OUTPUT);   // declare LED strip pin as output   pinMode(Bucket2, OUTPUT);   pinMode(Bucket3, OUTPUT);   pinMode(Bucket4, OUTPUT);   pinMode(Bucket5, OUTPUT);   pinMode(Bucket6, OUTPUT);   pinMode(Bucket7, OUTPUT);   pinMode(Bucket8, OUTPUT);   pinMode(Bucket9, OUTPUT);   pinMode(Bucket10, OUTPUT);   pinMode(Bucket11, OUTPUT);   pinMode(Bucket12, OUTPUT);   // initialize the pushbutton pin as an input:   pinMode(button1, INPUT);   pinMode(button2, INPUT);   pinMode(button3, INPUT);   pinMode(button4, INPUT);   pinMode(button5, INPUT); } void loop() {     buttonState1 = digitalRead(button1);   buttonState2 = digitalRead(button2);   buttonState3 = digitalRead(button3);   buttonState4 = digitalRead(button4);   buttonState5 = digitalRead(button5);   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState1 == HIGH) {     // turn LED on:   digitalWrite(Bucket1, HIGH);  // turn LED strip on when button is pressed   digitalWrite(Bucket2, HIGH);   digitalWrite(Bucket3, HIGH);   digitalWrite(Bucket4, HIGH);   digitalWrite(Bucket5, HIGH);   digitalWrite(Bucket6, HIGH);   digitalWrite(Bucket7, HIGH);   digitalWrite(Bucket8, HIGH);   digitalWrite(Bucket9, HIGH);   digitalWrite(Bucket10, HIGH);   digitalWrite(Bucket11, HIGH);   digitalWrite(Bucket12, HIGH);   }   else {     // turn LED off:   digitalWrite(Bucket1, LOW);  // turn LED strip on when button is pressed   digitalWrite(Bucket2, LOW);   digitalWrite(Bucket3, LOW);   digitalWrite(Bucket4, LOW);   digitalWrite(Bucket5, LOW);   digitalWrite(Bucket6, LOW);   digitalWrite(Bucket7, LOW);   digitalWrite(Bucket8, LOW);   digitalWrite(Bucket9, LOW);   digitalWrite(Bucket10, LOW);   digitalWrite(Bucket11, LOW);   digitalWrite(Bucket12, LOW);   } }

Question by FarmerKJS    |  last reply

pls help

Last day I bought a 3.5 inch touchscreen from amazon it was written in the description that it was compatible with arduino uno which I currently have but when the screen arrived it was only compatible with arduino mega and I couldnt return. Is there any thing I can do with the screen to work with uno or should I have to buy an arduino mega 

Topic by 2illickans    |  last reply