Recently, I've been trying to make a pendulum robot with an Arduino that has a L298N and a MPU-6050. Everything was working fine when I ran each individual component like testing to make sure the IMU is properly reading or running the motors in different directions. However, when I switched my code from unit testing to the actual pendulum robot, the Arduino suddenly stopped allowing uploads. More specifically, I used almost the same exact code that I used for unit testing with the only difference being both components being ran without changing the wiring on the robot, but now it seems I'm unable to upload to my Arduino anymore after I uploaded that code. The error I get is "avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x0d
avrdude: stk500_recv(): programmer is not responding"
However, what did happen when I was testing out the board with the code was having it connected to my laptop when I flipped on the external battery which caused my laptop to suddenly turn off, but now my laptop is fine and not the Arduino. I've tried testing to see if either my laptop or the Arduino was the problem, but I used another laptop and it gave the same problem. Additionally, I then tried to use another Arduino board that was only connected to the L298N and uploaded it with the testing code, but now that Arduino no longer works even if I made sure not to turn the battery on when the laptop was connected. Currently both Arduinos do light up when connect through USB, however, pressing the reset button doesn't affect the built-in LED. Does anyone know if my Arduinos are bricked and if so, how I could prevent this from happening again?
I'm having issues directly uploading my photos but here are links to them:
We need to see a proper schematic in order to work out what you did wrong. It is almost impossible to tell from a photograph how it is wired up.
That's a link to a wiring diagram of my Arduino. So some updates that happened: The L298N module had a soldering issue on the bottom which caused a short and was replaced as so. The Arduino on the bot was replaced with a brand new one and the wiring was copied over but after uploading code and it working as intended, I became unable to upload afterwards.
It is not a schematic is it?
First off why have you no pull-up resistors on the I2C lines?
What are the brown wires that are shown being connected directly to the L298 chip?
You seem to have connected the Vin from the Arduino to the 5V of the L298 board. Why is that?
You should not be using solderless bread board to run currents of greater than about half an amp.
I'm not sure what the brown wire you are referring to is but the battery's ground wire is connected to a strip on a breadboard that also connects to the Arduino and the L298N.
It wasn't me who wired this, but the purpose of wiring the 5V of the L298 is to power the Arduino.
I'm not too familiar with the concept of pull-up resistors so I never did what you asked as it seemed to fit the guides I saw online.
Regarding your comment about using a solderless breadboard, does that still hold true when it's only the ground that's wired through it?
Any recommendations on the wiring schematic would be greatly appreciated.
Yes, currents flow through the ground just like any other connection.
Who the hell advises no pull up resistors on an Arduino output?
Link pleas to the idiot.
In the mean time check this out.
https://www.thebackshed.com/forum/uploads/BobD/2013-01-26_175209_I2C_-_Effects_of_Varying_Pullup_Resistors.pdf
You can't wire 5V to the Vin, because this will reduce the voltage that the Arduino chip is actually running at. You need at least 6 to 7V at the Vin in order to power the Uno's processor at 5V, because the Vin goes to the internal regulator.
This means that the signals on the L298 board will be higher than the voltage the Uno is running at. This is likely to have damaged your Arduino.
Do you mean actually physically wired it or designed it.
I only spotted one brown wire in the whole tangled mess. That was on my iPad, but now on my Laptop it looks grey. It comes from the middle connector on the solderless bread board. It looks like it might just be a kink in your wiggly drawing. That is the problem with what you posted, it is not actually a schematic, it is a physical layout diagram and is useless for seeing what circuit you have.
Try and post images correctly. The problem you had was probbly due to the fact that the forum doesn't allow you to post an image on your first post. Just drag your image into your reply.
I'll send clearer photos of the wiring later, but that was just something I quickly drew up to demonstrate the wiring of the robot.
Thanks for telling me this as honestly speaking, the wiring seemed fine to me but clearly I'm bad (speaking seriously). How should I go about powering the Arduino then with the 12V battery without damaging the Arduino while also powering the motors? Furthermore, how should I power the IMU while I'm doing all of this (I seen some sources recommend using the 5V port on the Arduino for power but idk how to get 5V for the IMU then).
I mean I've done Arduino projects in the past, just none with external batteries and I've never really had to use pull-up resistors.
Anyways your information is a great help!
That is because the designers of those projects are just happy if they can get it to function. That does not mean it is a good design and it does not mean they have even done a rudimentary test on the design like looking at any of the waveforms on an oscilloscope.
Now because your MPU6050 is a 3V3 device the I2C lines should be pulled up to 3V3. As it stands it is being pulled up to 5V by the internal pull up resistors on the Arduino. It is an almost universal rule in electronics that you should not have a signal going into a chip that is higher than the voltage being used to power the chip. So with a mixed voltage system like you have must find an I2C library for the Arduino that offers the option of turning off the internal pull up resistors. Failing this the immediately after the I2C begin call you should use the pin mode call to set A4 and A5 to be inputs. This will remove the input pull up resistors.
The L298 needs a 5V logic reference signal, so wire that to the 5V line of the Arduino. Next you have options of powering your Arduino from the 12V power line. You can:-
-
connect the 12V to the Vin pin or the DC barrel jack socket. The barrel jack has a series diode before it connects to the Vin pin for a bit of protection against reverse polarity and it also drops the input by 0.7V (a good thing here). The big problem with this is that the voltage regulator on the Arduino has to reduce the input, 12V to the output 5V. It does that by burning off the excess voltage and converting it to heat. This means that the regulator gets hot and could shut down or get damaged if the current is too high. The good news is that for your circuit you only have the MPU6050 being powered from the Arduino and that takes a little under 4mA so there is no current problem and while the regulator will get warm it shouldn't get too hot.
-
get the 12V down to 5V using an external regulator. Then connect the output to the 5V pin. Using a linear regulator, like the L7805 still burns off the excess power off as heat, but you have a much better heat sink in the form of the tab on the regulator, and if you want it to run cooler the just add an external heat sink. Don't forget the input and output capacitors needed on regulators like this. Alternately you can use a switching regulator, sometimes called a buck regulator. This is much more efficient at reducing the voltage and in effect swaps voltage for current with an efficiency approaching 90%. This means it draws less current that a linear regulator so your battery lasts a bit longer.
You can put the two into the same pin. Connect a wire to one then on to the other.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.