Skip to content

Commit 338ae38

Browse files
committed
Update
1 parent dcd05ce commit 338ae38

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

_posts/2024-11-29-raspberry-pi-pico-controller.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -15,36 +15,36 @@ The Raspberry Pi Pico is a powerful microcontroller that can be used for a varie
1515
As my modular biped robot is inspired by BD-1 from the Star Wars: Jedi games, I thought it would be good to keep that theme going for this modular controller.
1616
I designed the project to resemble a lightsaber hilt, with neopixels spread out along each module so that various effects could be displayed.
1717

18-
The project includes an 18650 battery connected to an uninteruptable power supply (UPS) module, a Raspberry Pi Pico, and a selection of addressable LED neopixels. The controller is housed in a 3D printed case with a button and joystick for user input.
18+
The project includes an 18650 battery connected to an uninterruptible power supply (UPS) module, a Raspberry Pi Pico, and a selection of addressable LED neopixels. The controller is housed in a 3D printed case with a button and joystick for user input.
1919

2020
I wanted to create a design that would allow me to experiment with modules, so that they could be swapped as needed depending on the project. I opted to use magnetic connectors to create a 5v bus and a pair of wires to connect the Pico to the neopixels in each module.
2121

2222
## Designing the UPS module.
2323

2424
Initially I wanted to create my own power management board with a custom PCB that would convert the battery voltage from the 18650 to 5v, and also allow charging via a TP4056 charging module. Both modules are cheap and easy to source. I added them to a perfboard, but there were a couple of issues.
2525

26-
The first problem was that the TP4056 is not designed to charge the battery if there is a load on the output, in other words, the project needs to be switched off while charging. Normally that isn't a problem but in this instance I wanted the project to be always on, and allow the battery to work as an uninteruptable power supply, so that the battery supplies power when disconnected from the charger.
26+
The first problem was that the TP4056 is not designed to charge the battery if there is a load on the output, in other words, the project needs to be switched off while charging. Normally that isn't a problem but in this instance I wanted the project to be always on, and allow the battery to work as an uninterruptible power supply, so that the battery supplies power when disconnected from the charger.
2727

2828
The second issue was just that the custom board didn't fit very well within the project, so I started looking at alternatives.
2929

3030
There are a selection of 18650 UPS modules available from various suppliers, and they looked promising. Unfortunately I had huge trouble getting an order to go through, presumably because of stock issues I had three separate orders cancelled.
3131

32-
Luckily, I was contacted by Zach from Wildware.net who offered to help. The project had been on hold for weeks because of this issue so it was great to get things moving again. If you'd interested in getting one of these modules for yourself I'll include the link to the listing on the wildware website in the bill of materials.
32+
Luckily, I was contacted by Zach from Wildware.net who offered to help. The project had been on hold for weeks because of this issue so it was great to get things moving again. If you'd be interested in getting one of these modules for yourself I'll include the link to the listing on the wildware website in the bill of materials.
3333

3434
Once the module arrived I began to experiment.
3535

3636
The board is comprised for 3 main areas:
3737
- The charging module for the battery, with a 5v input (either by USB-C or direct header connection) and the battery connection.
38-
- The DC-DC converter to ouput a fixed 5v from the battery voltage.
38+
- The DC-DC converter to output a fixed 5v from the battery voltage.
3939
- A pair of headers in the center of the board that are used to enable the DC-DC converter. This means you can attach a switch to kill the power to the converter when the board isn't in use and prevent drain of the battery as much as possible.
4040

41-
The board also has a 18650 battery holder in place. This is normally perfectly useable, but for this project I wanted to remove some of the bulk, so I de-soldered that holder, removed the connectors, then soldered them in place directly.
41+
The board also has a 18650 battery holder in place. This is normally perfectly usable, but for this project I wanted to remove some of the bulk, so I de-soldered that holder, removed the connectors, then soldered them in place directly.
4242

43-
Next, I designed and 3d printed a holder for the board an battery to make the UPS module as slim as possible.
43+
Next, I designed and 3d printed a holder for the board and battery to make the UPS module as slim as possible.
4444

4545
### UPS Wiring
4646

47-
The wiring became complex for a couple of reasons, I needed to connect power to a couple of neopixel strips that would sit on either side of the module, and also to the magnetic connectors that would feed power to the other modules in the project.
47+
The wiring became complex for a couple of reasons; I needed to connect power to a couple of neopixel strips that would sit on either side of the module, and also to the magnetic connectors that would feed power to the other modules in the project.
4848

4949
The magnetic connectors can be ordered pre-wired, so I just needed to connect all the 5v wires together to the output of the converter, and the same for the negative wires.
5050

@@ -58,7 +58,7 @@ If that sounds confusing, imagine how I felt! See the diagram below for more inf
5858

5959
## Pico Module
6060

