Hi, I'm a high school student and I'm trying to design an all in one stepper motor controller board for the 28byj-48 stepper motors (the really cheap, round ones). This project may be a little too complex for my skills but I tried my best. I've drawn up the schematic in eagle following information I found online.
The issue I'm facing is that I am unable to upload a sketch to the board. I am assuming I incorrectly followed the CH340G USB-Serial schematic that I added to my board. In device manager, it picks up that a device has been plugged in (USB-Serial CH340G (COM7)), but when I select the board in the Arduino IDE and try to upload, it gives me the out of sync error: "avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x20".
I've verified that the ATMega328p chip is in working condition as I got it directly from an already working arduino uno.
The eagle files are attached to this post. Sorry if the error is something really simple i overlooked. Also i hope i posted this in the right forum category (sorry if i didn't).
I would really appreciate any help.
Thanks!
You appear to have Tx to Tx, two outputs. Need to have Tx to Rx, and Rx to Tx.
The '328 does not appear to have power connected.
There is no 0.1uF cap between the DTR from the USB chip to the 328P, thus a serial download would not cause a reset pulse to the 328P and kick off the bootloader to receive code.
It would also have been good to have a 0.1uF cap on Both the of the 328Ps VCC and AVCC pins.
CrossRoads:
You appear to have Tx to Tx, two outputs. Need to have Tx to Rx, and Rx to Tx.
The '328 does not appear to have power connected.
There is no 0.1uF cap between the DTR from the USB chip to the 328P, thus a serial download would not cause a reset pulse to the 328P and kick off the bootloader to receive code.
It would also have been good to have a 0.1uF cap on Both the of the 328Ps VCC and AVCC pins.
Hi CrossRoads,
Thanks for getting back to me! I really appreciate your help.
I have connected TX to RX and RX to TX like you said.
I've connected the VCC pin on the '328 to the 5V coming from the USB (and GND to the USB GND) - (same power source as the CH340G chip)
I connected DTR on the CH340G to the Reset pin on the 328 via a 0.1uF capacitor. VCC and AVCC have been connected to ground via a 0.1uF capacitor as well.
I have attached the updated eagle files if you'd like to take a look for me.
Thanks again for the help, I really appreciate you taking the time!
Darcy
Looking better. Add 0.1uF caps to the the ULN2003 VCC pins also.
Now, the board.
I would swap the 328 & ULN2003 positions so all the high current traces from the ULN2003s to the motor connectors aren't going under the processor.
Mount the crystals and their caps next to the processor crystal pins. Don't have other traces going under the crystals.
Mount the 0.1uF caps next to the VCC and AVCC pins.
Add Ground planes to the top and bottom layers using the Polygon button on the menu. (Draw:Polygon).
Name them both Gnd. Add vias Named Gnd to connect the top & bottom layers as needed.
Edit:Net Classes, it doesn't appear you didn't do anything with this, so your traces are all 6 mil wide. Too narrow, especially for the ULN2003 to motor connectors, and for power traces.
I would suggest making the Default 10 mil, with 10 or 12 mil clearance, and 12 mil drills.
For power traces, I use16, 20, 24 mil, with similar drill, and 10 or 12 mil clearance, to avoid voltage loss along the trace, and to avoid them opening up like a fuse.
You have a lot of traces going from one end of the 328 to a connector at the other end. Consider reassigning those so traces can go straight from 328 to the connector, like you did for pins 1 to 14.
CH340, do you have a source? I have not seen them offered at any of the US distributors, so I won't put them in my designs.
USB-B, that's kind of old school. Maybe consider replacing that with a USB MicroB if you need a little more board space.
I would use one with body legs that go thru the board for more holding strength.
https://www.digikey.com/en/products/filter/usb-dvi-hdmi-connectors/312?s=N4IgjCBcoEwBxVAYygMwIYBsDOBTANCAPZQDaIALGHFTCALqEAOALlCAMosBOAlgHYBzEAF9CANgCciECkgYcBYmUoAGSRRgBWBszaROPAcLEgAtHWiyoPAK5KSkcjsLTGIVu1GEz0q3LsHFQh3TwNRU0tyW2wAIwACeIBbXiRuIliGESA
Hi CrossRoads,
Thanks for getting back to me again.
I've added 0.1uF caps to each of the ULN2003 IC's on their VCC pins.
I've redone the placement of the PCB (still probably not ideal but I tried my best), I've tried to keep all the high current motor and power connections separate from the rest of the circuit (in other words, the traces for the motor power aren't travelling all around the board).
I added the ground planes via the Polygon tool, named them both GND.
For the traces, i wasn't exactly sure how to do it so what I ended up doing was going to the schematic and clicking Edit, Net Classes and creating two classes, one for the Motor Power (with the larger values for width, etc.) and the rest of the circuit (with the other values you said). I then selected the sections of the schematic dealing with the high current power source and set the net class to the Motor Power class. I think that worked out well as the width of the traces look thicker now.
I've fixed the issue with the 14 pin connector being the wrong way round resulting in the traces going from one end of the 328p to the other end of the connector (i just flipped the connector 180degrees).
I've bought all my parts of ebay (not the best place I know) as the shipping is much much cheaper to australia than from the US (although the chinese parts will most likely be much lower quality than the ones from the US).
The reason why I chose the CH340G chip for USB-Serial communication is because I found a simple schematic on instructables for it and other schematics with different IC's seemed a little too complicated for me (original schematic image attached).
As for the USB-B, I just used it because I had a few female connectors lying around to use. I do agree USB-B would be a much better replacement, but I'll probably change that out at a later date.
Again, thanks for the help. I'll definitely remember what you've said with future projects!
Darcy
Edit: Forgot to add it earlier, but in relation to ground planes, I clicked the ratsnest button. I think this is what I needed to do to allow them to be connected to.
Edit 2: Sorry, one last question. Do I need to connect the top and bottom GND plane to eachother with a via. The autorouter already added some vias for me so do I need to add one to connect them?
This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.