Code Monkey home page Code Monkey logo

momobox's Introduction

The Momobox

A build-it-yourself MP3 player for toddlers, and maybe for adults too. 3D-print your own custom figurines (we call them Momies) and pair them with your favorite stories, songs, or audiobooks. If you have a 3D printer and the ability to solder, you can build one of these for roughly the same cost as a commercial Toniebox, and without the long-term cost of ownership. Plus, the momobox and the associated momies are distinctly yours!

Here's a momobox!

The momobox started as a toy I built for my daughter, who we call Momo, during my batch at the Recurse Center. It runs on a Raspberry Pi Pico, and incorporates an RFID sensor, speaker, SD card, and a 3D-printed enclosure and momies.

You Can Build One Too!

Take a look at the project wiki for resources and to get started. At this time the project is not fully documented - if you'd like support, encouragement, or get stuck during the build, please feel free to reach out!

3D Printed Components

The design for the 3D printed components lives in OnShape.

Materials

Materials currently on order are stored in this Google Sheet. A finalized bill of materials should go in this section once an initial build configuration has been selected.

Resources

List of learning & technical resources that can be used to complete this project:

momobox's People

Contributors

blairfrandeen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

momobox's Issues

Try architecture without hall sensor

Current setup for board includes a hall effect sensor, that toggles when magnets are connected. It may be simpler to just keep querying the RFID board, and if the RFID chip has been removed, then stop playing.

Should be functionally the same, but may be worse for power consumption, which so far hasn't been modeled or thought about.

On-board logging

I would like to replace all of the print statements with log statements, and I would like the momobox to keep track of some basic on-board logging. Some thoughts on the logger:

  • I need a switch to make the Pico read-only. As described here, the Pico can self-write to its own filesystem, or it can allow the PC its connected to to write, which is used for easily updating the code. The linked article suggests making a switch, and adding it to the boot.py file. I propose to add the following to boot.py:
import board
import digitalio
import storage

switch = digitalio.DigitalInOut(board.GP22)
storage.remount(mount_path="/", readonly=not switch.value)

Currently GP22 is the pin that detects whether an SD card is inserted. What the code above would mean is that the file-system would be read-only (able to update the code) if the SD card was not present. Since the SD card is required to use the momobox, part of updating the onboard code would be to boot the momobox with the SD card removed.

  • I would want to minimize and limit the size of the logs, since the on-board memory is limited to 1 MB, and some of that space is already spoken for. I know that the python logging module allows for this to some extent, so I'll have to implement it.
  • On the subject of the above, it would be useful to minimize the size of the log file by minimizing log messages; it's okay to be terse

Better volume control

Currently the only option for volume control is to turn the screw on the audio board. End user's key stakeholder requests easier adjustment.

Not sure how to implement this easily, may take some creative thought.

Incorporate SD card

Current system only has 1 MB of memory. Need to add the SD board and SD card.

Speaker Mount points don't work

Speaker mount points are not easy to work with; no good tool access, not even worth trying to get the square nuts into the bottom mount points. Needs to be rethought.

Best idea so far: Passive slot at the bottom of the box that accepts the speaker flange. Maybe keep improved screw bosses near opening of top of box, but there is also an option to make a flexured post or latch to simply snap the speaker into place.

Implement replacement for heat-set inserts

Heat-set inserts are great, and also expensive. They cost about $17 on McMaster, and I'd like to offer users a cheaper solution.

Will probably go with some sort of press-in or slot-in hex or square nuts. Currently the heat-set inserts are used in the lid to box connection and the RFID board to lid connection.

The latter could be tapped M3 fasteners since the RFID board nominally only goes on once; the lid to box connection benefits greatly from being threaded.

Start Bill of Materials

Start a basic bill of materials, either in markdown table or csv format. Should include the following columns:

  • Component Name
  • Quantity Required
  • Description or Notes
  • Source (link to purchase)
  • Price

Okay for this to be wrong / incomplete. Also okay for components to be identified as needed and not fully specified. Multiple options for components also okay.

Put momobox to sleep when not being used

The firmware runs continuously when the batteries are connected. Goal is to have the pico go into sleep mode after some amount of idle time, and then awake upon a signal from the hall sensor.

A good starting point with resources is here: https://ghubcoder.github.io/posts/deep-sleeping-the-pico-micropython/

May be better to also read this post about dormant and sleep modes: https://ghubcoder.github.io/posts/awaking-the-pico/

This is micropython based (momobox currently uses circuit python), so may not be fully applicable.

A good thing to start with is to measure the current draw from the batteries during the following operations:

  • idle time
  • RFID request
  • playing a song
  • song paused

Box Bottom Design

Current box design is monolithic. Looks nice, but I think there are advantages to a separate bottom:

  • iterating on the box design likely doesn't require a new bottom. In the latest print the bottom took 3 hr.
  • a totally flat bottom separates from the bed (warps) prematurely
  • a ribbed bottom requires support material which is hard to remove.

No reply of previously finished song

Input: momie left on top of box. Song completes. Same momie is removed and reattached.

Expected result: song starts from beginning

Observed behavior: song does not restart. Placing a different momie on top of box works as expected

Pi Pico Basics

Need to learn to program some fundamentals on the Pi. Issue is closed when I can do the following:

  • control a program by opening or closing a physical switch (or connect a wire on the breadboard)
  • write and retrieve a value that is persistently stored on the Pi
  • copy a file from my computer to the Pi
  • read from a file on the Pi
  • delete a file from the Pi

Box Lid Design Issues

  • Magnet needs to be positively secured to top of lid (maybe just use superglue)
  • Bosses for inserts need to be larger diameter so they don't deform when insert installed
  • Verify positive separation between magnet and RC522 board
  • Need clocking feature between lid & base
  • Make material between magnet and top of lid as thin as possible
  • Not enough wire routing space for RC522 harness

RFID light stays on

Currently the red RFID board LED is on whenever the unit is powered. Nice to see that it's on, but the light is off-center and not there intentionally. One or more dedicated LEDs to communicate status would be better

Lid and board mount design issues

  • Board mount fasteners to lid are not accessible. Removing the board mount requires partial removal of the pico and the SD card board. Thru-holes have been added to the board mount, and corresponding bosses need to be added to the lid.
  • Battery clip blocks board mount fasteners on back of board
  • Harness routing features, particularly for RFID harness, should be added to ensure that nothing gets pinched when the lid is closed.

Integrated Rechargeable Battery

We're tired of having to swap the batteries every day. While it would be nice to reduce power consumption (see #16), it's also necessary that it can charge simply by plugging it in.

Some very preliminary research: https://www.circuitbasics.com/how-to-power-your-raspberry-pi-with-a-lithium-battery/

As I understand it I'll need three components, which I now have on order:

My hope is to use the above together so that the user can plug in directly to the charge controller, and still be able to use the box when it's plugged in. At the very least, not need to reconfigure anything while charging. If this fails, I bought a more expensive all-in-one board that I can use instead: https://www.digikey.com/en/products/detail/adafruit-industries-llc/2465/5356834

Also purchased another Pico with pre-soldered headers to try this with, as well as a second breadboard.

While I'm waiting for parts to arrive, I have some CAD work to do to figure out how I'm going to mount two additional boards and a new battery within the existing housing. I'll probably want to move the Pico back and put the charge port in its place, and 3D print a new battery clip.

Set up MicroPython Development Environment

The "official" method of talking to the Raspberry Pi Pico is through the Thonny editor, which isn't my preferred development environment.

Check out this article and see if I can't get Raspberry Pi Pico to talk directly to VSCode, which is my editor of choice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.