Cromira Sprint
This section will document the development of Cromira from Week15, System Integration.
Previous Work
I have worked on Cromira throughout the class including:
Week 4, Electronics Production
Week 5, 3D Printing and Scanning
Week 8, Electronics Production
Week 11, Embedded Networking and Communication
Week 14, Interface and Application Programming
and
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.
CAD Refinement
Once I had the DNA of the device figured out, I invested more time into advancing the CAD. I updated the inner housing of the CAD with a wall for the high power LED. Then I started working on the retraction mechanism for the diffraction grating film. I wanted the film to come out of the side of the housing parallel to the LED and 45 degrees to the main axis of the lens. I wanted the film to pull out and retract. I figured I needed a sprung barrel to provide the retraction force. I did a quick search to look at the retraction mechanism used in tape measures. Then I watched a video by 3D Printy for some inspiration.
Then I went and built a CAD model of a barrel with spiral springs that would fit in my device. Then I printed them to see how much spring force and retraction I could get out of them. I did 3 iterations of the spriral springs. The first one had good spring force but only had about 180 degrees of rotation before it locked out. I kept increasing the diameter and the distance between the coils until I had one that would rotate about 1.5 rotations. With a barrel diameter of 15mm this would give me a bit more than 45mm of travel, which is adequate for the device.
CAD of the coil springs.
3D print of the first iteration of the coil spring.
3D print of the second iteration of the coil spring.
3D print of the third iteration of the coil spring installed on the prototype. This is the design that I took forward in the prototype.
Then I continued updating the CAD to accomodate the new prismatic film system. I added a bump out in the outer shell to hide the barrel. Then I added a pull tab that will lock onto the diffraction grating and all the user to pull it out away from the device to make the rainbows.
Iso view of the updated CAD
I also did a lot of work on the inner part of the device. I reinforced the LED mount and added some additional ribbing. Then I added some slots for the batteries on the opposite side of the device. I added screw holes to keep the inner and outer housings pulled together and channels to hold magnets.
Inner section detail.
Mold CAD
I had to make some mold sections to overmold the LED ring. I used a similar construction that I used in week 13. I made a base component to hold the LED ring. Then I added an inner mold section to form the inner surface of the silicone. Then I tied them together with a center section. The pieces were designed with dowel pins to locate them and with screw holes to accomodate M3 heatset inserts.
Iso of the mold CAD
Cross section of the mold CAD with the silicone snoot.
Prismatic Flare Ring CAD
I made a CAD model of the prismatic flare ring. I set it in the same circular channel as I used for the neopixel ring. Then I did an oversized and scalloped outer ring to make it easier to hold and to turn. Then I made an interior channel to hide a ring of steel to pickup on the magnet to keep in place. Then I split the bodies so that there would be an interior and exterior. I did this to facilitate prototyping as I wanted to use FDM printing to hide the steel ring in the print, but wanted to use resin printing for high resolution printing to match the other bodies. Then the plan is to bond them together with super glue and pinch the piece of diffraction grating between them.
Isometric of the prismatic ring
Crosssection of the prismatic ring showing the embedded ring of steel (pink) and the two-piece construction with the diffraction grating.
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.
Assembly
Once the solder paste was placed, I started placing components on the board. I did all of the SMD components on the top side of the board including all of the resitors, capacitors, and ICs. Once they were placed, I used a heat gun set at 400C and 10% flow to heat the contacts on each part and melt them into place.
Then I inspected the joints under a magnifying glass and used a soldering iron to add solder in some areas that looked weak.
Assembly of the SMD components
It was then I realized I had a problem. Since I do not have a hot plate in the lab, there was no way I could get get enough heat on the battery contacts to make good contact. So I decided to make a slot in the board to expose the battery contacts and I would jumper the battery for now.
I created a slot geometry in VCarve, put the PCB back in the mill and made the slot. Then I was able to have acces to the battery pads and I was able to hand solder the XIAO to the board.
Slotted PCB
Slotted PCB after XIAO was mounted.
PCB Testing
Once the PCB was built I started testing it I started with the mosfet side of the circuit first. Initially I did not solder in the battery as I wanted to test the rest of the circuit before adding that layer.
Mosfet
Mosfet testing was pretty straight forward as it is a straightforward code. I used an analog fade code that I used a few weeks ago and loaded it to the XIAO. Then I soldered a standard 5mm blue LED to the LED terminal.
Immediately, the blue LED faded up and down predictably with the code.
Voltage Boost
Then I turned attention to the voltage boost. For this I had to solder a jumper from the 3.3V pin to the top of the inductor. It was setup to be wired from the battery, but without the battery I needed some voltage to boost.
The code here was pretty straightforward too. I had to send a digital high signal to the enable pin to intiate the boost. In the same set of code I also added a blink routine on my neopixel pin to see if I could get the boosted voltage to drive the logic shifter.
boost test | |
---|---|
I found that the voltage boost circuit worked well as I was able to get 5V at the output of the circuit. However, the logic shifter did not output 5V as it should have. I was not too excited about this as it is an optional component since the neopixels do seem to be fine with 3.3V logic.
Battery Test
Then I turned attention to adding the battery. I soldered the JST connectors on the bottom of the PCB. Then I had to add some jumpers to connect the battery pads on the XIAO to the traces on the bottom of the board. I found a Lipo battery in my stash of components with a JST connector with the correct polarity and plugged it in.
Intitally, the circuit did come alive. However, during the first few minutes of testing the XIAO became hot and stopped being responsive. I unhooked the battery and tried to ohm the circuit to see what was wrong. After checking a number of points on the circuit and reflowing some of the pads I am sad to say that I never really found the culprit. I suspect I accidentally shorted something on the bottom of the PCB during testing. I did find that the boost chip was not responding. So, I replaced it with a new one. After that the PCB came back to life and I was able to finish testing all of the systems.
V2 PCB
After the learnings from the first PCB, I decided to make some key changes and build a new PCB. I just felt there were too many jumpers and modifications that could potentially cause trouble later on.
Design
I archived a version of V1 and set out to update the design. I started by taking the logic shifter off of the board. The neopixels are stable with 3.3V logic and I did not get it to work anyway. I also opted to add 2 single color 1206 LEDs to the board, one on the top side and one on the back. My thought was that I could use the one on the back for some user indication if possible.
I also updated the way I am connecting to the battery. I removed the booster from the battery and tied the input to the 3.3 pin on the XIAO. Then I moved the switch to the positive side of the battery. Then I created a cutout under the battery inputs on the bottom of the XIAO. I noticed that I could use some male headers with their bent geometry to step up from the XIAO to the PCB. This felt like a cleaner way to handle the battery power.
Updated schematic
Updated PCB design showing all layers
Rendering of the front
Rendering of the rear
Build and Assembly
This iteration of the PCB was made the same way. DXF files were exported from KiCAD and brought into VCarve. Then a mix of pockets and profile cuts were made to create the traces in the board. Again, this is a 2-sided board, so I had to flip the board and confirm the alignment before cutting the bottom side.
Top of the V2 PCB after milling
Aligning the bottom cut with the holes from the top. This time I colored over the hole with a black Sharpie, then ran circular profile around the hole just deep enough to remove the Sharpie. I then adjusted the zero of the machine until it was concentric.
The bottom of the board after machining was completed.
Masking the PCB with a custom cut vinyl mask before applying solder paste.
Passive components soldered to the top of the board
Adding an SMD jumper to tie the battery pads on the bottom of the XIAO to the traces on the bottom of the board.
Test
Then I went ahead and tested the board. I started simple and did a blink an LED routine on the new LED on the front side of the board. This worked fine so I carried on.
Testing the blink routine on my new board.
I tested the mosfet and the voltage booster and those are acting as anticipated since the changes that were implemented after the first board.
On the day I finished the board I alse received the side emitting LEDs that I am going to use. I uploaded my full BLE code from Week 14. This worked fine for a while driving 50 LEDs. Then the device got hot and the color faded. Something saturated and the current dropped to the LEDs. Options to work around this would come later.
Testing the neopixels before they started pulling too much current and choking it out.
Neopixel PCB
I also designed a small PCB to interface the Neopixels to a male connector that would mate with the main body of the device. This was a simple right angle set of traces from the male header pins to the neopixel strip.
Simple schematic of the board
Board design showing the right angle connection and the surface mount connector. I also added a couple of holes incase I needed them to lock them onto the Neopixel ring.
Cut neopixel board.
Once the mechanical design was further along I assembled the board into the 3D print and wrapped the neopixels over the board. This allowed me to just bridge the solder from the board to the LED strip so it was easy and painless. Then the male connectors on the ring plugged into the female connector on the main board.
Cut neopixel board.
PCB V3
During the course of testing I fried my V2 board. I hooked up the LiPo battery and the board started smoking. I turned off the power and let it cool down. The inductor had burned up and destroyed the traces around it as well. Once the board cooled down I removed the burned component and retested the other systems. Generally the board was fine. The cause of the failure was the the inductor was undersized (.75W capacity) and it needed to be about 3A. Chat GPT had recommended that but I changed it to a smaller one because it would fit better.
All that to say, I needed to update the inductor so I decided to do a 3rd rev of the board.
Burned up V2 board
Design
I specked out new inductor that is rated to 4.5 amps and moved a few parts around on the board. I cleaned up everything below the XIAO and moved the vias so that there are none underneart the XIAO so the XIAO would sit flat on the board.
I also added resistor pads between 3.3V and the circuit and between the battery and the circuit. This was so I could short one line or the other to connect the circuit to the regulated 3.3V or to the battery.
V3 schematic
V3 design
V3 render of the top
V3 render of the back of the board
Build and Assembly
I used the same technique as the last 2 board designs to make the new board. I exported dxf files, brought them into VCarve, created cut files and ran the boards on the Roland SRM-20.
Top of the board during machining
V3 board after machining.
Testing
Once the board was assembled I tested all of the functions. It was able to create outputs for the discreet LEDs as well as the neopixel ring. Then I tested the battery and there was no smoke this time! Then I added the high power LED with a 2.2Ohm, 1 Watt in series with it.
I used the Digikey Resistor Calculator with the specs from the LED to choose the resitor. The calculator said a 1 Ohm, so I bumped it up a little to cut the current just a little bit.
Resistor calc for the high power LED.
Testing the V3 board with the battery and the high power LED.
Code
There were just a few modifications to the code that I developed in the Week 14 Interface assignment. I used the same core of the code and added on some extra services. I added a service for the high power white LED and a service to turn the neopixel to a scrolling rainbow. Then I added new conditional expressions to turn the high power LED on if it recieved a value from a slider on the app and a conditional to run the rainbow routine if the rainbow button on the app is pushed. I also added some power saving functionality as I added code to turn the neopixel ring off if the high power LED is on and to turn the high power LED off if the neopixel ring is on. They do not need to be on together for the photo effects and I do not want to needlessly drain the battery.
This code was tested concurrently with the app to make sure the LEDs acted as expected.
cromira_060725.ino | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
App Development
The app develpment was straightforward as I had a good baseline from my work 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 was originally going to do multiple screens but opted insted to do a single screen to do the orignal function of making a contant color vignette ring, a rainbow vignette ring, and lighting the white LED for the rainbow projections.
All I had to do was add a button to trigger the rainbow effect and add a slider to control the brightness of the white LEDs. Then I updated the code for the elements to send the correct values to the XIAO.
I added initialization of the two additional services to the startup part of the screen and setup the new services in the "When Bluetooth Connected" block. I added a section for the white LED to the "When Send Color (button) Clicked" section to send the value for the white LEDs. Then I updated some things in the "when sliders position changed" area. If any of the RGB sliders were moved I automatically set the white value to zero and reset its slider to zero. If the white slider was moved then I set the RGB sliders and values to zero. This way the white high power LED and the neopixel ring would never be on at the same time.
Finally, I added a button to trigger the rainbow effect. I just made an "on rainbow button click" routine and had it send a number 1 to the app.
Updated design for the app showing the rainbow button.
Updated app code to handle the additinal services.
The app was tested concurrently with the XIAO code to make sure everything acted as expected.
Testing a version of the app.
Prototyping and Testing
After all of the CAD and design work it was time to protype. I started by using Form 4 3D printers to build the shells and the prismatic rings. I used the Black V5 material as I wanted the final product to be black to match the camera and the only thing I would have to do to make it look good was to sand and clear coat it with no extra painting.
Preform setup for the inner chassis of the system for the v5 black resin. Note, I oriented the part so that the support material would not interfere with the lip and groove features.
Preform setup for the prismatic rings.
After the print I took off the supports, cleaned them in alcohol and cooked them for 15 minutes at 60C in the Form UV oven. Then I did a dry test fit to verify the shells fit together properly.
The 3D printed shells fresh off the printer.
Then I kept the shells together and did some major sanding. The parts were very rough and faceted and needed a deep sand. I started with 60 grit sandpaper and slowly worked up to 320 grit to get them smooth.
Starting to sand the shells.
At the same time I did an FDM print of the LED ring. I printed it in black, but then changed to a metallic tri-colored PLA for a pop of color on the ring. Then I did a pause in the print to add magnets inside the part.
The pause in the LED ring print to add magnets
With the LED ring finished, I was able to test fit it in the shells during the sanding process. I had to sand the LED ring and the channel that it fits so the fit would be smooth.
The pause in the LED ring print to add magnets
Once the shells were fully sanded I used clear coat paint to bring the black back to life and to give it a slightly textured finish to make it look like a camera product.
Clear coating the plastic shells.
While the shells were drying I worked on the prismatic ring. I used the waterjet to cut .030" thick steel rings to magnet to the main body of the device. These were eventually inserted into a paused FDM print to bury them inside plastic.
Waterjetting the steel rings for the prismatic ring.
The LED ring was assembled with the LED strip and its connector board. The PCB and the strip were held down with double-sided tape. Then I tested the ring by uploading a sample neopixel program to make sure that it was working properly before burying it in silicone.
Testing the LED ring after building it up.
The mold was printed on Prusa MK4S FDM printers. To speed things up I did one part on a different printer. Then the molds were test fitted to each other and to the LED ring. Some light sanding and deburring were necessary to get everything to fit together properly.
Test fit of the molds.
Then they were sanded starting with 60 grit and up to 320 grit sandpaper to smooth the layer lines. Once sanded the parts in contact with the silicone were painted with primer to fill in the gaps.
Painting one of the mold halves.
All the mold pieces ready for assembly.
Then the molds were assembled with the LED ring inside. The Smooth-On Sort-Clear 15 was mixed up in 1:1 by volume ratio and poured into a syringe before injected it into the mold. It was then put in a small pressure pot and pressurized to 25psi.
Injecting the silicone.
Mold going into the pressure pot.
While the LED ring was curing it was back to the main body of the device for more assembly work. I installed M2 threaded inserts into the shells.
Inserts intalled.
More inserts intalled.
Then I assembled the diffraction wheel and springs. I printed a barrel for the diffraction grating on an FDM printer. Then I used the diffraction grating film that I cut from my concept modelling work and bonded it to the barrel with a piece of vinyl adhesive.
Bonding the diffraction grating to the barrel.
Then I printed some of the same design springs that I had made before. I installed M2 inserts into the springs and slid them over the square end of the barrel. I used a touch of super glue to bond the springs to the barrel. Then I used button head M2 screws to mount the barrel to the inner ring of the device after threading the film through the slot in the inner ring.
Diffraction grating assembled into the unit.
Then I installed the PCB with some M2 screws.
PCB installed.
I then inserted a battery into the battery slot and carefully wired it into my PCB by soldering it to the battery pads.
Battery tucked away in its slot and soldered to the PCB.
Then I switched attention to the prismatic ring. I used the Zund cutter in the lab to cut circles out of 2 different types of diffraction grating. I used the standard Z10 knife on the simple circular path.
Cutting diffraction grating with Zund.
Installing the grating into the ring.
Then I put the shells together for a test fit. I slid the outer housing over the inner and pushed it until friction locked toegher. Then I added the pull tab to the diffraction grating film and tested the pull. Then I put the full device on the camera to verify that it fully fit.
First full intallation of the device with the diffraction ring installed.
By this time the LED ring was ready to demold. I took it out of the pressure pot and removed the screws holding it together. Fortunately, I had put some pry slots in the design, so I was able to pop it apart (with some effort) with a pair of screwdrivers. The part came out great save for a slight under-fill in a couple of areas on the outer edge of the ring.
Demolded LED ring.
Then I test fit it onto the main body of the device to check the fit (and admire it).
Test fit of the LED ring.
Then I flashed the XIAO with a sample neopixel program and made sure all was still working. Fortunately the LEDs came to life!
Testing the LEDs on the full device.
I still had a few small things to tidy up on the inside of the device. So I pulled it back apart again. Then installed the magnets on the back side of the inner shell. I made sure to test them on the LED ring to make sure their polarities were opposite when brought together.
Pressing in the magnets.
I then had to wire in the high power LED. I made a wire for it and spliced in the 2.2 Ohm 1 Watt resistor into the ground line. Then I soldered the LED to the pads on the board.
Wire for the LED installed with the resistor.
Bill of Materials
The total BOM cost for the components and materials was similar to predicted. However, I added the 1W reistor, updated the inductor spec, and added the clear coat paint. The total is $242.91
Design Files
Mechanical
Electrical
App
License
This work is provided under license BY-NC-SA 4.0. This license enables reusers to distribute, remix, adapt, and build upon the material in any medium or format for noncommercial purposes only, and only so long as attribution is given to the creator. If you remix, adapt, or build upon the material, you must license the modified material under identical terms.