OK. Haven't looked at them yet, but it'll help!I've got the datasheets on the IR Led and the IR Receiver (WARNING: Those are links to .pdf files!)
Oops - you simply re-named or re-valued the V+ symbol to VCC. That's not so good. Delete that symbol, and replace it with either a copy of another VCC symbol that's already on the sheet, or from the library. Re-naming/re-valuing supply symbols is NOT a good idea, as that can change the names of symbols or power rails throughout the schematic, causing big problems later.Fixed the above...
PWM is basically turning the power ON and OFF at varying intervals. If we were talking about general lighting, where persistence of vision of the human eye would average out the light intensity, or motors which have inductance to keep the current flowing when it's cut off, that would be different. The response time of the IR Receiver is very quick. This needs to be looked at some more.Could I use PWM instead of resistors? Or does that only work on motors?
You could add a jumper, like those used on disk drives. Pins spaced 0.1" apart. Cheaper and smaller than a switch.Here's the updated schematic:
(removed link)
EDIT: I noticed that if I were to plug in a programmer to the ISP Header, both the L298 and the micro would receive power from the programmer. Should I add a switch between the VCC pin and VCC on the L298 to turn off the L298 while the micro is programming? (Would it matter if it did get power though, because the motors would still remain OFF?)
Explained above, but to re-iterate; delete it and add/copy an un-edited symbol.I also noticed that VCC on the RESET pin of the micro is an arrow and not a circle. Does that mean anything?
I changed it to another VCC symbol, should be correct now.Oops - you simply re-named or re-valued the V+ symbol to VCC. That's not so good. Delete that symbol, and replace it with either a copy of another VCC symbol that's already on the sheet, or from the library. Re-naming/re-valuing supply symbols is NOT a good idea, as that can change the names of symbols or power rails throughout the schematic, causing big problems later.
Check out the schematic below, I used a piece that looks similar to a header connector and wired it up according to this website.I don't see the ISP header; however I DO see what looks like re-named supply symbols. I'm afraid that won't work very well, as the supply symbols aren't physical parts; they are basically labels. They give a visual indication that they are connected somewhere else in the schematic, and also re-Name the signal that they are connected to. You need to find out what kind of connector is required to connect to the programmer harness, and hook it up in the schematic. If there is no symbol in a library for it, you'll need to create one.
I was doing some research on the web, there seems to be a whole webpage about IR object detection - about halfway down there's a section on PWM. I'm not sure if it's talking about the IR led or something else, I haven't read it yet.PWM is basically turning the power ON and OFF at varying intervals. If we were talking about general lighting, where persistence of vision of the human eye would average out the light intensity, or motors which have inductance to keep the current flowing when it's cut off, that would be different. The response time of the IR Receiver is very quick. This needs to be looked at some more.
That's genius! I might have to make one or buy a specially made one, though, because I'm not sure how far apart the pins on the header are.You could add a jumper, like those used on disk drives. Pins spaced 0.1" apart. Cheaper and smaller than a switch.
OK, the symbol is correct - but R3 has a wire running through it! This means that the /RESET pin is shorted to VCC. That simply won't do.I changed it to another VCC symbol, should be correct now.
OK. Haven't looked at the website yet.Check out the schematic below, I used a piece that looks similar to a header connector and wired it up according to this website.
It's not genius - it's a very common thing You have to be careful when specifying headers that you get the right pin spacing. There are 2MM headers and 1MM headers in addition to 0.1" (2.54mm) headers. The pin spacing is naturally all different. 0.1" headers are the most common in the US. You can even get 0.1" headers and jumpers at Radio Shack.That's genius! I might have to make one or buy a specially made one, though, because I'm not sure how far apart the pins on the header are.
Nooooo! Unless you like to see smoke pouring out of your brand-new programmer.EDIT: Pin 5 on the header is supposed to go to RESET, so I figured I could just connect it to VCC.
Fixed that, also added a diode to VCC on the reset pin because I don't want electricity going the wrong way while I'm programming. Was that a good choice, or no? Perhaps I can use a resistor between pins 5 and 2 instead of connecting pin 5 to the reset pin on the micro?re: V+ on /RESET pin
OK, the symbol is correct - but R3 has a wire running through it! This means that the /RESET pin is shorted to VCC. That simply won't do.
You didn't fix it completely, because you now have the ISP RESET connected to the wrong side of R3. As I've said twice previously, it needs to be connected to the reset pin.Fixed that, also added a diode to VCC on the reset pin because I don't want electricity going the wrong way while I'm programming. Was that a good choice, or no? Perhaps I can use a resistor between pins 5 and 2 instead of connecting pin 5 to the reset pin on the micro?
You haven't even started with a PCB layout yet.How do I connect all the VCC's together when the time comes to construct this beast? I see them all there, but I'm not sure where to connect them. Will I just solder the ones on the lower part of the schematic together, then solder that bunch to the main VCC coming out of the regulator?
I was thinking that if I connected it to the left side of R3, I wouldn't need another resistor. Do I need a resistor when I'm going from pin5 of the header to RESET?You didn't fix it completely, because you now have the ISP RESET connected to the wrong side of R3. As I've said twice previously, it needs to be connected to the reset pin.
OK, I clicked the yellow "!" and I got a list of about 8 errors. I tried fixing the ones I understood, but they still show up in the error checker. Does that mean I didn't fix the problem?Also, you've run the RESET line right across the junction of R1 and D9. If you perform an error check (lowest symbol on the toolbar, or on the menu, Tools -> Erc) you'll get a report of all the "gripes" that Eagle has with your schematic. Best to use it frequently, because errors accumulate rapidly and it makes it a mess to fix later. I ran the RESET line below the Atmel, and around the left side. Better than mucking up the right side.
I'm WAY in over my head as it is. Trying to create a circuit with absolutely zero prior knowledge about how they should work is not easy. I'm going to wait on the PCB until I get the circuit 100% complete.You haven't even started with a PCB layout yet.
No. R3 will take care of the pull-up detail during normal operation. But there needs to be a connection straight from ISP pin 5 to the Atmel pin 1. During programming, the programmer may pull the Atmel pin 1 to ground or to above Vcc; I don't know offhand. PICs get their pin 1 pulled to somewhere between 10v and 13v, depending upon the particular uC. The Atmel is probably something similar.I was thinking that if I connected it to the left side of R3, I wouldn't need another resistor. Do I need a resistor when I'm going from pin5 of the header to RESET?
Did you click the yellow "!" again? You will get a new list of "problem children" every time you click the yellow "!". It gets even more fun when you're creating a PCB layout. You may sometimes feel like a little mouse lost deep in a hole somewhere without any cheese.OK, I clicked the yellow "!" and I got a list of about 8 errors. I tried fixing the ones I understood, but they still show up in the error checker. Does that mean I didn't fix the problem?
That's not a bad idea. Taking things slowly and carefully will result in more progress than doing things in a willy-nilly haphazard fashion, and then having tons of clean-up later.I'm WAY in over my head as it is. Trying to create a circuit with absolutely zero prior knowledge about how they should work is not easy. I'm going to wait on the PCB until I get the circuit 100% complete.
That made a few of them go away, but others still remain that I hope won't affect anything.Did you click the yellow "!" again? You will get a new list of "problem children" every time you click the yellow "!". It gets even more fun when you're creating a PCB layout. You may sometimes feel like a little mouse lost deep in a hole somewhere without any cheese.
I actually couldn't find it at first - there was a link earlier to a tutorial on sparkfun, but it was some sort of beginners electronics guide. I read that, then tonight I went back to their site and now I'm checking out their eagle tutorial (http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=108). It looks quite expansive, which will help me out - I really don't know anything about eagle. I'll put the finishing touches on this schematic and post it - hopefully then I can start learning about PCBsDid you go through that Eagle tutorial over on Sparkfun? It's really quite good, and if you take your time to understand it, you'll learn a number of useful things.
They aren't optional! If they aren't connected, there will be no path to ground for your motors.That made a few of them go away, but others still remain that I hope won't affect anything.
I've got these errors:
Unconnected INPUT pin IC2 SEN_A
Unconnected INPUT pin IC2 SEN_B
I don't think those matter because they are optional pins on the L298 - at least I've understood them that way.
That's fine. There isn't a VS symbol in the library anyway - or I might've used it.Then I've got these warnings:
POWER pin IC2 VS connected to V+
I don't think this matters, because it makes sense to connect it this way.
N$17 is the signal name of the wire that goes from the pin to the resistor. It's OK.POWER pin IR1 VS connected to N$17
Also shouldn't matter, that's just how it connects (I believe N$17 is VCC - or it's an error).
Interesting - that's a new feature in version 5. 4.16 doesn't care if there is no value. Usually, you put the part number in there. It shows up when you generate a BOM list.Part S1 has no value
Should not be a problem because S1 is only a switch (even when I give it a value, it still warns me.)
Yes, that was it. But, I wanted you to go through the entire process, since practically all of it applies directly to this project that you're attempting now. And it will save ME a heck of a lot of typing!I actually couldn't find it at first - there was a link earlier to a tutorial on sparkfun, but it was some sort of beginners electronics guide. I read that, then tonight I went back to their site and now I'm checking out their eagle tutorial (http://www.sparkfun.com/commerce/tutorial_info.php?tutorials_id=108). It looks quite expansive, which will help me out - I really don't know anything about eagle. I'll put the finishing touches on this schematic and post it - hopefully then I can start learning about PCBs
I can't view schematics or boards that were created with versions of Eagle past 4.16. Mine is registered, and I don't want to invest more money on upgrading it. Post it in .PNG format.OK, I think I'm finally done with the schematic. I tried something new I learned from the tutorial - labeling wires so I don't have to have them connect (can be seen on PIN5 of the header going to the RESET pin on the micro)
I don't know how you connected them, but delete the wiring and connector to both of those pins, and use the GND symbol from the supply2 library. Otherwise, you will have an inconsistency that will cause problems when you try to create a board.Adding GND symbols to the SEN_A and SEN_B pins gave me some consistency errors:
Different connections on IC2 pin SEN_A and pad 1 (GND/none)
Different connections on IC2 pin SEN_B and pad 1 (GND/none)
I'll ignore those for now, they look fine in eagle, and I'm pretty sure I connected them properly.
Interesting. Did you do an error check and fix any errors before you created a board?I followed the PCB layout tutorial for eagle on sparkfun - it worked, but I don't think the PCB autorouted correctly. Some traces go from the top of the board to the bottom, without any holes in it. I ended up not saving this file because it didn't look right.
Yep, it's pretty neat. I don't have the autorouter module, it was an extra $400 or so. Autorouting can cause big problems, particularly if you have mixed signals (analog/digital) in a circuit. You CAN set up "rules" for autorouting, but unless you're doing production-type work with a LOT of very similar circuits, it's not worth the time.It was really neat to watch the autorouter in action, though!
Like I say, I can't examine it. Maybe I'll load up a demo Eagle on another computer, but not right away. Don't have the space to set it up.Here's what I assume should be the final schematic for this project! How exciting!
Yep, that did the trick - those errors are gone now.I don't know how you connected them, but delete the wiring and connector to both of those pins, and use the GND symbol from the supply2 library. Otherwise, you will have an inconsistency that will cause problems when you try to create a board.
I think that might have just been a fluke, or I wasn't reading it correctly. I made another PCB and it looks pretty good this time. Here's a few pictures of it:Interesting. Did you do an error check and fix any errors before you created a board?
Did you do a Design Rule Check before you tried autorouting it?
I'm purchasing a part from the TSOP21x series, the TSOP2138. According to the data sheet, I'm going to get one that responds to a 38kHz signal. I added a custom piece to the schematic instead of the one that was on there earlier.There's still issues with the IR receiver. I don't know which exact model you have, but that type of receiver will only respond to an IR signal at a specific frequency, somewhere in the range of 30kHz to 40kHz. You will have to compare your exact part number to the datasheet's table.
I can do this using resistors, or possibly PWM, right? I've got a few resistors and LEDs at home right now, I can tool with them and see how the intensity is affected to get a general idea for what type of resistors I'll need.Your IR receiver has AGC, which is Automatic Gain Control. That means if the IR emitter LED is bouncing/reflecting enough light from something for it to see, you'll get a 1 output from it; if not, you'll get a 0. In order to be able to get some vague idea on how far away you are from an object (let's say, a white wall) then you will have to be able to vary the intensity of the LED - while it is being turned on and off at the frequency the receiver is "tuned" to.
I probably won't need this much current. As long as the LED is able to run at a lower current and I can get a few different intensities using resistors or PWM, this shouldn't be a problem. I will need to change the resistor that's there currently though - I calculated it thinking 100mA would flow through it.Also, the IR LED is rated for up to 100mA current. I'm not sure offhand, but I think that the Atmel uC can probably only output around 20 to 25mA. While you possibly won't want that much power output, if you don't plan for it, you're not going to be able to get there without modifications to the board. Best to plan ahead!
After a bit of reading, and some calculations, I've made an astable circuit that should run the LED at about 38kHz (37774.906885 Hz to be exact - I hope it's close enough to work). I followed the diagram in the tutorial, with some help from this datasheet, and I calculated the resistors to be 220 ohms and 1800 ohms (couldn't find a 1.8kohm resistor, so I put a 1kohm, 470ohm, and 330 ohm in series) while using a .01uF capacitor between Pin6 and GND. I placed the 555 in the top right corner of the schematic:I'm going to hand that task off to you for now. Research how to make an oscillator to drive the LED at a frequency close to what is needed.
Changed that, now the 555 is named LM555N.OK, you've researched the LM555 timer, but in the schematic you used an ICM7555 timer. I suggest that you replace the symbol in your schematic with a 555 timer symbol; as the ICM7555 is a CMOS version that does not have the source/sink capability of a bjt 555. Alternatively, you could change the VALUE field to denote an LM555N.
(Generally, "N" suffixed parts in Eagle mean a DIP package.)
I fixed this, too. There was an error in eagle, but since I've connected it the way I have below, the error has gone away.As far as the PIN4 wire naming - that's not so good! Error check will complain vociferously about that. Right now, you have renamed VCC to PIN4, and everywhere in the circuit will have a conflict due to that naming.
Delete both of your PIN4 wire namings. Use a VCC symbol from supply2.lbr to connect pin 4 to VCC.
OK, I also changed the values for the resistors and added a trim pot resistor, I wasn't sure how to connect it, so I just connected pins 1 and 3 like a normal resistor, then pin 2 to ground.Let's work on the RC values for the timer circuit. When you start seeing very low values of resistance, it's time to decrease the value of the timing capacitor; in your case C6.
Decrease C6 to 1nF. Change R8 to 1.5k. Change R1 to 10k. Replace R4 and R7 with a single 10k, 10-turn trim pot, set to an initial value of 8.22k. That will give a duty cycle of about 52% on, 48% off.
Speaking of simulations, I found a fun little one that lets you put in values and simulate a 555 circuit! Heres the link: http://www.delabs-circuits.com/cirdir/theory/gates/doc00019.htmlAs far as 555 simulations/calculations vs reality - your mileage will vary, perhaps considerably! This is where "breadboarding" comes in very handy.
Oops. Nope! Pin 2 is the "wiper" of the pot, 1 and 3 are either end of the pot. Delete the ground on pin 2, and connect pin 2 to either pin 1 or pin 3. Used that way, a pot becomes a rheostat, which is what you need.Changed that, now the 555 is named LM555N.
OK, I also changed the values for the resistors and added a trim pot resistor, I wasn't sure how to connect it, so I just connected pins 1 and 3 like a normal resistor, then pin 2 to ground.
Yes.Can I use a multimeter to measure the resistance of the trimpot when I actually use it? I couldn't find the data sheet for the one I plan on buying
Interesting, but it doesn't allow you to enter fractional values.Speaking of simulations, I found a fun little one that lets you put in values and simulate a 555 circuit!
Still need to work out the IR LED details.I think we're close to being done - I'm gonna start work on finding all the parts I'll need. I'm sure there will be kinks to work out during the testing phase, so this is definitely not a final schematic.
I added this, but why a 220uF capacitor? How did you know to use this one? I'm sure it's got something to do with lots of experience - but I'm a noob.The 555 is also going to need a 220uF bypass cap between it's pin 8 (V+) and GND. It would be a good idea to have a 1N4004 diode between V+ and the cap to prevent the motors from draining the 220uF cap.