Author Topic: $50 robot question  (Read 2444 times)

0 Members and 1 Guest are viewing this topic.

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
$50 robot question
« on: August 31, 2011, 07:14:03 PM »
anything wrong with scrapping all the battery packs etc, and just using a 9V battery to power the lot?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: $50 robot question
« Reply #1 on: August 31, 2011, 08:19:21 PM »
No, but if you are talking about one of those small 9V 'transistor' batteries then it will not last long if it can even power the servos.
There are many thread here on the $50 Bot project. The 9V battery question has been asked and answered.
Do a search and some reading.
« Last Edit: August 31, 2011, 08:20:42 PM by waltr »

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #2 on: August 31, 2011, 11:26:38 PM »
Thanks for that, I have read alot on the forums but find some of the terminology to be overwhelming.

I have another question (this is gunna sound REAL noob) but is a "basic" voltage regulator just a fancy resistor?

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: $50 robot question
« Reply #3 on: September 01, 2011, 07:25:22 AM »
Thanks for that, I have read alot on the forums but find some of the terminology to be overwhelming.

Keep reading the forum threads and be sure to follow and read any links posted. Also use Google and Wikipedia to look up terms you don't understand.

Quote
I have another question (this is gunna sound REAL noob) but is a "basic" voltage regulator just a fancy resistor?
No. I assume you mean a three-terminal linear voltage regulator like this one:
http://www.national.com/pf/LM/LM78L05.html#Overview

Download and look at the data sheet. On page 8 is a diagram of the equivalent circuit that is inside the chip. This is part one of the answer. For part two look-up Ohm's Law and note the relation of voltage and current to resistance.

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: $50 robot question
« Reply #4 on: September 01, 2011, 12:23:12 PM »
anything wrong with scrapping all the battery packs etc, and just using a 9V battery to power the lot?
Just make sure that if you are using servos then they use the unregulated supply bus - so need to be able to work at 9V - which most will not. Equally servos can use 1 Amp each quite easily under load so the 9V batt won't last long!
So just make sure that whatever you are plugging in will work with the voltage supplied on the power pins you are using
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: $50 robot question
« Reply #5 on: September 01, 2011, 02:15:46 PM »
Hi,

[...] is a "basic" voltage regulator just a fancy resistor?
Looking at it purely from what it does, you may call it a fancy dynamic resistor.

Assuming a stable input voltage (like it would be close to, if fed from a very large battery for a short time), all it does is dissipate power caused by the voltage difference times the load current.

But luckily, it regulates the output to be steady with a varying input - hence "dynamic", as it is the equivalent of a resistor adapting its value, to always keep the output voltage steady at "any" load current.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #6 on: September 01, 2011, 08:36:51 PM »
i figured since what ive read said they both just reduce voltage it would seem i could interchage the two (values permitting of course, a higher battery voltage would require a bigger resistor to reduce to 5v)
im not actually gunna do this just trying to understand...

also what lead me to the above question is another question, im trying to understand resistors and capicators (topic for another day), i get the general jist of what they do, but when to use them? like why oh why is there a resistor going from the photoresistor to the ground wire? what is its purpose?

if anyone could point me in the direction of something to clear some of the clouds in my head id be greatly appreciated, or if needed I can try to explain my confusion further..

Thanks heaps for all your help guys you have no idea the service you provide :)

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: $50 robot question
« Reply #7 on: September 02, 2011, 02:11:10 AM »
Hi,

also what lead me to the above question is another question, im trying to understand resistors and capicators (topic for another day), i get the general jist of what they do, but when to use them? like why oh why is there a resistor going from the photoresistor to the ground wire? what is its purpose?

if anyone could point me in the direction of something to clear some of the clouds in my head id be greatly appreciated, or if needed I can try to explain my confusion further..
Before we can throw relevant tutorial links at you, we need to know exactly where in the process you are.

If you have specific questions, like the resistor/photoresistor, please link to the circuit that you're asking about.

A good place to start would be something like a very simple AMV LED flasher, as it can help you understand resistors, capacitors and transistors in an easy circuit, that you can modify and directly see the results. Besides teaching you stuff, it will also boost your confidence to see that you can control what happens and it is very cheap to build.

Can you read a schematic?
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,165
  • Helpful? 111
    • Webbot stuff
Re: $50 robot question
« Reply #8 on: September 04, 2011, 09:38:02 AM »
For a guide to photoresistors/LDRs then see Admins tutorial at http://www.societyofrobots.com/schematics_photoresistor.shtml
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #9 on: September 04, 2011, 06:28:17 PM »
I can read a schematic to some degree, if not I can google and ask friends/family usually gets me what I need to know.

