go_away

### Author Topic: using "ground" in a circuit  (Read 2726 times)

0 Members and 1 Guest are viewing this topic.

#### chacho5

• Beginner
• Posts: 6
##### using "ground" in a circuit
« on: February 26, 2008, 08:14:19 PM »
hello, I am just beginning in making robots, and there is a lot that I don't understand. But most importantly, what does it mean when a tutoral says that a wire should go to "ground"?  I am making an obstacle avoiding robot using two sharp ir sensors (GP2D120), and it says that the black wire should lead to ground, and I have no idea what this means. I know that this sounds like a dumb question, but I just don't get it!

Also, I want to make my robot without having to buy a microprossesor. I was thinking about having the output voltage from the sensor go to the opposite motor to reverse the current and reverse the way the motor spins, but I don't know how that would work either. Any ideas? Help would be greatly appreciated!

#### ed1380

• Supreme Robot
• Posts: 1,478
##### Re: using "ground" in a circuit
« Reply #1 on: February 26, 2008, 08:32:37 PM »
ground is the negative terminal on the battery. everything "ground" connects to it.

this is what you're probably talking about http://www.societyofrobots.com/member_tutorials/node/59
Problems making the \$50 robot circuit board?

#### chacho5

• Beginner
• Posts: 6
##### Re: using "ground" in a circuit
« Reply #2 on: February 27, 2008, 06:49:09 AM »
Thanks a lot! Sorry I didn't see that in the tutorials!
So anyway I'm using that sharp ir rangefinder, so does the Vcc connect to the positive part of the battery? And how can I get current from the sensor when it detects something to go to a motor and cause it to spin?
Thanks again!

#### airman00

• Contest Winner
• Supreme Robot
• Posts: 3,653
• narobo.com
##### Re: using "ground" in a circuit
« Reply #3 on: February 27, 2008, 07:22:18 AM »
you need to do ADC to get the reading of the sensor

Vcc does get positive
Gnd gets negative

to do it without a microcontroller you need something called a comparator to compare the reading with a resistor that you put in
http://www.societyofrobots.com/member_tutorials/node/83
Check out the Roboduino, Arduino-compatible board!

www.Narobo.com

#### ed1380

• Supreme Robot
• Posts: 1,478
##### Re: using "ground" in a circuit
« Reply #4 on: February 27, 2008, 02:42:08 PM »
just to add to what airman said. the vcc is the logic voltage. usually it is regulated to 5v or 3.3v. whatever is said by the datasheet
Problems making the \$50 robot circuit board?

#### chacho5

• Beginner
• Posts: 6
##### Re: using "ground" in a circuit
« Reply #5 on: February 27, 2008, 05:24:22 PM »
:)Okay, thanks for the answers! There is still things I have questions about, though. I read airman's thing on comparators, and I'm wondering if I can make some sort of switch that would allow current through one path only if the current was enough volts. For example, if I had 4V going through the comparator to power the motor, could I make it so that when enough power went from the sensor to the comparator, then past the comparator would be a switch that only allowed current more than 4V. when the sensor's current goes through the comparator (it would be more than 4V), the switch would allow it to go through an alternate path, which would lead to the opposite end of the motor, therefore reversing the motor. I am just throwing something out there, I'm not sure if this would work! Do you guys have any ideas?

#### izua

• Supreme Robot
• Posts: 682
##### Re: using "ground" in a circuit
« Reply #6 on: February 27, 2008, 05:51:35 PM »
you might look into zenner diodes.
an ADC is an analog to digital converter, converts an electrical value into several bits, representing the fraction of the ADC's VCC.
Check out my homepage for in depth tutorials on microcontrollers and electronics.

#### ed1380

• Supreme Robot
• Posts: 1,478
##### Re: using "ground" in a circuit
« Reply #7 on: February 27, 2008, 05:54:21 PM »

I'm not sure about the comparators, but if you want to reverse the motor with a switch
Problems making the \$50 robot circuit board?

#### paulstreats

• Supreme Robot
• Posts: 1,381
##### Re: using "ground" in a circuit
« Reply #8 on: February 27, 2008, 06:07:12 PM »
a voltage monitor will do exactly what you want. say a 4v monitor will not let any voltage flow until it has reached 4 volts.

From there you would connect the motor (via an h-bridge so the motor current doesnt travel through the sensors etc since it would probably overheat them. You have to use an h-bridge however you approach using motors so you might want to read up on them. I think theres an h-bridge tutorial on the main SOR site)

#### chacho5

• Beginner
• Posts: 6
##### Re: using "ground" in a circuit
« Reply #9 on: February 27, 2008, 06:31:36 PM »
okay, so I read the h-bridge tutorial. now for the big question: can I control the A and B things on the h-bridge with the output from my ir sensor? so that when it doesn't send out voltage, the A is on and the B is off, and when it does send out voltage, the B is on and the A is off.

#### paulstreats

• Supreme Robot
• Posts: 1,381
##### Re: using "ground" in a circuit
« Reply #10 on: February 27, 2008, 06:44:28 PM »
There are a few different ways of achieving this. I think the best think would be to look at the \$40 robot members tutorial since this is a working example of using photo sensors with motors - http://www.societyofrobots.com/member_tutorials/node/62

#### chacho5

• Beginner
• Posts: 6
##### Re: using "ground" in a circuit
« Reply #11 on: February 27, 2008, 09:45:45 PM »
I looked at it, but he used a motor driver. I heard those cost a lot. Can't I just hook up one pin of the H-bridge to the Vo of the rangefinder and one to the power supply, and have the other one going to the motor?

or am I thinking about a transistor? I'm so confused!!!
« Last Edit: February 27, 2008, 09:50:09 PM by chacho5 »

#### paulstreats

• Supreme Robot
• Posts: 1,381
##### Re: using "ground" in a circuit
« Reply #12 on: February 28, 2008, 07:24:57 AM »
well, considering it is an entire robot for \$40, i dont think the motor driver part costs a lot do you?

The motor driver that is used there is just a motor driver ic (not an esc motor driver board\$\$). These probably cost around \$2 and are literally just an h-bridge built into a microchip(infact its probably 2 h-bridges in 1 ic. Since you need 1 for each motor). This means that instead of having to mess with 4 mosfets or transistors for each h-bridge, you only have 1 chip instead which is neater and proven to work.

Saying this the 2/4 inputs of that motor controller ic would be the 2/4 input to any h-bridge, so if you decide to make your own you would implement it in the same way. Use the outputs from the sensor to attach to your h-bridge the same as it attaches to the motor driver in that tutorial

#### paulstreats

• Supreme Robot
• Posts: 1,381
##### Re: using "ground" in a circuit
« Reply #13 on: February 28, 2008, 07:29:42 AM »
If you do use voltage monitors, there are 2 different types. An over voltage monitor and an undervoltage monitor.
1 will let voltage flow if it is below a certain range, and the other will let voltage flow if it is above a certain range. So if you have these, you can easily connect the outputs to the h-bridge to produce different directions

• Beginner
• Posts: 6