61-
Next I needed to test that the setup connected the neopixels to the pico. I create a test rig that allowed me to screw a magnetic connector to a breadboard, wired up the raspberry pi and uploaded a basic script to change all of the neopixels to the same colour.
61+
Next I needed to test that the setup connected the neopixels to the pico. I created a test rig that allowed me to screw a magnetic connector to a breadboard, wired up the raspberry pi and uploaded a basic script to change all of the neopixels to the same colour.
6262

6363
The pico module has a couple of functions that I wanted to talk about.
6464

@@ -70,25 +70,25 @@ Finally, I wanted to include some kind of presence sensor so that I could dim th
7070

7171
Once I assembled this wiring I found that everything worked as expected, with a few tweaks. The problem was that the wiring was difficult to reproduce, and I wanted others to be able to follow this build themselves, so I jumped into KiCad and designed a PCB.
7272

73-
This new PCB included all of the connections so that the modules could be soldered in place without complicate wiring. I also included headers to connect the same magnetic connectors to complete the board.
73+
This new PCB included all of the connections so that the modules could be soldered in place without complicated wiring. I also included headers to connect the same magnetic connectors to complete the board.
7474

7575
PCBWay kindly offered to sponsor the creation of this PCB.
7676

7777
## 3D Modelling
7878

7979
At this point I was keen to see how this would work as a self-contained module, so I got to work creating a 3d design to house it all. Because I wanted to base the design on something from the Star Wars universe I found a paid 3D model for the 'serenity' lightsaber from Star Wars Jedi Survivor and printed it so I could get a feel for what works and what I'd like to change. Then I started designing a real-world version, using OnShape.
8080

81-
I'll admit it took me much longer than I expected to create this design. I had a few rules that I wanted to follow that definitely made it harder, like including the ability to assemble and dissassemble the main modules without using tools. That definitely limited my options, but it was a good challenge to improve my 3D modelling skills.
81+
I'll admit it took me much longer than I expected to create this design. I had a few rules that I wanted to follow that definitely made it harder, like including the ability to assemble and disassemble the main modules without using tools. That definitely limited my options, but it was a good challenge to improve my 3D modelling skills.
8282

8383
Similarly, I wanted to avoid glue and screws wherever possible so that the components could be removed easily.
8484

8585
I also wanted to include a 3d printed screw thread connector between modules so that I could create a standard design pattern for adding or swapping modules in future. This took a few attempts to get the right tolerances for my 3D printer, but now these modules screw together easily and feel stable when they're connected.
8686

87-
The current versions looks something like this. There are definitely improvements I'd like to make, but the good thing is I can re-design and print new modules as often as I need to.
87+
The current version looks something like this. There are definitely improvements I'd like to make, but the good thing is I can re-design and print new modules as often as I need to.
8888

89-
Each module includes the same 4 pin magenetic connectors on the top and bottom (unless they're an end piece), so they can be stacked and swapped.
89+
Each module includes the same 4 pin magnetic connectors on the top and bottom (unless they're an end piece), so they can be stacked and swapped.
9090

91-
The emitter includes a smaller screw thread that allows it to be swapped, and when I started testing I could see that this white PLA piece would let the light from the emitter neopixels bleed through, which I wasn't pleased with. I reached out again to PCBWay and they offered to re-print not only the emitter, but the surround for the UPS in alluminium.
91+
The emitter includes a smaller screw thread that allows it to be swapped, and when I started testing I could see that this white PLA piece would let the light from the emitter neopixels bleed through, which I wasn't pleased with. I reached out again to PCBWay and they offered to re-print not only the emitter, but the surround for the UPS in aluminium.
9292

9393
These pieces have a great finish and make the whole build feel more sturdy and realistic. I love how they create the illusion of an internal core that runs through the hilt and the metal makes the build heavier and more satisfying to use.
9494

@@ -102,7 +102,7 @@ Once everything was printed the assembly was straightforward and didn't need any
102102

103103
## Next Steps
104104

105-
I mentioned earlier that this was a Pico controller, but what exactly will it control? Well the good news is that the Pico includes Wifi and Bluetooth modules, so you can easily write code to connect to other IOT devices and send or recieve commands, so the plan is that I can use this build to control other builds with the joystick and buttons. It also means that I can add more control options in future if I want to, so watch this space for future changes.
105+
I mentioned earlier that this was a Pico controller, but what exactly will it control? Well the good news is that the Pico includes Wifi and Bluetooth modules, so you can easily write code to connect to other IOT devices and send or receive commands, so the plan is that I can use this build to control other builds with the joystick and buttons. It also means that I can add more control options in future if I want to, so watch this space for future changes.
106106

107107
I'd love to be able to connect the joystick to my modular biped and use it to control the head, animations, or even the legs in future.
108108

0 commit comments

Comments
 (0)