The Admins tutorial is great, as with everything else here. But I still cant understand some things, like why that resistor is there with the photoresistors on the $50 robot? (which I built over the weekend, worked a charm, great, absolutely great starter robot! except my servos werent so easily modified but ya get that)

My understanding of a resistor is to resist the current flow, why would we want to resist on a ground wire? I just dont get it, Im sure Im over reading/ looking too hard at it, but its still got me baffled. Probably one line of text in a tutorial here Im not taking in properly lol

Hope this helps to add sense to my confusion, and again thanks for your help!

EDIT: just wanted to add that everything Im referring to so far is directly $50 robot related, I dont wanna create other stuff if I dont fully understand everything.
« Last Edit: September 04, 2011, 06:29:56 PM by Kizexc »

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: $50 robot question
« Reply #10 on: September 04, 2011, 06:40:47 PM »
It is time you played with a few resistors, a battery (or low current PS) and your DVM while reading up on Ohm's Law. Also read up on and build a resistor voltage divider then change the value of one resistor.
It should then become clear how the resistor/photo-resistor circuit outputs a changing voltage as the resistance of the photo-resistor changes.

Hint: The current through the resistor/photo-resistor changes when the total resistance changes.


Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: $50 robot question
« Reply #11 on: September 04, 2011, 06:43:12 PM »
Two resistors in series creates what's known as a voltage divider, which produces a voltage at the center (between the two resistors) which is proportional to the values of the resistors. For example, if two 1K resistors were in series between +5v and GND, and you put a multimeter between GND and the center of the two resistors, you would get +2.5v.

Following the same concept, we replace one of the resistors with a LDR, which changes resistance based on the amount of light flowing through. This changes the voltage at the center, allowing you to read in the value with the microcontroller and act upon it.

If you've studied some physics (or just know Kirchoff's loop theorem and Ohm's law), it works like this:



Here we have a loop starting and ending at Vin, such that Vin -> LDR -> resistor -> GND -> power source -> Vin.

This is expressed mathematically as I * Rresistor + I * RLDR - Vin = 0
or alternatively, Vin = I * Rresistor + I * RLDR
As we measure voltage from Vout relative to the GND line, we want to solve for I * Rresistor. Thus:

Vout = I * Rresistor = Vin - I * RLDR

Looking at this equation, we notice that the voltage measured (Vout) varies linearly depending on the resistance of LDR.

Hopefully that made some sense to you, if not, see here

--edit-- got ninja'd by waltr... whoops =). Anyways, look up voltage dividers.

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #12 on: September 04, 2011, 10:30:20 PM »
Wow! thanks for the detailed response and links!

So after some reading and quick tests heres what Ive come up with,

Voltage divider, I use this if I want to actually control what voltage levels can be produced by my LDR, whereas if I only wanted to check a drop or raise in voltage (amount is irrelevant) I could simply do away with the series and use the LDR by itself (again, referring to $50 robot set up)

Am i on the right track here?

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: $50 robot question
« Reply #13 on: September 04, 2011, 11:08:10 PM »
If you do a little experimenting, you'll realize that you can't actually check the drop or raise in voltage with just an LDR...

Referring back to the loop theorem:

I * RLDR - Vin = 0

Vin doesn't change, but RLDR does - resulting in the current I changing, which, unfortunately, you have no real way of measuring, unless you put another resistor in series.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: $50 robot question
« Reply #14 on: September 05, 2011, 08:17:27 AM »
The current can be measured indirectly by measuring the voltage across the fixed value resistor and use Ohms Law to calculate the current through the circuit.
I = V across R divided by the value of R.

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: $50 robot question
« Reply #15 on: September 05, 2011, 09:44:24 AM »
The current can be measured indirectly by measuring the voltage across the fixed value resistor [...]
[...] you have no real way of measuring, unless you put another resistor in series.

OP was asking about having only the LDR between Vin and ground.

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #16 on: September 05, 2011, 09:54:35 PM »
my idea was to connect the LDR directly to an input pin on my controller... which i suppose heads to ground

            PhotoR   
+5    o---/\/\/--.
                      |
                 Inp. Pin


or option 2

split it between an input pin and ground, same schematic as the photoresistor tutorial minus the additional resistor

            PhotoR   
+5    o---/\/\/--.-------o GND
                      |
                  Inp. Pin


excuse my dodgy schematics lol
« Last Edit: September 06, 2011, 12:01:52 AM by Kizexc »

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: $50 robot question
« Reply #17 on: September 06, 2011, 09:29:10 AM »
Ok on your thinking but go back to the R-divider and Ohm's LAW.

