Cromira Sprint
This section will document the development of Cromira from Week15, System Integration.
Engineering
This section is for the development of the mechanical systems of Cromira.
Initial CAD
The development of the mechanical systems started with work done for Week15, System Integration. I started with some simple sketches of what I wanted the device to look like based on the concept modeling work that I have done in the preceding months.
I started with a SolidWorks layout with the outer surfaces and basic shells of the device. The main body of the device has an inner shell for mounting all of the electronics, hinges, and other mechanical details. The outer shell is the aesthetic surface that also provides the interface for the 2 end effectors (vignette tool and diffraction grating). It is broken only by the doors for the LEDs for the prismatic projection.
Initial CAD showing the initial layout of the device.
A key part of making a mechanical design that would work was to make sure all of the components could be packaged properly. So I looked at that first. I placed the XIAO and the batteries inside of the CAD and adjusted the outer shape to make sure it would fit. During this exploration I found that the XIAO fit nicely on the bottom of the device where I cut away some of the area to allow for the photographer to still have access to the mechanical focus ring on the lens. There was the perfect amount of room for a 3-pin female connector to provided electrical connection to the addressable LEDs and a hole to allow a USBC connection to the XIAO.
Initial CAD showing the initial layout of the device with the electronics underneath.
The initial CAD also contemplated how the end affectors would connect to the device. I created a double walled recess in the front of the main body that would allow a bearing surface for the end effectors to locate on. Then magnets would be placed behind the wall to grab onto magnets on the vignette tool and a steel plate in the prism tool. The vignette tool needs to be locked rotationally so that the electrical connector can stay in place and the prism tool needs continuous rotation to allow for infinite control of how the rainbow effect is rendered in the camera.
Prototyping
I built a couple of prototypes to validate this CAD. The first two were meant to test the general fit and assembly. The second was functional to test the prism tool. Then I moved on to test the door for the prism projection.
The first prototype used FDM printing. I had a bunch of partial rolls oof filament so it ended up being a bunch of different colors. This initial prototype proved that the parts fit together really well with the tongue and groove features. I also found that the cutout in the bottom was enough to use the mechanical focus ring. It also gave me a platform to start roughing in the components.
Protoype installed on the camera to test the cutout.
Laying out the components to work out where they will best fit.
The second prototype had more detail and an updated front face that would allow for the test of the end effectors. I wanted to see how the double wall design would work and to see if the connector strategy seemed sound. I also built a prismatic lens with diffraction grating to test it out.
Second prototype showing the installed device with diffraction lens. Even though it did not have magnets yet, the action felt good and was able to be rotated well.
Device side of the vignette effector.
Vignette side of the vignette effector with male pins. This worked well and will take it forward in the next iteration.
Projection Door
In the third prototype I printed half of the device to test out the doors. I roughed in a hinge mechanism that would allow the door to be open approximately 60 degrees. Then I cut a piece of CD to fit inside the door. I hot glued a high power LED to the wall of the prototype and powered it with the 3.3V port on the XIAO and observed the rainbows. For this prototype I used a 5 degree lens over the LED as I thought it would make the raibows more intense.
3D print with the LED door, LED, and CD.
However I found that the raibow projection was sub par. A few feet away from the wall, I could barely see anything. This was disappointing as I had been able to get good rainbows using a flashlight and a CD at home. However, I kept playing with the device and found a way forward. I had a different piece of diffraction grating which had a radial grid pattern. It is a Rainbow Symphony and I used it with my prototype and was able to find an angle that produced reasonable rainbows on the wall, even in relatively high light.
Lighting up the LED.
Rainbow created with the Rainbow Symphony diffraction grating.
So I took this concept forward.
Diffraction Angle
I did a small test to figure out where the LED needed to be relative to the diffraction material. In playing with it it seemed to be very sensitive to the light location, but it like to be in the center of the radial pattern.
So I made a SolidWorks design of an angle testing device. I make angled slots in a square base that would hold the diffraction grating. Then I made a post for the LED to sit on that would be centered on the radius. This would allow me to control the position of the light and grating and also be able to move it as required.
CAD of the diffraction grating jig.
I 3D printed the parts and assembled it with the same LED, this time without the lens. The lens is big and would be hard to package in the plastic shell, so I would like to avoid it all costs. I used the XIAO 3.3V power to light the LED for the test.
Prototype of the diffraction holder.
Once the device was powered I tried to throw rainbows in my house. I found it to be very effective and the raibows were quite bright. I also found that it was not very sensitive around 45 degrees, but the shape of the rainbow would change slightly by moving the diffraction grating fore and aft in the slot.
Bright rainbows being projected from the prototype.
Updated Prototype
Bouyed by the success of the concept model above, I brought this philosophy back into the main prototype. I now had to place the LED so it projects 45 degrees from the lens of the camera with the diffraction grating adjacent but parallel to the LED beam. To quickly test this, I updated my CAD and made two walls, 45 degrees from the main axis of the housing. Then I added a sled to the frontmost wall that I could mound the diffraction grating. This would simulate the user pulling out the diffraction grating.
CAD views of the sliding mechanism (yellow) and the 45 degree walls for the LED and diffraction grating.
Then I build a 3D print of this CAD to test. I hot glued the LED to the back wall. Then I cut a piece of the diffraction grating and hot glued it to the slider. This allowed me to pull the slider out, exposing the diffraction grating the LED beam.
Prototype of the updated LED position and grating.
Then I powered the LED with the 3.3V power pins from the XIAO and gave it a test. The grating was a little bit short but I was able to make some bright rainbows with this setup. I also noticed it was easy to bend the rainbow by slightly bending the grating. So that is a feature I want to explore more in the next iteration.
Raibow projection from the new prototype.
Hardware Development
This section is for the development of the electrical system of Cromira.
Requirements
The electronics need to control a string of Neopixel LEDs, control the brightness of a high output white LED, and have BLE communication to a smart phone.
Component Selection
I started the definition of the electronics in Week 15
Microcontroller
Throughout this class, I have used the XIAO ESP32 C3 to build prototypes of the lighting effects and to build apps. It has Bluetooth connectivity which I need for my app and has also proven to drive both addressable and high power LEDs without any trouble. I have used it over and over in most of my prototypes and will use it as the computing backbone of my device.
LEDS
For the vignette tool I am using a strip of side-emitting addressable LEDs from Adafruit. These are small and similar to the 2020 addressables that I have used for my overmolded prototype in Week 13. I opted for side-emitting LEDs as I can wrap them around the circumference of my device and shine them through the silicone. It will be a more elegant packaging than the standard strips I used in molding week.
For the high power LED I have chosen a 3W White 3535 SMD High Power LED from Amazon. It comes mounted to a 20mm aluminum heat sink and has been working well in testing.
Battery
The battery choice is a tricky one as the device has the potential to draw a lot of power. The maximum current draw for the side emitters (.27 meters to wrap around the device) is .80 amps at full white and brightness. Some of the white LEDs I am looking at are .7A. However, from my packaging restraints (see below) I do not have much room for high capacity batteries. Right now I have decided to test out two, 20C 150mAh batteries wired in parallel for a total capacity of 300mAh. Each battery will be able to deliver a continuous 3A (20C x .15A). So this should be enough overhead to run them. I plan on using the charging circuit on the XIAO, but this needs to be tested.
Prototyping
Since I wanted to dim the high power LED, I chose to control it with a mosfet. I have not done this before so I did a little bit of research including watching this transistor control video from ABID Inc.
Fortunately, we had some mosfets in the lab. I found an N channel 30V 5.2A SOT23-3 that seemed to have the correct specs. I didn't feel like cutting a whole PCB to run a small test, so I got out a Dremel tool and carved out some pads on a piecs of FR1. Then I soldered the mosfet down to the pads and soldered jumper wires to each terminal.
Then I hooked up the mosfet to the XIAO according to the wiring diagram from this Arduino Forum . I used 220 Ohm resistor for the control pin and a 10k resistor to ground. I set it all up on a breadboard and started with a simple 5mm low power red LED. I uploaded a sketch that varies the analog output to the pin and thus the brightness of the LED.
Setup to test the mosfet control
I tested this out with the red LED and it worked great. Then I swapped it out for the white LED. It also looked great and had the correct brightness.
Fading high power LED with mosfet.
Schematic Layout
I used KiCad for the schematic and circuit layout of the board.
Schematic of the Cromira PCB
High Power LED Control
I started by placing the XIAO ESP32C3 on the schematic and placed the mosfet and connected it to A2 on the board since I wanted to have analog control of the mosfet. Then I finished placing the resistors (1206 footprint)
Battery
Since I want the device to run off batteries, it caused some grief in the design. I added 2 battery connectors to the schematic and wired them in parallel to keep voltage but double the capacity. Then I added a switch to the ground wire before it goes into the battery port at the bottom of the XIAO. Fortunately, the XIAO has onboard LiPo charging circuitry, so I did not have to worry about that.
However I did need to boost the voltage from 3.7 to 5V for the Neopixels.
Voltage Booster
I added a boost chip to the board to increase the battery voltage for the Neopixels. For this I used ChatGPT for some design help. I gave it the prompt "can you suggest a common boost converter that is smd footprint". The response was:
Recommended Boost Converters (SMD Footprint): 1. TPS61022 (Texas Instruments) Input: 2.7V–4.5V
Output: Adjustable up to 5.5V
Output Current: Up to 2A
Package: 2×2 mm WSON
Notes: Excellent for high-current NeoPixel applications; needs external components.
- MT3608 Input: 2V–24V
Output: Adjustable up to 28V
Current: ~1.2A max
Package: SOT-23-6
Notes: Very common and easy to use. Works well for small NeoPixel strips.
- SY8008B (Silergy) Input: 2.5V–6V
Output: Up to 5.5V (fixed or adjustable)
Current: 1.2A–1.5A
Package: SOT-23-6
Notes: Compact and low-cost.
- AP3012 (Diodes Inc.) Input: 2.6V–16V
Output: Adjustable
Current: ~1.2A
Package: SOT-23-5
Notes: Very common in hobby projects and cheap modules.
- XC9140/XC9141 (Torex) Input: 0.65V–6.0V
Output: Adjustable
Current: Up to 1A
Package: USP-6B or SOT-25
Notes: Good for low-battery threshold applications.
I used this as a jumping off point and did some searching on Digikey. Eventually I landed on the TLV61070ADBVR chip. I then prompted GPT "what about TLV61070ADBVR". It responded with a circuit diagram and provided resistor and capacitor values that would work for it.
Boost Layout | |
---|---|
With this info I was able to complete the layout of the boost section of the schematic.
Logic Shifter
Since the addressable LEDs are 5V, they need 5V logic for the data pins. I started by searching Digikey for logic shifters with the same SOT23-6 footprint as the boost chip. I found one that was bidirectional and seemed easy to hookup. Then I prompted GPT for some help with the pins. "how do i setup a circuit to level switch using 74LVC1T45 to send data from xiao to neopixels". It responded with a diagram how to properly hook it up.
I connected the 5V from the booster to the level shifter and brought 3.3V from the XIAO. Then I connected pin D10 for the logic. Then I connected the output to the connector for the addressables.
PCB Layout
Once the schematic was complete, I did the layout. I used the layout tool in KiCAD and placed the components. Then I spent a lot of time to moving the parts around to fit. The XIAO and the connector for the addressable LEDs needed to be centered and in a specific location as I had figured out from my CAD files. The rest did not matter too much, but I wanted it to be as narrow as possible inside of a 30 x 42 mm board size.
As I got into the design, I did add a wing to the shape to have room for the logic shifter and good pads for the high power LED.
I had to make the board double sided so that it would fit into my CAD. The connector for the addressable had to be on the bottom to line up with the annulus for the light ring. The XIAO had to be on top of the board so that the USBC port would line up with the lens side of the wall for charging the batteries. The switch had to be on the bottom with the connector so it can be accessed from the outside of the plastic shell.
All of the traces are .5mm so that they are easy to see and to solder to. I did a large ground plane on the bottom of the board to provide easy access to the ground for the vias.
Layout of the PCB
Then I added some additional text on the silkscreen layer and rendered them in 3D to check that everything looked good.
Front view of the board
Rear view of the board
PCB Build
Once the board was done I set out to mill it out on our Roland SRM-20. At the same time I also uploaded the board to JLC PCB and had a batch of 5 made. I did this as a hedge in case I had any issues milling the PCBs.
First Iteration
I exported dxf files from the PCB design of the copper layers and I brought them into VCarve. I started with the bottom of the board (which was a mistake) and setup a series of profile and pockets for the 1/64" endmill. I went down .012" in 3 passes for each trace to make sure I would break through the copper layer. Then I mirrored the top copper layer and placed it symettrically on the workspace such that when I flipped the board it would mill in the correct place. (Spoiler alert, it did not). I added profile cuts for the top layers, then used the drill map to place 1/32" holes using an end mill for the vias and mounting holes. Then I created an edge cut to trace out the shape of the board.
I went ahead and did the milling of the bottom and then the top. However, there were two problems that were apparent when I finished. First was that the holes were not centered on the pads like they should have been. Second, the top side of the board was backwards, so the XIAO outputs were in the wrong spot.
The holes were good in the y direction but off about .030" in x which was strange.
All good reasons to have a second go at it.
Rear of the first PCB. Note the holes not being centered on the circular pads.
Front of the first PCB. Note the front is reversed. I also used this for solder practice to make sure the small parts would assemble ok.
Second Iteration
This time I setup the art the correct way and made 2 boards. I set it up this time to run the top of the PCB first. I started with milling the 1/64" traces before doing the through holes with a 1/32" end mill and then did the perimetter cut with the 1/32" end mill.
Top of the PCB after the front side milling.
Once the front was completed, I used a 3mm endmill to carve out a rectangluar cutout in the spoil board that was .005" bigger than the board. The cutout also had reliefs in the corners and the pocket was .1" deep. This art was done in VCarve. Once the pocket was complete, I flipped the PCB upside down and milled the 1/64" traces on the back of the board, making sure they matched up with the holes. The first time I ran the profile, it was about .030" off but only in the x direction.
Rear of the PCB showing the offset in the milling on the line on the right. This should be closer to the edge.
To compensate, I shifted the zero point .030" to the left and started the cut again, this time everything was aligned. I ran 2 boards this same way. I did 2 boards as I had 2 mills available to me and I wanted an extra in case something went wrong down the line.
Top side of completed board.
Bottom side of completed board.
PCB Assembly
Since I had some small components on my board, I decided to use solder paste for the small components. Before starting I watched a couple of videos about how to solder with solder paste such as this one from P&T IT BROTHER and this one from Dustin Watts. Both of them showed using solder paste without a mask, but I wanted to make one to better control where the paste was deposited.
Creating the Mask
I used KiCAD to export the top side solder mask art as an SVG and I brought it into Adobe Illustrator.Then I saved the art as an Illustrator 8 file and then imported it into Roland Cut Studio to make a cut file for the Roland vinyl cutter. I loaded a small piece of white vinyl leftover from another job and sent the file. In about 30s I had a perfectly cut mask. I weeded the mask to expose where the solder would go.
Weeded vinyl mask
Then I carefully peeled the mask off of the substrate and placed it on top of the board. I moved the mask around until it lined up with the pads on the board and then pressed it into place.
Solder mask applied onto the board.
Then I dabbed solder paste on the mask and used a piece of cardboard to squeegie it over the pads to cover each one. When I pulled it off the pads were perfectly covered with solder.
Applying solder paste to the PCB.
Completed application of solder paste to the PCB.
App Development
This section is for the development of the app to control Cromira.
The app development was started in Week 14 where I used MIT App Inventor to build an app to control the Neopixel color for my custom vignette lens hood.
I will be building on this framework to add another set of screens to control the prismatic projection LED.