The small plush mushrooms I ordered didn't arrive, so I had to try the next best thing with a quick Amazon purchase.
Too bad it was slightly too large and heavy, so I had to make some "adjustments" to it.
I cut it a bit long to make sure I had enough fabric to sew it back up.
Not too bad if I do say so myself! But of course this was now too big for the current ejector arm, and the lid opener was in the way (being right in the middle). I rearranged the devices and remade the ejector arm with more brass tubing.
Was a bit of a tight fit but it works like a charm!
With everything close to being ready, it was time to re-design and build the apparatus. Here is a quick sketch of how I sort of wanted it. Unfortunately the Grove Starter Kit they sent still hasn't arrived, so none of that will be integrated into the project.
After discussing with my brother-in-law, I decided to do something similar to what I had in the sketch.
There was a bit of finesse involved in making the horizontal beams the correct length such that the the two rails held on to each other, but loose enough for free movement
Still waiting on the mario mushroom plush to arrive in the mail, but figured I'd build up the ejector servo. Using more brass tubing, I fashioned a armature capable of ejecting a small item.
Things are starting to get busy in there. Oh, and did you notice the new speaker? I accidentally drilled through it when adding in the white slider rails to the block. Whoops.
I made a new opening arm that took up less space. There is a problem with using two servos though, the library I used could only run one servo at a time. After the lid would open, I would switch over to the ejector, and the lid would fall shut as power was removed from it temporarily. I was able to easily solve this with a strip of duct tape for extra grip on the roof of the block tin.
And here is the demo. Getting very close to finishing this bad boy off.
Something was suggested to me as an alternative to my initial block mounting design. Rather than a rail design I could use drawer rollers to allow for vertical movement. I think this will be a much cleaner design and will require less wood and will likely be more stable than the initial design.
The roller rails I bought consisted of a corner section as shown as well as a flush section. As pictured, I attached the corner roller rails to the back corners of the block, these will all be free moving. The other part of the roller will be screwed into wood and attached to the wall. This will allow the block apparatus to freely move up and down.
The corners of the lid needed to be pulled back a bit to allow for the lid for opening. I'll be trimming those down in the future.
I had a little recording/playback module lying around and thought it would be a great idea to have a little sound effect play when the Lid opened. The module I used was the ISD1820. Recording and playback could be controlled by both on-board buttons or a rising edge from a microcontroller. Only problem was that the volume level in playback was very quiet. To boost up the volume I bought a Class D amplifier from Adafruit, the PAM8302A. This can be enabled/disabled with a high/low logic level.
Once again placing the boards on electrical tape as the container is fully conductive.
The wiring is starting to get a bit messy!
Getting close to having the hardware completed. Just need to add in the second servo motor to push the plush mushroom out of the block.
The basic idea for the apparatus was to have the block on vertical rails that allowed for vertical motion, and a small base for it to rest on without being to obstructive. This is the current working model I have for it. I did the modelling in SketchUp. The rings holding the rails to the block were oversimplified but those don't matter at this point.
And finally the dimensions of wood I am looking to be working with:
The next test was to try out the CurieIMU (Internal Measurement Unit) library and see how it can record and manipulate data. For my purposes I wanted to use the accelerometer to find when there was downward acceleration of the Mario block. To get an idea of how it worked I used the serial monitor to display in real time what effects movement had on the readings. As I am mounting the Arduino 101 vertically on the side of the block tin, I needed to find notice the "at-rest" value and which axis changed with vertical movement.
For this the Y-axis represented vertical movement and the at-rest value was 1.0. Lifting the Arduino quickly brought that value above 1.0, and dropping the Arduino brought the value below 1.0. I picked a value well enough below 1.0 to distinguish a free-fall. Since people aren't perfect, as we are lifting the block up, it isn't purely experiencing positive acceleration. It is important to distinguish this from a free fall as I don't want the lid to open until after it had fallen back down to rest.
With the servo in place and the brass rod built into the servo arm, I tested out opening the lid. Problem was, the motor didn't have enough torque to lift the weight of the lid. Luckily the heavy part of the lid can be pried out.
Once the block tin, servo motors, and Arduino 101 board had all arrived I began thinking about how I could put it together. I bought 2 sizes of brass tubing, one would serve as the rails on which the block was mounted one, and one would connect to the arm of the servo motor. I used those cheap malleable tin cable ties and screwed them into the case molded to the shape of the brass rail rod.
I next mounted a servo motor on a bracket I had lying around that would serve to open the lid.
Following this I did some bending to the thin brass tubing to make an operating arm, and connected this to the servo arm.
Mounted below the servo is the Arduino 101. Since the tin container is conductive, I taped a thick paper backing to where the board would be mounted to ensure nothing would be shorted.