In the first schematic the input pin will only see a voltage of +5. Input pins are high impedance (high resistance) so will not pull enough current through the LDR to get a measurable voltage drop.

In the second you have the input pin connected to GND so the input will always see 0V. There will be current flowing through the LDR but the input pin will never see a changing voltage.

Try plugging those circuits into a bread-board and measure the voltage where you indicate the Inp. pin with a DVM. Some simple experimentation can be very instructive.

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #18 on: September 06, 2011, 03:25:29 PM »
In the first schematic the input pin will only see a voltage of +5. Input pins are high impedance (high resistance) so will not pull enough current through the LDR to get a measurable voltage drop.

So if the input pin wasnt high resistance id be on the right track?

In the second you have the input pin connected to GND so the input will always see 0V. There will be current flowing through the LDR but the input pin will never see a changing voltage.

Why wont the input pin see anything? because of the resistance on it?
Guessing this all requires a bit of knowledge on the MCU and input pins and such

Gunna try plugging these in (was scared I would fry something :/)

Again thanks guys!

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: $50 robot question
« Reply #19 on: September 06, 2011, 06:03:23 PM »
Use your bread board and Voltmeter (DVM) to measure what the voltage is at the Inp. pin (you don't need to connect the processor input pin to do this) on your schematics.
This way you don't need to take our word on what happens you can see for yourself.

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #20 on: September 06, 2011, 09:34:34 PM »
So, testing of circuits done with a voltmeter, and it seems your all correct.

Now im understanding the concept, specifically how to apply it, just dont understand how it works that way

and why if i do the second option i posted before would it read 0V, i connect my DVM from +5 across the LDR to where the input pin would read from and it reads +5, the same if i connect across all the resistors.

whats confusing me I guess is what is actually happening, how does a 1:1 ratio of resistors give me +2.5V inbetween them

Logically looking at it, we have a 5V power source, only 2.5V between the resistors and 5V again after them. placing a DVM from +5V to a point before the first resistor gives 0V (neglible).

So in short I know i know it works and how to apply it, just want to understand why, but i guess its not necessary for further circuit development.

Offline rbtying

  • Supreme Robot
  • *****
  • Posts: 452
  • Helpful? 31
Re: $50 robot question
« Reply #21 on: September 06, 2011, 11:29:51 PM »
When you have two resistors:

Kirchoff's loop theorem
V - I * Rtotal = 0
I = V / Rtotal

Expanded:

V - I * R1 - I * R2 = 0
substituting I in
V - V * ( R1/Rtotal ) - V * ( R2/Rtotal ) = 0

Taking the center means looking at the resistor enclosed by your two DVM probes, in this case let's use R1.

Vmeas = V * ( R1/Rtotal ) = V - V * ( R2/Rtotal )

R1 = R2 = R, so we can substitute into the fraction

Vmeas = V * ( R/(R + R) ) = V * R/2R = V * 0.5

Does that make sense?

Offline KizexcTopic starter

  • Jr. Member
  • **
  • Posts: 10
  • Helpful? 0
Re: $50 robot question
« Reply #22 on: September 06, 2011, 11:58:47 PM »
Yeah it does, with the exception, is that the voltage dropped by the resistor or the voltage remaining?

the confusing bit is:
(2 resistors in series)
I have 5V input, in between resistors 2.5V and after 5V ?? does this mean I can hook other things up to the circuit after the 2nd resistor with the assumption of still having 5V? or does it mean after that second resistor I have 0V left?

(1 resistor)
I have 5V input, after the resistor I have 5V. Can I assume an input pin is measing the voltage dropped at that certain part of my circuit? or is that the voltage remaining at that part of the circuit?
Why with 1 resistor if I connect it to the pin i get 5v, but if i add a ground line after the resistor along with the input i get 0V at input.

So laymens term, am i to assume an input pin reading is reading the voltage drop from where it connects to the circuit to the ground (or other words, the voltage remaining after the first resistor has its way)?

also to add to the confusion, what I dont understand is how current works, how does a resistor "pull" more current through the first resistor? (voltage drop over all resistors = the input voltage). how does this work? i get the math in figuring it out, but how doesnt make sense, why doesnt (for arguments sake) 1 sized resistor drop 2V all the time and the other drop 1v etc etc, how does the current/ other resistors/ whatever, know there is 2 resistors hooked up and to only drop some voltage?

I probably have all the answers to this just having trouble making it click.

 


Get Your Ad Here