This page contains the main assembly instructions for the musical
box, removed to here from the main
page as they are quite detailed; not that many pictures
here, sorry, there was just too much detail to capture and no
time. Addition of the trim and decoration is not covered
here, see the main page for that. Printing instructions for
the 3D printed parts, as well as the parts themselves, can be
found on Github.
In general, it is worth having a stock of:
hex head bolts (e.g. M2, M2.5 and M3 of various lengths),
pan head bolts (e.g. M3 of various lengths),
hex head grub screws (e.g. M3 of various lengths),
0.1 inch pitch connector female pins, plus the
crimping tool to go with, and housings (e.g. 1, 2 and 4 way),
7-strand strand in red, black and a few signal colours
(e.g. yellow, white, blue),
In "What you should have": you will need the M3
tap.
In the list of "Hex socket screws": one of the
M3 x 10 mm screws (the one to hold the
thumbscrew knob in place) becomes an M2 x 8 mm
screw, two additional M3 x 8 mm
(M3 x 10 mm would do) screws are required to
attach the motor and one M3 x 6 mm hex head
grub screw is required to anchor the knob on the motor
spindle. Note that the length of the grub screw is
critical, it cannot be longer than 6 mm or it will stick
out, preventing rotation. Oh and of course the M6 screw is now
60 mm long and
fully threaded.
In "Preparation and Gluing": the white ASA parts 13 and 14
need to be glued onto the base (part 2) and part 7
respectively in order to support use of the sensors.
In the sub-section "Make sure the spindle elements fit
together": the "green" part now looks a bit different.
The square end is still there but it has retreated down inside
the part, see picture below. I found that the screw was
a very good fit in the plastic, no glue was required on the
shoulder of the screw, however on one assembly I did manage to
end up with a wiggle: the screw and plastic part put together
were not straight. To remedy this, after tightening the
bolt in the "orange" part, it is a good idea to grip the screw
lightly in a drill and spin it, adjusting the position of the
plastic part to make sure it is fitted straight.
Ignore the section "Make sure the spindle can turn".
In the section "Assemble the first 4 telescopic elements to
the bottom plate": when inserting the front-right screw,
include in it the new part 12, which slides behind
part 13.
In the section "Assemble the spindle, spindle holder and
thumbscrew knob", do this instead:
When assembly has been completed, make sure that the new
part 14 drops into its slot in the base:
Having completed Michael's original assembly, attach the
stepper motor, which fits inside the heavily modified thumbscrew
knob, as follows:
turn the thumbscrew knob until the lift is at about half
height (so that you can get at things easily),
sightly release the grub screw,
rotate the spindle of the motor so that the grub screw
meets the flat and push the spindle into the hole in the
thumbscrew knob,
insert two M3 x 8 mm bolts to hold the motor
in place, but only loosely,
push the thumbscrew knob back towards the motor, so
that you can definitely see a gap between the thumbscrew and
part 8 as indicated in the second picture below, as well
as a gap on the other side, then tighten the grub
screw,
tighten the two M3 x 8 mm bolts holding the
motor.
Finally, to hold the thing that will be on top of the lift in
place, glue a small round neodymium magnet (I used a 20 mm
diameter, 1 mm thick one, which will cost you 5 gm of
your lifting capacity) to the indentation on the underside of
the top of the lift.
Note: due to a shortage of space, the 3.3 V and ground
lines of the two sensors were later commoned into a single pair
of connections.
Here is the lift running some test
software that uses the sensors:
7-strand wire in red, black and a few signal colours (e.g.
yellow and blue),
slightly thicker wire with red and black or otherwise "main
input/supply" type conductors (for the power input),
0.1 inch pitch housings (1-way, 2-way and 4-way) plus
female and one male pin to go with, and the crimping tool.
You will also need an M3 tap.
Assembly, in no particular order:
fix the plinky-plonky mechanism into place with its three
fixing screws, handle facing the stepper motor mount,
fix the voltage regulator into place using four of the
M3 x 5 mm pan head bolts, input end nearest the
cable inlet hole of the box,
clip the ESP32 and TMC2209 boards into their mounting
positions, the TMC2209 oriented with its red connector nearest
the voltage regulator board, clipping the right hand of both
boards in first (when viewed with the lettering the right way
up),
make up a QRD1114 sensor
according to the schematic on the main page,
with the 150 Ohm series resistor and the 10 kOhm
pull-up resistor incorporated into the cable, heat-shrink
employed as necessary, wires 120 mm long (see picture
below [of the slightly longer version used later for the Sides, Top And Doors of the
musical box]); try not to have the resistors in the same place
in the cable since space is very tight, you don't want the
cable being wide anywhere, and it may be best to thread the
cables through first (see next step), adding the 0.1 inch
pitch pins and housings afterwards,
push the QRD1114 sensor cables down into the QRD1114
mounting hole (see picture below) and thread them through to
the boards area,
push the QRD1114 sensor down into its hole, ending with the
top of the sensor flush with the surface,
run an M3 tap through the grub screw hole in plinky_plonky_mount_wheel,
hook plinky_plonky_mount_wheel
over the handle of the plinky-plonky device, push the stepper
motor spindle into the centre of plinky_plonky_mount_wheel from
the other side of its mounting bracket and attach the stepper
motor to the mounting bracket with the two hex head bolts,
screw the grub screw into plinky_plonky_mount_wheel and
against the flat of the stepper motor spindle, making sure
there is a gap between the wheel and the stepper motor
mounting bracket,
trim the stepper motor wires and terminate them in a 4-way
0.1 inch pitch connector, ordering as in the schematic
below,
wire up the ESP32 and TMC2209 boards according to the
schematic below, bringing 5 V from the output of the
voltage regulator and 12 V from the input of the voltage
regulator; 3.3 V needs to be supplied from the ESP32
board both to the TMC2209 board and to the QRD1114: since this
is only a two-way split the simplest way to serve power to
both is to make a short splitter cable with a wire having a
male 0.1 inch pitch connector on its end splitting off
from a wire with female 0.1 inch pitch connectors on both
ends (see picture below),
run some beefier cables to the 12 V input of the
regulator board and pass them out of the hole in the side,
tying a knot in them just inside the hole to act as strain
relief,
supply 12 V across these cables and you should get a
red light on the ESP32 board,
plug a PC on which the ESP-IDF environment has been
installed into the USB socket of the ESP32 board: a USB device
should appear on the PC (e.g. /dev/ttyACM0 on Linux),
compile the ESP32 software from Github
with all of the *_PIN
flags set to -1 and the flag CONFIG_STEPPER_NO_WIFI set and
download the binary to the ESP32: the motor should rotate for
a few seconds (it may rotate a little, stop and then rotate
again, since the pin of the ESP32 comes up by default on),
re-build the stepper application with the flag CONFIG_STEPPER_PLINKY_PLONKY_REFERENCE_PIN
set to 4 and then, without any bright lights shining towards
the QRD1114 sensor, flash the built image onto the ESP32: the
motor should rotate as before, rather faster (it is set
playing at double speed), for up to 30 seconds this time, and
should stop rotating if you place your [reflective] finger
over the sensor,
insert plinky_plonky_mount_reflector
into its hole beside the QRD1114 sensor, leaning over the
QRD1114 sensor, the right way around (see picture),
push in the brass bar from the side through the mounting
brackets, placing the roller onto it as it goes (better to do
this than clipping it in from the top as that risks breaking
the brackets); you will need to remove this later when adding
music,
screw the lid down with the remaining
M3 x 5 mm pan head bolt, fit the motor cover
(it fits loosely) and plug in the USB blanking plug,
if you have a music
belt printed, you may install it in the plinky-plonky
mechanism according to the instructions
on the main page; unbolt the plinky-plonky mechanism to
do so,
that is it: the plinky-plonky mount will be connected to
the Raspberry Pi in the Stand in the
final Protection stage.
Assembly of the box starts with the stand, where all of the
power and control lies, and works upwards, the bottom part being
split into three as it is the most complex.
Stand
Components:
all of the 3D printed parts for the stand, printed
according to the instructions on Github,
one each of the 3D printed parts bottom_esp32_mounting_plate_x7
and bottom_tmc2209_mounting_plate_x7
(see Github),
a slip-ring
with at least three through-wires (the barrel of mine was
12.5 mm in diameter, the rim 24 mm in diameter with
three equally spaced holes 2.5 mm in diameter, the
stick-out at the top was 5 mm in diameter/2 mm high
and the entire thing was a total of 18 mm deep),
an ESP32-C3
board with headers soldered in on the component side,
a BigTreeTech
TMC2209 board with heatsink glued on and the "sticky
out" pins on the underside trimmed off,
a 3.3 V
FTDI board; if you have a 3.3/5 V one, don't forget
to move the jumper to 3.3 V,
a Raspberry
Pi Zero 2W (or Zero W, it does not matter which) without
header, with SD card (any size),
7-strand flexible wire in red, black and a few signal
colours (e.g. blue, white or yellow),
slightly thicker wire with red and black or otherwise "main
input/supply" type conductors (for the power input),
0.1 inch pitch housings plus female pins to go with
and the crimping tool of course.
Assembly, top:
glue the upper and lower parts of the stand together with
cyanoacryate adhesive; the fit between the two is not a tight
one so be careful to centre the two parts as you glue and to
align the USB socket exit hole (and of course make sure the
fixing holes for the lid face outwards),
bolt the motor extension into place with the two M3 x 10 mm
hex head bolts,
put a free-wheeling pinion gear onto each of the short
lengths of brass bar, followed by bearings either side, then
push these assemblies into the two short slots, with the gears
the right way around (i.e. their curvature matching the
circle) until the bearings are firmly home,
put the fixed pinion gear onto the long length of brass
bar, respecting the flat, and again add bearings either side,
tap the grub screw hole in the knob/spindle adapter with an
M3 tap,
push the knob/spindle adapter onto the other end of the
long length of brass bar, respecting the flat,
push this assembly home into the remaining long slot,
push the stepper motor into the other end of the spindle
adapter, respecting the flat and threading the stepper motor
cables through the hole in the corner of the motor extension
as you do so: make sure the spindle is as near to the motor as
possible (to avoid fouling rotating things above) but can
still rotate freely, then tighten the grub screw,
fix the stepper motor in place with the two
M3 x 5 mm hex head bolts.
Turn the stand over to address the components on the
underside:
clip an ESP32 board and a TMC2209 board into their mounting
plates, holding the mounting plates with the text the right
way up the TMC2209 should have the red row of pins at the
bottom; to avoid damaging the boards, as you are looking at
the text on the mounting plate, the TMC2209 board can be slid
in from below while the left-hand (non-USB) side of the ESP32
board should be clipped in first,
run a little cyanoacrylate adhesive into the slot in the
middle of the electronics plate and then, holding the two
board mounting plates back to back with the sticky-out bit of
the sides of the boards at the bottom, push those sticky-out
bits into the slot,
glue into place the FTDI mounting plate (with the lip
furthest from the rim) and the electronics plate with
cyanoacryate adhesive,
clip the FTDI board into the mounting plate, USB facing
towards the opening in the side of the stand,
test fit and then remove the FTDI mounting plate top (you
will fit it properly later): it should hook over the
connectors at the rear and fit over the two clips on the sides
of the lower part of the mounting plate, deliberately a tight
fit as you'll want to shove a USB connector into the FTDI
board later, and do make sure that the
lid is able to lie flat,
solder the 90 degree header onto the Raspberry Pi Zero
2W,
fix the Raspberry Pi Zero 2W into place with the four
M2.5 pan head bolts; do not tighten them too much are
you may crack the PCB,
fix the 5 V regulator board into place with four of
the M3 pan head bolts, "out" connections nearest the Raspberry
Pi.
Wiring and initial software setup:
before you begin, write a [probably 32-bit] headless
version of Raspbian to an SD card using the Raspberry
Pi Imager, making sure to enable SSH and a connection to
your Wifi, probably call it "MusicalBox", and plug it into the
Pi [a Pi Zero W does not even give you a green light unless a
bootable SD card is inserted]; at this point the cautious
person would temporarily plug USB power into the Pi and check
that it (a) boots and (b) is visible on their Wifi network,
make the connections between the voltage regulator, Pi and
FTDI board (the upper half of the schematic above) with
appropriate 0.1 inch pitch housings,
run some beefier cables to the 12 V input of the
regulator board and pass them out of the hole in the stand,
tying a knot in them just inside the hole to act as strain
relief,
supply 12 V across these cables and you should get a
green light on the Pi,
carefully plug a PC into the USB connector of the FTDI
board, launch a serial terminal and you should be able to log
in to the Pi,
now that you have confirmed that the FTDI board is working,
run some cyanoacrylate adhesive along the outside edges of the
clips on the lower part of the FTDI board mounting plate and
shove the top on; it won't be coming off again (hopefully),
find the Pi on your Wifi network and you should be able to
log into it over SSH also,
attach individual 0.1 inch pitch housings to the
stepper motor wires (a single 4-way housing is too wide to get
out again through the wiring hole) and plug them into the
TMC2209 board according to the schematic,
make the connections to and between the TMC2209 and ESP32
boards (the bottom half of the schematic above), putting the 1
kOhm resistor in-line in the wiring (see picture below), the
bare wires enclosed in heat-shrink,
supply 12 V again and a red LED should light on the
ESP32 board,
plug a PC on which the ESP-IDF environment has been
installed into the USB socket of the ESP32 board: a USB device
should appear on the PC (e.g. /dev/ttyACM0 on Linux),
compile the ESP32 software from Github
with all of the *_PIN
flags set to -1 and the flag CONFIG_STEPPER_NO_WIFI
set and download the binary to the ESP32: the motor should
rotate for a few seconds (it may rotate a little, stop and
then rotate again, since the pin of the ESP32 comes up by
default on),
follow the instructions in pi_wifi_ap.md
to set up the Pi as a Wi-Fi access point for all of the
ESP32s,
on the PC with the ESP-IDF environment, and with the ca_cert.pem
file you just generated in doing pi_wifi_ap.md,
unset the flag CONFIG_STEPPER_NO_WIFI,
recompile and download the image to the ESP32: the ESP32
should now connect to the MusicalBox AP to check for a
firmware update before running the stepper motor; check the
monitor output for this,
on a serial terminal to the Pi, type the command sudo arp and
note the MAC address of the connected ESP32; maybe create a
text file on the Pi to note it in and name this ESP32
"rotation",
insert the split ring, maybe add a tiny spot of
cyanoacrylate adhesive at the rim to keep it in position,
choose a colour convention for 5 V versus 12 V (I
chose red wire for 5 V, yellow wire for 12 V) and
wire the split ring up to 5 V, 12 V and ground,
finally, fix the lid into position with the remaining M3
pan head bolts and plug in the USB blanking plug.
Here is the assembled stand:
Bottom, Test Fit
And Internals
Nothing is finally fitted in this stage but many things are
prepared and tested ready for fitting in the bottom completion stage.
Components:
the 3D printed parts bottom_inner, bottom_outer and, for test
fitting only, bottom_stepper_and_electronics_mounting_plate_x6,
an ESP32-C3
board with headers soldered in on the component side,
a BigTreeTech
TMC2209 board with heatsink glued on and the "sticky
out" pins on the underside trimmed off,
2 off 10 k resistors,
12 off M2.5 x 5 mm pan head bolts: the
length is important! Those little 24BYJ48-034 stepper
motors only have a few millimetres of thread in their fixing
holes and no blanking plate at the back of the hole, behind it
is gearing, so a longer screw will drive straight into the
gears and stop the motor rotating,
12 off M3 x 5 mm pan head bolts,
4 off 0.1 inch pitch male connector strips 4 pins
wide,
3 off 0.1 inch pitch male connector strips 6 pins
wide,
a few tiny pieces of Veroboard,
7-strand flexible wire in red, black and whatever colour
you chose for 12 V above (e.g. yellow),
some 3 mm diameter heat-shrink.
You will also need a few test leads (e.g. crocodile-clip
terminated leads).
Assembly:
attach a stepper motor to each of bottom_stepper_and_electronics_mounting_plate_x6
(henceforth called the base plate) using two
M2.5 x 5 mm bolts each; the screws go in from
the side with the small stick-outs, the motor lying flat on
the lettering side,
attach each base plate to bottom_outer using two
M3 x 5 mm bolts each (see first picture below);
this is just for a test fit and to cut the threads, the plates
will be removed again later,
test fit bottom_inner
into the centre of this arrangement (see second picture
below): this will be a very tight fit but it does need to lie
absolutely flush against bottom_outer all the way
around, not be stuck on any of the base plates at any point,
take the ESP32-C3
and BigTreeTech
TMC2209 boards and place them in the locations they
should clip inside bottom_inner (the red strip on the TMC2209
board should be furthest from the wall); don't actually clip
them in yet though, they will remain a loose assembly
throughout this section, only coming together in the bottom completion stage,
make the connections between the two boards for EN, DIAG
and RX/TX following the schematic below and putting the 1 kOhm
resistor in the wiring (heat-shrink over any exposed wires),
wire lengths arranged neatly for the intended positions of the
two boards,
cut two pieces of Veroboard, one
4 x 4 holes, the other
3 x 6 holes and solder the 0.1 inch pitch
male connector strips into them such that the strips lie along
a conductor (see pictures below): these will act as bus-bars
for power distribution (you won't use the
3 x 6 holes one until the bottom completion stage),
place the 4 x 4 bus-bar in its intended location,
in the little indent in bottom_inner, blocking the USB connector
of the ESP32-C3 board, with the bus-bars running in the same
direction as the pins of the ESP32-C3 board,
choose which bus-bar is 12 V, 5 V, 3.3 V and
ground, then wire up the power connections of the boards to
the bus-bars, respecting the intended position of the boards
and the bus-bars,
use some temporary leads to connect 12 V,
5 V and ground from the flying leads of the slip-ring
coming up out of the top of the stand to the bus-bar; to
accommodate all of the connections it may be necessary to use
the spare ground pin on the TMC2209 board,
supply 12 V power to the stand; the red LED on the
ESP32-C3 board should light,
connect a PC that has the ESP-IDF software environment
installed and a clone of the Github
repository to the USB connection of the ESP32-C3 board,
build the stepper
application with all of the *_PIN flags set to -1 and the CONFIG_STEPPER_NO_WIFI
flag set and flash the built image onto the ESP32: the ESP32
should try to operate a stepper motor that would be attached
to the TMC2209 board, there should be no red text in the
monitor window on the PC,
confirm that all of the stepper motors arranged around bottom_outer
are working by attaching this assembly to them in turn,
reseting the ESP32 each time (either from the PC or by
pressing the reset button on the ESP32-C3 board) and checking
that each of the stepper motors rotates for three seconds;
make sure to allow each rotation to complete (or fail),
watching the ESP32 log output on the PC, don't unplug a
stepper motor while it is being driven as that might break the
TMC2209 chip,
assuming everything worked, while the assembly is still
connected to a stepper motor, with the ca_cert.pem
file on the PC being the one that you generated
while following the instructions in pi_wifi_ap.md
above, re-build the stepper application with the flag CONFIG_STEPPER_NO_WIFI
unset and flash the built image onto the ESP32: the ESP32
should now connect to the MusicalBox AP to check for a
firmware update before running the stepper motor; check the
monitor output for this,
terminate the stepper motor of the lift in a 4-way
0.1 inch pitch connector, wire order as in the schematic
below, wires trimmed to allow the lift motor to rise about
80 mm above the TMC2209 board, and plug it into the
TMC2209 board,
plug the QRD1114 sensors in; red/black to 3.3 V/ground
on the bus-bar, sense lines as in the schematic below then, in
the ESP-IDF build on the PC, set the STEPPER_LIFT_LIMIT_PIN and STEPPER_LIFT_DOWN_PIN
to match the schematic (all other *_PIN set to -1), re-build and
flash the new image: the lift should rise to its upper limit
and then fold to its lower limit, or the other way around,
something like that,
on a serial terminal to the Pi, type the command sudo arp and
note the MAC address of this newly connected ESP32; maybe add
it to your text file of MAC addresses on the Pi and name this
ESP32 "lift",
detach the six bottom_stepper_and_electronics_mounting_plate_x6
plates from bottom_outer
once more.
You should now have six plates mounted with 24BYJ58-034
stepper motors, an electronics assembly wired to the lift and a
couple of bus-bars ready for installation in the bottom completion stage.
Bottom, Electronics
"Modules"
Note: the pictures below show a small green terminal block -
this proved a bit of a pain and was replaced by the bus-bar
arrangement described in the text.
Components:
6 off bottom_esp_mounting_plate_x7,
bottom_tmc2209_mounting_plate_x7
and bottom_stepper_and_electronics_mounting_plate_x6,
6 off ESP32-C3
boards with headers soldered in on the component side,
6 off BigTreeTech
TMC2209 boards with heatsink glued on and the "sticky
out" pins on the underside trimmed off,
6 off 1 k resistors,
some 3 mm diameter heat-shrink,
12 off 0.1 inch pitch male connector strips 3 pins
wide,
a few tiny pieces of Veroboard,
some double-sided sticky pad,
7-strand flexible wire in red, black and a few signal
colours (e.g. blue, white or yellow),
0.1 inch pitch housings (I used two 4-way, two 2-way,
the rest 1-way) plus female pins to go with.
Assembly:
clip one of each type of board (ESP32-C3 and BigTreeTech
TMC2209) into their mounting plates (bottom_esp_mounting_plate_x7
or bottom_tmc2209_mounting_plate_x7);
holding the mounting plates with the text the right way up,
the ESP32 board only goes in one way, the TMC2209 board should
have the red row of pins at the bottom: to avoid damaging the
boards, as you are looking at the text on the mounting plate,
the TMC2209 board can be slid in from below while the
left-hand (non-USB) side of the ESP32 board should be clipped
in first,
take a bottom_stepper_and_electronics_mounting_plate_x6
(AKA the base plate) that you already populated with a stepper
motor in the previous stage and, holding the two board
mounting plates back to back with the sticky-out bit of the
sides of the boards at the bottom, push those sticky-out bits
into the slot in the base plate (see pictures below, in
particular the last picture) and run a little cyanoacrylate
adhesive there to hold them in place,
similar to the Veroboard in the previous section, cut a
piece that contains two copper strips and is three holes long
(see pictures below) then solder two of the 3 pin wide
male connector strips into it, along the copper strip; these
serve as mini bus-bars to distribute 3.3 V and ground
between the boards and the QRD1114 sensors that end up here,
use some a piece of sticky pad to fix the Veroboard on the
vertical plate sticking up on the end of the base plate
furthest from the motor (I later applied some cyanoacrylate
adhesive to the bottom of the Veroboard as well to help it
out),
wire-up according to the schematic below (ignoring the
QRD1114 for the moment), ensuring pretty tight wiring, using
the terminal block to common the 3.3 V and ground
connections, making sure no wires go along the back (the
curved edge) as there is not much room there and any wires
sent around the side/top of the boards don't stick out more
than one wire's width,
repeat another five times.
12 V, 5 V and the QRD1114 will be wired to these
later; for now all I did was connect 12 V to the TMC2209
(from the stand), plug the USB connector of the ESP32 into a PC
(which will supply 5 V, from which the ESP32 board will derive
3.3 V) on which the ESP-IDF environment and a clone of the Github
respository (with the ca_cert.pem
generated while following the instructions in pi_wifi_ap.md
above) was loaded and build/flash the stepper application with
all of the *_PIN
flags set to -1: the ESP32 should connect to the Pi, check for
an OTA update and then rotate the stepper motor for a few
seconds. On a serial terminal connected to the Pi, I typed
the command sudo
arp and noted the MAC address of each newly connected
ESP32, numbering them in the text file 0 to 5 "door x" and
writing the number somewhere on the board that would be visible
when the board was mounted.
the things assembled in the previous two stages, plus sides_columns,
top and sides_lifting_plate
for a fit-check only,
all of the other 3D printed "bottom" parts aside from the
trim (which will only be attached during decoration),
12 off M3 x 5 mm pan head bolts,
thin 7-strand flexible wire in red, black and whatever
colour 12 V is,
some double-sided sticky pad,
0.1 inch pitch housings (1-way, 2-way, and 4-way) plus
female pins to go with.
Assembly:
place bottom_inner_guide_tool
upright on a work surface, then put bottom_inner down on top of it
with the ring for the rack side uppermost and so that the tool
pokes up through the hole in the centre of bottom_inner,
put a few spots of cyanoacrylate on bottom_inner_guide and glue
it to bottom_inner,
using the tool to make sure the two are centred, and making quite
sure none of the glue gets on bottom_inner_guide_tool, which
may be discarded as soon as the gluing is done,
place bottom_outer
down so that the bolt holes are visible, place bottom_inner
on top of it so that the ring for the rack is visible, the
opening is at 6 o-clock and the M3 bolt holes running
between the two are lined up (pick it up and turn it over to
check), then begin bolting the electronics modules to bottom_outer
using two M3 x 5 mm bolts each, arranging them
in number with zero at 5 o-clock and increasing
anti-clockwise, i.e. so that you end up with the order of the
hexagonal schematic when
viewed from above; move any wires lying on the inside of the
electronics modules up and out of the way, do not trap any
wires, and be sure that all of the base plates are flat and bottom_inner
is flush with bottom_outer
by the time you are done,
glue the two halves of the circular rack into the slot in bottom_inner,
with the power disconnected from the stand, turn bottom_inner
and bottom_outer
over together and place them on the stand, passing the wires
of the slip-ring up through the hole in the middle of bottom_inner,
stick a piece of sticky-pad into the indent where the
3 x 6 bus-bar goes and stick the
3 x 6 bus-bar on top,
take the three wires (12 V, 5 V and ground) from
the slip-ring and wire them to the
3 x 6 bus-bar with three 1-way 0.1 inch
pitch connectors (that way you can get them back out of the
hole in bottom_inner
again), imagining that the lift is present and passing them
through where the bottom left-hand corner of the lift would
be, beside the lift motor where there is a gap; leave a
reasonable amount of slack as you will need to be able to lift
bottom_outer
off bottom_inner
in this section,
from the 3 x 6 bus-bar, wire 12 V,
5 V and ground out to the electronics modules at
doors 4, 5 and 0, the 12 V and ground wires ending
in a 2-way 0.1 inch pitch connector to plug directly into
the TMC2209 boards and the 5 V wire ending in a single
0.1 inch pitch connector to plug directly into the
ESP32-C3 boards,
stick a piece of sticky-pad into the indent where the 4 x 4
bus-bar goes,
without pressing down on bottom_inner (hold in one
hand) clip the two boards in the assembly of electronics into
their holders in the base of bottom_inner: the TMC2209 board
should have the red row of pins nearest the wall and, to avoid
damaging the boards, the left-hand side of both boards should
be put in first, then the right-hand side clipped in,
stick the 4 x 4 bus-bar to the sticky pad,
back to the 3 x 6 bus-bar: wire 12 V
and 5 V to the 4 x 4 bus-bar and ground to
the spare ground pin on the TMC2209, splitting off on the way
to feed 12 V, 5 V and ground to the electronics
module of door 1; this way there is only one set of wires
passing along the narrow gap behind the lift motor,
from the 4 x 4 bus-bar, wire 12 V, 5 V
and ground out to the electronics modules for doors 2 and
3 but, since hole 3 is right up against the front of the
lift, only go through hole 2 and feed power to
door 2 then to door 3 around the outside,
with the lift not connected to its controller,
supply 12 V, 2 Amps power to the stand and all eight
devices should come up: with a serial connection to the Pi sudo arp
should show that they have all connected, journalctl -u https_server
should show that all eight devices began to fetch their
OTA file and then dropped the attempt when they realised that
the version had not advanced,
disconnect power from the stand and test fit the lift
(again, do not press down on the stand when fitting
the lift, hold bottom_inner
in your hand and, afterwards, make sure the cables running
through the slip-ring aren't trapped when you return bottom_inner
to the stand), placing the side with the white sensor
reflector down first then clipping in the opposing side,
passing the cables from the slip-ring up through the hole in
the base of the lift then around, past the stepper motor, to
the 3 x 6 bus-bar and check that the lift is not fouled by any
of the wires; you may wish to glue the wires that pass behind
the motor into position (see picture below),
when you are sure it is good, fit the lift properly,
connect it up fully, apply power to the stand and keep your
fingers crossed: the lift should rise to maximum height then
go back to fully folded.
Note: the bottom is not yet bolted together, how to do that is
described in the next stage, but it will stay together anyway as
the fit is deliberately tight.
the 3D printed sides_column_x6,
bottom_stepper_spindle_adapter_x6,
sides_lifting_plate,
top and door_x6,
12 off M3 x 3 mm hex head grub screws,
6 off M3 x 18 mm (or thereabouts) hex head
bolts,
6 off M3 x 8 mm (or thereabouts) hex head
bolts,
6 off 128 mm lengths of 4 mm diameter brass bar
with 15 mm of flat ground into both sides of one
end (sufficient to fit with no slop inside the fatter end of bottom_stepper_spindle_adapter_x6)
and 25 mm of flat ground into both sides of the
other end (sufficient to fit with no slop inside the
fatter end of door_x6),
you may wish to print a sacrificial door_x6 and bottom_stepper_spindle_adapter_x6
to test fit your work; try to grind the flats at both ends in
the same orientation as it may be useful to be able to tell
where the flat is on one end by looking at the other,
18 off 1-way 0.1 inch pitch housings plus female pins
to go with,
white paint (e.g. Humbrol 34),
matt varnish (e.g. Vallejo)
or matt black paint (e.g. Humbrol 33).
You will also need an M3 tap and a good pair of tweezers.
Assembly:
run an M3 tap through the grub-screw holes in all of door_x6s and bottom_stepper_spindle_adapter_x6,
paint the undersides of all of the door_x6s according to the
last picture on the first row below, following the outlines
provided on the surface, and leave to dry,
slot each of sides_column_x6
into the matching slots in sides_brace, the bearing indents in sides_brace on
the short length of sides_column_x6 (see picture below),
turn musical box on its side, detach the bottom from the
stand (not far, just enough for access to the bolt holes, see
picture below) and bolt the longest length of sides_column_x6
to the bottom from below with the M3 x 18 mm
bolts (see picture below); it is probably best to start each
one and then go around again tightening up,
supporting sides_brace
with your forefingers as you do so, place a bearing into each
of the indents in sides_brace; make sure they go in nice and
flat,
as in the Plinky-Plonky section,
make up six sensors following the schematic on the main page,
with the 150 Ohm series resistor and the 10 kOhm
pull-up resistor incorporated into the cable, heat-shrink
employed as necessary, this time with wires 180 mm long,
a 0.1 pitch housing added to the end of each wire; try
not to have the resistors in the same part of the cable as it
will bulk it out too much to get through the holes,
if possible, test each sensor by supplying 3.3 V
across black/red and putting a Voltmeter across black/signal
to check that a reflective surface takes the reading down
towards 0 V and a matt black surface towards 3.3 V
(the values don't mean a thing, there just has to be swing),
from above, thread the cables of each sensor through the
rectangular holes in top with the clear rectangle nearest the
outside of the musical box, then clip the QRD1114 into place:
push the sensor down inside the hole at least 4 mm, see
picture below, looking at the back you should be able to see
2 mm of the body of the sensor; without this the sensor
will see even the most matt surface as reflective and
false-trigger "open" all the time,
thread the sensor wires through the square holes in sides_brace
until top
is able to lie flat on sides_column_x6,
take each length of brass bar and, supporting sides_brace
with your forefingers as you do so, thread them
15 mm-flat-end-first through the bearings in sides_brace to
about half the length of the brass bar,
on the 15 mm-flat-end of each bar, fit the fatter end
of bottom_stepper_spindle_adapter_x6,
respecting the flat (it is on the grub-screw side) and making
sure the hole is completely clear first; it is important that
the bar goes in a full 12 mm,
screw a grub screw into each of bottom_stepper_spindle_adapter_x6
against the flat of the brass bar,
with your finger supporting the bottom of each 24BYJ58-034
stepper motor (so as not to put stress on any of the plastic
parts), push the other end of bottom_stepper_spindle_adapter_x6
onto each 24BYJ58-034 stepper motor spindle, respecting the
flat of the spindle (the flats are aligned inside the spindle
so you can tell where they are), with the grub-screw hole
facing you; when done the tops of all of the brass bars should
be just below the top of top,
start the M3 x 8 mm hex head bolts through
the holes in top
into sides_column_x6,
then turn the musical box on its side to tighten the bolts
down (in order not to put undue stress on the rest of the
musical box),
with the musical box still on its side for access and,
armed with a good pair of tweezers, continue the threading of
each triplet of sensor wires down through the square holes in
bottom_outer
/bottom_inner
and to the electronics module beneath then plug the signal
wire into pin 4 of the ESP32 (just next to its 3.3 V
pin, see picture below), the red and black wires to
3.3 V/ground on the Veroboard bus-bar,
return the musical box to the upright position and rotate
carefully on the stand to make sure that no wires are fouling
rotation,
supply power to the stand and allow the test rotation to
complete, place a door_x6 on the end of a brass bar through
a hole in top
then CAREFULLY plug a PC with the ESP-IDF environment and a
clone of the Github
respository (with the ca_cert.pem
generated while following the instructions in pi_wifi_ap.md
above) into the associated USB connectors of the ESP32 board;
build/flash the stepper application with CONFIG_STEPPER_DOOR_OPEN_PIN
set to 4 (all other *_PIN flags set to -1) and the ESP32
should connect to the Pi, check for an OTA update, then its
stepper motor should move the door clockwise, hunting for the
open position, up to ten times: if you hold something
reflective over its QRD1114 sensor it should rotate
anti-clockwise (close), something non-reflective clockwise
(open); if the sensor is left uncovered the motor may simply
jitter back and forth ten times (apply light to the sensor if
the motor doesn't want to stop - it is trying to end closed),
it will not be possible to install and run all of the doors
at once until you have some synchronised software, so leave
them off for now.
Protection
The last thing to do is to secure the open Wi-Fi access point
of the Pi that is in the stand with MAC address filtering.
The only ESP32 you don't have a record of the MAC address of is
the one in the plinky-plonky, so:
get the PC that has the ESP-IDF environment, the one with
the ca_cert.pem
file you generated above in doing pi_wifi_ap.md,
and set the flag CONFIG_STEPPER_PLINKY_PLONKY_REFERENCE_PIN
to 4 (all of the other *_PIN flags to -1, CONFIG_STEPPER_NO_WIFI left
unset),
supply 12 V to the plinky-plonky mount you assembled above and
let its 30 second rotation complete (or cover the sensor
on the plinky-plonky mount with you finger to stop it),
supply 12 V to the stand also and let its complete its
test stuff,
plug the PC into the USB of the ESP32 inside the
plinky-plonky mount then build and download the ESP-IDF code
to the ESP32: the ESP32 should connect to the MusicalBox AP to
check for a firmware update before running the stepper motor;
check the monitor output for this,
connect a serial terminal to the Pi that is inside the
stand, type the command sudo arp and note the MAC address of the
connected ESP32 that is NOT already in the text file of MAC
addresses you have been maintaining; when you find it, add it
to the list and name this ESP32 "plinky-plonky",
You now have the MAC addresses of all of the ESP32s:
with a serial connection to the Pi, follow the instructions in pi_wifi_dhcp_mac.md
to limit access to the MusicalBox access point by MAC address
and give them all nicely organised IP addresses.
Note: you may wish to include a test ESP32/TMC2209 combination
with which you can mess around while not affecting anything
else; you will see that esp32_server.py
has such a device in its device list on the IP address ending
100, marked as "required":
False so that it will be initialised, treated like a
normal device etc. but the server won't wait around for it.