Mushroom on wheels

Animate the famous SuperMario's mushroom

Similar projects worth following
I bought a mushroom candy box(official Nintendo merchandising), I thought it would be nice to add a motor and some wheels and make it move on my desk... And then came the Hackaday coin cell challenge!
So instead of procrastinating, I tried to make a first version with what I had available on my desk : mini RC car, AT Tiny85, etc.

For this project, I just want to have a mushroom going to the left, then to the right, then to the left ,etc. I don't want have features creeping until I have a remotely controlled RC mushroom with openCV and Node JS that takes one minute to boot ;-)

I'm using a single very small motor, but even if it is very small, I still need to use a H-bridge to power it, because I need to reverse the polarity applied to the motor if I want to change direction, I can't do that with transistors alone. I was not very familiar with H-Bridge, here is an illustration explaining how it works and how the current flows in one direction or the other

illustration borrowed from
As I had very little room in the mushroom, I ordered a ready made H bridge, it was supposedly a L298N, but I can't read what's written on the chip. I used an ATtiny85 to control it, so the schematic is pretty simple :

I also added a potentiometer to adjust the timing for the direction inversion, aka the time my mushroom goes left before going right.

To program the ATtiny85, I used the Arduino as an ISP, as described here.


mario bricks!

Portable Network Graphics (PNG) - 3.57 kB - 02/12/2018 at 22:03



code for the ATTiny85

