About My Project
My final project is a low cost pan-tilt turret, with a wide range of applications.
Goals
- Extremely low cost
- Fully 3d printed
- Easy to use
- Easily soldered circuits
- Easy Programming
- Easy to modify
- I learn something from this
Extremely low cost
Fully 3d printed
Easy to use
Easily soldered circuits
Easy Programming
Easy to modify
I learn something from this
Electronics
The electronics for this project were both the funnest part and the most challenging
Initial Electronics & Software Design
My initial design involved a complex ecosystem of 4 custom boards (Battery, Microcontroller, Stepper Driver, USB-C) distrubuting functions between them. While pretty cool, especially the stepper driver board, It was just too much to work well, and especially as the microcontroller used (ESP32-C3) required alot of power, resulting in a low amount of power actually going to the stepper motors.
Click here to read the full breakdown of the old System
Final Board Design
The final board was an almost complete redesign of the old one. The things kept were the stepper drivers, where I found the drv8835 to be a really good, cheap chip. It also keeps wireless functionalitiy, but using a completely different chip, the CH572D.
CH572D is goated
Deciding to switch microcontrollers so far in was a major delay, but I think it was worth it. Simply put, the chip is 20 cents for bluetooth, 10x cheaper than the old chip (especially post price raises as a result to tariffs). However, the chip is around 10x worst in some aspects, including the community/developer support and flash/ram (1/8th the flash, 1/33 the ram). While it might be a pretty big downgrade in some areas, the price alone makes this chip the most coolest little thing I've ever used in my life (17 as of writing this)
Instead of a 4 board design, I consolidated the boards here, and used a pre-made USB-C charging board from amazon. This finally gave me the power I needed for the steppers, and combined with redefining parts of the 3d design, finally gave me the power to move such heavy parts on such cheap hardware
Schematic(s)
These are all on one board, im just doing 3 images for better detailed descriptions per
The driver is kinda my standard by this point. its just such a goated chip, as its cheap, easy to use (I guess its not like i2c but still), and works really well for my use cases. I've used this for regulator motors too, with this exact schematic. Only bad thing I can say about this, and about the driver really is that on the final boards im using I forgot to add a spot for a second capacitor, and instead stacked 2 which worked and saved space, so could be a cool trick to pull off in the future
I've already talked about how much I love the ch572, but heres even more proof. None of that fancy bluetooth antenna matching pi networking stuff. This chip is so goated that I just put the antenna pin into a standard antenna design from like TI or someone, and it works amazingly. also that voltage regulator (the one called "the really cheap one (200mah)) is another standard part for my projects, as I have like 3 entirely different voltage regulators, but all with the same requirement of load capacitors, and they each have different current maxes, at 200, 300, and 600ma. Reason im using the 200 hear is because its just the cheapest. DRV8835 doesn't require high power on its logic pin, but idk i guess be aware if your using this design and want to use other stuff
the 200mah one is linked here The 300mah one is linked here The 600mah one is linked here They're all 3.3v sot23-5 here, but im pretty certain theres different versions of all 3 for regulating voltages 1.8 to 5 (max voltage on all 3 is just under 6v btw be aware, I power through usbc/5v from the battery board)
Idk simple usbc schematic. I guess its kinda kinda cool since thats a custom symbol there, just a modification of the original to put the stuff near eachother, instead of having the pins all on the left in random orders that gave off bad vibes (and bad looks)
Layout
I think the curves look pretty cool. Im no PCB designer (although I really want to do that as my job in the future), so here is my creative mind shining through. Far as I can tell (if your a master pcb designer and see issues anywhere pls pls pls message me), routing like this shouldn't cause any issues, and might even improve stuff. I guess the cool thing here is that PCB antenna, which is actually my first use of that type (I started with a chip antenna, then the exact pcb antenna of the dev board, and now this). groundings pretty important for these kinda things, so ground plane on the bottom, with only one trace going through it, and no traces near the antenna. Stiching vias all over as a wall near the antenna trace, and (my best attempt) at keeping the area near the antenna clear of components. I will say that this is my first rounded type board design, and I think i've gotten better at making it looks good since then. also I should note here now that I have updated the design, as I forgot a capacitor for the drv8835on the first production run
Ordering
quick little aside here, as im using a pcb antenna and not a chip antenna, I had(? conventional wisdom) to use a ENIG surface finish. This either costs more money, or causes you(me) to look for a supplier with cheap ENIG. oshpark, a lowkey goated american pcb fab, offers really high priced boards, but their pricing is dimension based, so for a small board like this, it cost be 3 dollars (free shipping) to get 3 ENIG dual layer boards. They got here faster than JLCPCB(with cheapest shipping of course).
Soldering
This is pretty important when you(me) don't wanna spend a bunch of money on assembly. I've tried basically every way of soldering at this point: with an iron, with an oven, with a hotplate, and with hot air. I've found hot air to be so much better than the others (of course using an iron is just simplier for simplier things), but for SMD assembly, hot air is the way to go. If your looking into it for the first time, please dont get a airgun/hairdryer looking thing, get those really chunky ones you hold like a pencil. I tried using those, and they just spit out such an absurd amount of heat, and would blow away the components if I used a nozzle. my personal one is this one, but really just read the reviews for using it how you want to use it for stuff like this.
Programming
The CH572D is really funky in programming it. Theres 2 main methods I've seen. The company behind it directly supports Mounriver Studio, which is essentially just vscode. It uses C, it has extensive (chinese) documentation/examples, and is able to use the advanced bluetooth functions (you gotta be really smart though their examples for them kinda suck). The other method is the CH32FUN project. I think the best way to compare the two, is that their webpage(/github) has mounriver opening to chinese, and ch32fun opening to a really detailed (english) explanation of how the dev environment works. For reasons mostly involving not speaking chinese, and prefering open source stuff, I am using ch32fun for this. I have since used mounriver for a electric vehicle im making for science olympiad, as ch32fun doesn't support PWM for the specific chip I was using (CH592).
ch32fun
This a open source developmentenvironment for WCH chips. It started for the ch32v003 (the 10 cent microcontroller!) but now is just the general conglomeration for WCH microcontrollers. code wise, it is very similar to arduino, in that it uses C, and has a similar structure to the arduino IDE. It starts to get rough when you want to do specific things, like the PWM I mentioned above, or, tragically, anything with bluetooth. WCH has a closed source stack on it (there is the ch570, which is the exact same silicon, but any BLE functions are blocked, and it costs even cheaper) that, when used with the ch32fun library, does the exact same as the ch572. Not cool WCH. I still love them though they got some crazy cheap stuff.
general code description
So what I needed from this code was to be able to communicate with the ch572D (usb dongle type thing) on one chip, and then that chip sends out the wireless, which is picked up by receiver chips connected to the stepper.
USB dongle
surprise! a new board is hitting the battlegrounds. After failing to graduate the first time around, I kinda hit a funk where I just had no motivation to work, but I did have motivation to design a bunch of cool PCBs. they were almost all centered around the ch572D, and one of them actually ended up being something productive. It started as me wanting to see how low a BOM I could get, mainly by removing the usb-c and replacing it with a usb-a pcb, but then I realized that that would make a really good cheap dongle, so kinda forgot about the low bom thing and just made a dongle.
Its on my own personal github here
USB Dongle Schematics
Nothing really special here, just the run of the mill ch572D circuit that I've used a bunch of times now. Only weird thing is that I actually put a reset button on this one, and put a second led that I lowkey just realized I didn't connect to anything whoops. It would of been connected to pin 10 for debugging. I guess excluding the 2 LEDS, its (maybe) the lowest amount of passives for the ch572D
USB Dongle PCB
I really cooked here. The first placements were getting the pins and antenna facing away from eachother, and then I saw it fit the size of the USB-A so well, and fit the ch572d in the middle. This is probably my first board that looks actually halfway decent aesthetically. I sadly didn't use curved traces on this one, since I was still experimenting with my style at that point
Okay so thats the dongle, now the code for it
USB Dongle Code
the CH572D, as much as I love designing boards for it, is kinda ass program. I'm talking both writing code and getting it on it. They intend for you to use a WCH-LinkE (USB-Uart board) like a neathanderal, but they also have a tool called WCH-ISP(in system programmer) that lets you program it over USB. With that, it just needs the boot button down during startup, and then can be programmed with a HEX file. It's still a very involved workflow compared to like arduino, as it is: 1. Make file in ch32fun 2. Put that file into WCH-ISP 3. Enable bootloader mode 4. Upload Programming wise, im not gonna sugarcoat it, AI is absolutely goated for this. I swear I can program normally, and did have to do parts as ch32fun is simply a pretty niche project, but for the most part, I just had it generate the code for me. Also before I get attacked I spent enough time on that that I can explain all of it, choices the AI made, and the purpose of specific functions, I know a little bit of ball.
Networking Week
In my (revised) networking week, I made the basic functions and such that I'm using here. It works by sending packets like anything else, but these are custom. The main thing about them is that, instead of being sent on the standard Bluetooth access address (0x8e89bede), it uses my own custom formulated hyper advanced algorithmically generated one (0x12345678). This makes it really easy for me (in my debugging) and the chip to know "oh its from the dongle" instead of the wireless toothbrush. Asides from that, I also had it use a 4 byte magic packet (exactly as done in networking week) for even more authentication. The packets were really small though, as it was just those 4 bytes + 3 command bytes (explained later)
Networking debugging
I'm very proud of this part: I used a network analyzer (the kinda thing with a buncha antennas) to see the packets being sent. It actually helped a very very large amount as, again, ch32fun doesn't have the best documentation, and turns out I needed another step to actually send those packets off.
3D Design
Concept and Requirements
My final project will be a rotatable pan-tilt turret. I will attempt to make it as similar to what it is based on, a gadget from a game called "Rainbow Six Siege". in the game, the "operators" can pull out their phone, and then go on camera to look around. While on their phone, they can move this camera to look in any direction horizontally and around 120 degrees vertically. Additionally, this camera specifically can open the black panel on the front, in order to give the camera an undistorted view. If you go to the 3d model above, and look near the bottom of its box, and change the static pose to moving pose, you can see exactly how it moves in game, and how I want it to move. I also want to keep this working after fab, and put it in my room somewhere, so it has to work well enough to make it out of fab academy alive.
I used this as a reference, its liscense does allow me to modify it with attribute, so my design was based on the one above, which can be found here
Sketch
This sketch outlines the major electronic components of the camera. In order for it to be able to rotate infinitely along its base, it needs to have no wires connecting the base and the head, or a slip ring. When I was researching it, while a slipring seemed interesting, I have more experience with batteries and decided to go the disconnected route. It would probably be more reliable or at least easy to replace an old battery than a broken slip ring. I also have some experience with stepper motors when experimenting with making a gantry for them, so I decided to go with a thin stepper for the one connecting the head to the rotatable base, and a larger one connecting the rotatable base to the unmoving base.
First pass
As part of cad week. I designed the 3d portion of my final project. To give a basic overview, I used one sketch per part, with 3 separate parts that I called the unmoving base, the moving base, and the head. both base pieces were not that complicated, and I decided to drop the two levers on the side of the camera so that it would be easier to 3d print it, which is how im planning on making it. in planning on 3d printing it, I had to make sure that a quadrant of it could fit on a bambu a1 build plate, which are the 3d printers my lab has. Besides that, however, I did not design it for being 3d printed in parts, and therefore will have to go back edit it later. This isn't the end of the world, as Fusion 360's parametric modeling feature makes it very easy to essentially time travel to an earlier version of the design, and any changes made in that version will cascade to the current version. Again, for more information, please check my documentation as part of cad week
Refining 3d Design
after getting the code working, for 3d printing and scanning week, I went back to work on the design. for my design in 3d printing and scanning week, I wanted to use a scaled down version of my final and make it print in place, but also used that as an excuse to fix some bad designs, like the head, which I completely redesigned to make it more like the reference.
Continued 3d design
Heres where I finished the 3d design. This entailed really minor changes to the looks of the design, but mainly adding everything that would eventually make it move
Heres why I wanted to optimize. The current model was 500 grams for just the midsection, but I am confident I can get it down to under a kilogram of filament for at least the 2 parts of the base.
I also started on the motion in my design. This image is a rough sketch of what the gearing for the base will be like



