Hey guys, I'm fairly new to the Arduino Uno world, and I'm really not sure what's happening, or how this error happens. So what happens is when both the Ground pin and the 5V pin is connected, it looks like it shorts circuits or something as the lights start to flicker. Attached to this are pictures of my circuit and the circuit that i am doing is the Student kit, Sports robot. Sorry if its poorly worded, my English isn't very good and thanks for helping.
(btw in the pictures the yellow wire on the 5V pin should be connected to the positive side of the breadboard, i just don't have it connected to it because I'm afraid that it could short circuit and break)
Assuming you are consistently following the convention of the red wire being positive and the black wire being ground, look closely at the following excerpt from one of your pictures. If you don't see it, look closer.
You'll be back, I predict. You should not power your servo from the 5V of the Arduino - you will be very likely to damage the Arduino, but even if you don't the Arduino will quite likely malfunction. Find/buy a 5V power supply to power the servo, and tie the grounds/negatives of the Arduino and external supply together.
Welcome
Nice start, here are a few tips that can save you $$$. Gil's Crispy Critter
Gil's Crispy Critter Rules for Processor Hardware:
Rule #1: An Arduino is NOT a Power Supply!
Rule #2: Never connect anything inductive (motors, speakers) directly to an Arduino!
Rule #3: Avoid connecting or disconnecting wires while the power is on.
Rule #4: Do not apply power to any pin unless you are certain of what you're doing.
Rule #5: Do not exceed the maximum voltage ratings.
Rule #6: Many Arduinos cannot power transmitters directly.
Rule #7: Before powering your project, take a break and double-check the wiring.
LaryD’s Corollaries:
Coro #1: When starting out, add a 220Ω resistor in series with both input and output pins to protect against shorts.
Coro #2: Invest in a Digital Multi-Meter (DMM) to measure voltages, currents, and resistance.
Note: Violating these rules can turn your Arduinos into crispy critters. For optimal performance, keep your wires under 25 cm (10 inches).
Additional Tips:
The L293 motor driver, though common, is inefficient as it can lose around 3V as heat when driving both legs of a motor. Consider using a motor driver with MOSFET outputs to reduce heat loss and conserve battery power.
Hello. As van_der_decken pointed out, the red and black are incorrectly connected at the connector on the servo. It looks like you connected the green jumper from the GND on the Uno board to the Neg rail which is good. Then the black wire from that rail, via the orange wire, to the positive at the servo connector. Presumably you connected the yellow from +5 to the Pos rail to the red jumper which then connects to the black wire on the servo connector. That's feeding DC power to the servo in reverse, that's bad.
Inside the servo are more components than just the motor. There's a decoder and an encoder, for lack of better terms. The decoder controls the motor based on PWM (pulse-width modulation) from the A0 pin as you have it wired. The encoder is a feedback to let the controller know where/how far the output shaft has rotated. The servo is its own little world worth learning more about than I know.
I assume the servo was included in the kit. I hooked one up for my son just as you did, one of the tutorial projects. The advice to not use the Arduino as a power supply is good but we kind of assume that if the kit comes with the device and has instructions to hook it up just as you and I did, then it should be ok. I think it's fine for learning, following the instructions. But, the ATMega328P (the microcontroller which is at the heart of that Uno) has a reported limit of 40mA output on its pins with a combined limit reported to be around 200mA (all operating outputs added together). It's a good idea to not power anything from the ATMega328P (or any IC or anything else, really) unless you know how much current it is drawing and is within the safe limits of whatever it is connected to. Other devices which you might connect to the +5 would include LCD and RTC (real-time clock) modules.
Here is a link to the datasheet for the microcontroller. Datasheets are very often amazing resources with tons of information to help you better understand what you're working with.
Good points on the current limits. I knew I didn't know enough to be authoritative and tried to use verbiage in-tune with that.
Your point is right, and no, physics will not be denied. I put far more time and effort into "dialing in" a solution than I do in proof of concept. I would have thought that an example setup, using the kit, wouldn't have jeopardized components of the kit. Yeah, I should know better but...optimism.
I hadn't read the UN. I just saw a post I knew enough to weigh in on a little and hoped I'd get a chance to give some back.
What's with the "activation code"? There was a site which, reportedly, had some discount code which was passed out for a...Rigol? oscilloscope or somesuch. I ran across that somewhere. "Go to www.foobar.eu.co.z and post enough and you'll get a discount code for ."
Not sure what you mean by that. I have a Rigol DS1074Z oscilloscope, and there were official upgrade packages offered at eye watering prices to activate extra features in the scope. Features like decoding and displaying the signals on SPI and I2C busses, or increasing the sampling speed and getting more memory. However, these seem to be unavailable these days. There was a very long thread on a site discussing this where people published hacks to activate this. But I felt it wasn't worth the risk of bricking my scope for, so I never bothered.
There is also a way to control the oscilloscope from a python script running on your computer, I did try some experiments with this, and it worked well.
That URL doesn't exist, but turns up a lot of foobar2000 stuff which I am not sure is the same thing. A lot of .eu web sites from the UK were forced to close by the EU as part of the Brexit process. Anyway "foo" is a favorite Linux word for "just any random thing", like a variable or function.
I read a lot and my brain works in concepts, not so much encylopaedic/photographic memory. I read something about some kind of teaser/carrot code one could get if one went to <whatever> site and had at least some number of posts. It sounded hoaky. You pointed out that the user name included "just gere for the activation code" or similar and that's what triggered the memory.
Yes, Foo and Bar and foobar have been generic variable references for decades and is why I used it there: it was a stand-in for a site i cannot recall.