text/x-arduino - 1.89 kB - 01/07/2018 at 10:34


  • 1 × ATtiny85 Microprocessors, Microcontrollers, DSPs / ARM, RISC-Based Microcontrollers
  • 1 × L298N Interface and IO ICs / Peripheral Drivers and Actuators
  • 2 × potentiometer

  • Projects for 2019

    PixJuan01/09/2019 at 22:34 0 comments

    Hello dear Followers!
    As a bright new year is starting, I thought I would write a log for each of my project.

    I want to make a new version of this project mostly as an excuse to learn 3d printing.
    The new version will use:

    • either a ATtiny85 or a sawed off stm32 board
    • a hacked servo
    • 3d printed or laser cut parts
    • a 3.7V NiMh battery

  • Hackaday prize 2018

    PixJuan04/22/2018 at 19:32 0 comments

    I received a message suggesting to enter the HaD prize, why not?

    According to the rules, the project page must answer the following question :

    Why? What would this project solve?

    Saying it would help solving the problem of mushroom-shaped-candy-box recycling  would be a bit far-fetched, I don't sure how urgent this problem is.
    But hey, at least it would solve my problem, no?

    And this project might force me to try 3D printing(something I was thinking about for a while) to solve the problems with my first prototype.

    I think this is also the idea behind projects on HaD, some are made to save the world, and other are made just because someone decided it could be done!

  • Battery, sound and wallpaper

    PixJuan02/12/2018 at 21:54 0 comments

    New battery

      I was not supposed to continue this project but I finally did some more tests : I tried to run the mushroom with a brand new CR2032 coin cell and with a LIR 2477.   And I also removed the potentiometers to avoid wasting any mV from my poor coin cells.
      The results are still sluggish with a CR2032, and it is not working with the LIR2477. I was expecting to get better results with the 2477 but maybe it is too old, it was scavenged from a broken bike light.
      According to the datasheets a LIR2477 has 3.6V and 150-180 mAh  which is better than a CR2032 but I don't know how to interpret the other parameters.   I think that what matters is also how fast it can discharge. I compared the intensity with the 3 batteries :

    •   3.7V NiMh : 45-50 mA working fine
    •   CR2032    :15 mA, the motor is running slowly, then 30 mA, but with the motor running faster, but then the Attiny85 seems to crash
    •   LIR2477   : 2-5 mA  the motor is buzzing, but not really working

      Another appropriate thing to do with a mushroom shaped box would be to play mario theme or the SuperMario sound sample when Mario take a mushroom and grows up.
      So I tried to use the tone library but it didn't work. According to this ticket [], it doesn't work on the Attiny85   because the Attiny family only have a single timer.
      Another solution is to use the TrinketTone library which is supposed to work, or this example. As playing SuperMario theme has already been done,   I wanted to try to play an audio sample instead, but the PCM library I found also requires 2 timers (details) and the ATtiny only has one.
      The last option would be to try to play the sound as it is done in the original SuperMario
      It does make an interesting challenge but I will need to study the NES hardware a bit more.

      To finish on a brighter and more successful note, I made several brick wallpapers png, nothing complicated but it will save you some work if you need this
      kind of background for your projects ;-)

  • PWM to the rescue

    PixJuan01/21/2018 at 06:29 0 comments

    I had tried to use PWM at first but I couldn't get the desired result, not sure why, but now it works... a little. The code has been updated

    It allows me to have smoother acceleration and braking so the mushroom doesn't always topple over, but I'm still not happy with the result, I definitively have to redo this from scratch. I will also add a small buzzer to play the SuperMario tune but I don't have the room with the current design.

    The project is shelved until I find the time to learn how to use a 3D printer and improve the design...

  • Plans for another prototype

    PixJuan01/07/2018 at 19:22 0 comments

    So far, I think this quick'n'dirty prototype has some flaws that I need to restart from scratch:

    • 3D printing, no glue
      This must be reproducible, and gluing things make it hard to repair and lacks precision.
      I will probably use another toy to get the wheels but that's all.
    • Stepper motor or hacked servo
      The mushroom is quite heavy and with a basic DC engine I don't have any feedback so I have to put a strong current to get it moving and then it accelerates too much. I don't need speed, so I'll either use stepper engine like this one or that one or hack a servo to get a continuous spin.
    • Bottomless mushroom
      The mushroom will just sit on top of a platform that will contain the electronics and the motor. It will be easier to test and fix.

    I never did any 3D printing so I guess it's part of goals of things to learn for 2018!

  • Plan B: butchering a mini RC car

    PixJuan01/06/2018 at 18:33 0 comments

    To find a new motor, I sacrificed a mini RC car :

    And of course, the motor didn't fit in the other toy I had started to work with...

    And this mini RC car is too big to fit "in" the mushroom,so I just kept the rear of the car with the 2 wheels. Then I dug in the mushroom bottom with a Dremel and used a glue pistol to keep everything in place. On the picture you can see I had to cut the corners of the PCB so it will fit in the mushroom!

    open mushroom

    There is only 2 wheels, there is no room to easily add a third wheel to stabilize the mushroom, so I used some tape and plastic (yeah I know...) to make some kind of "skate" so it would be more horizontal. This is really not satisfactory, but I wanted to try to have something working before the end of the coin cell challenge.

    Now the question is, does it work? Well, it works with a 3,7V Nimh battery, but not with a 3V coin cell :-(
    I have a couple of coin cells at home but they don't seem to have enough juice to move the mushroom, so I'll try to get new ones tomorrow to see if it can work.

    I'm a bit skeptical though, the RC car weighted 19g and the hacked mushroom weight 49g and there is much more friction because it has only 2 wheels.

    Another problem with having only 2 wheels, is that it doesn't really go straight, so I tried to make some kind of ramp, or rail in balsa, with borders to prevent it form escaping. It works so-so, but I started to add a brick pattern so at least it will look nicer ;-)

  • Plan A : cheap chinese solar gadget

    PixJuan01/03/2018 at 21:15 0 comments

     In order to make my mushroom move back and forth, I wanted to use a cheap chinese solar powered toy :

    Using such a toy would be a lot easier than trying to build a tiny moving platform from scratch.

    Concerning this toy, I honestly don't know what kind of sun exposition is required to get it to move, even when using my phone flash, it was barely moving. So I removed the solar panel and did some tests.

    The motor is really tiny, so naively I first tried to power it from the pins of an ATiny85, not expecting much. It worked a bit, the motor start turning, but it is far from enough to move an object.

    I tried to power it with an op-amp just in case, but it was only providing 15-20 mA on its ouputs so it was not working much better.

    I definitely needed an H-Bridge, so I got one but as I was using a 3V coin cell so the engine was  running too fast for my needs. I tried to add a resistor, but then it was not moving anymore.

    At some point the motor just fried :-(

    So long for plan A...

View all 7 project logs

Enjoy this project?



edumushroom7 wrote 05/08/2023 at 16:49 point

You really did a great job electric handle program object. I want to embed it with my webpage you can see here

  Are you sure? yes | no

Eric Hertz wrote 04/17/2018 at 22:29 point

LOL, you don't want it to take minutes to boot?! Nah, I dig it, KISS. Left and Right is all a side-scroller needs :)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates