Mario Question Block Solar Monitor

4,722

42

12

About: Physics and Technology teacher at Innovation Academy Charter School in Tyngsboro, MA.

Intro: Mario Question Block Solar Monitor

We have a solar panel system on our roof that generates electricity for us. It was a large investment up front and pays back slowly over time. I have always thought of it as a penny dropping into a bucket every few seconds when the sun is out. Day after day those pennies add up! I decided to build a monitor that would bring that concept to life. A question mark block from Mario Brothers turned out to be a perfect fit. Every time our solar panels generate one penny worth of electricity, the block lights up and plays the Mario coin sound. Every time the panels generate one dollar worth of electricity, (100 coins) it lights up and plays the Mario 1up sound just like the game. It is a happy reminder that my panels are working hard even when I am not.

Note: The code in this project currently only works with Enphase systems. If you have a system with a different monitor, I would love to collaborate on a solution that would work for yours, just leave a comment below.

Step 1: How It Works

This project uses a NodeMCU to wirelessly connect to the the Enphase Envoy box to monitor solar production. If you are currently connected to a network with an Envoy on it, check its IP address by looking at the screen on the box. Mine is currently at 192.168.1.10. If you follow the link below you will get a short (JSON) text response that indicates how much energy your panels have generated so far and the current power output.

http://192.168.1.10/api/v1/production (You will probably have to change the 192.168.1.10 part to match your Envoy IP address.)

This project uses the "wattsNow" value and a price per kilowatt hour provided at setup to calculate how long it takes for the system to generate one cent worth of electricity. Once that amount of time passes, it plays the coin sound and flashes yellow.

Step 2: Gather the Materials

You will need the following to build this solar monitor.

Electronic Components:

  • NodeMCU Amazon $4.99
  • Mini Breadboard
  • Yellow and Green LED
  • Piezo buzzer
  • 2-100 Ω resistors
  • USB Micro B cable (I used a short one to power the project and a longer one to upload the program)
  • Jumper wires
  • USB wall adapter (I used an old iPhone charger)
  • Enphase Envoy Monitor connected to a wireless router

Box Components:

  • 3D printer, with preferably yellow filament
  • 3 pieces of plexiglass cut to 3-1/8" square
  • white spray-paint (I used Rust-oleum, but something more transparent would probably be better)

Step 3: Get Started With the NodeMCU and Upload the Program

Magesh Jayakumar has created an excellent instructable on getting started with the NodeMCU. Quick Start to Nodemcu ESP8266 on Arduino IDE It is clear, to the point, and gives a few examples. It is worth checking out if you are new to NodeMCU, but I will give the important steps here too.

  1. Download, install and launch the Arduino IDE.
  2. Go to preferences and enter the following address in the "Additional Boards Manager Urls:" text box then click OK.
    http://arduino.esp8266.com/stable/package_esp8266com_index.json
  3. Go to Tools>Board>Boards Manager. Search for ESP8266 and install "esp8266 by ESP8266 Community"
  4. Go to Tools>Board>NodeMCU 1.0. It will be listed below the other Arduino boards.
  5. Make sure your NodeMCU is connected by USB and go to Tools>Port>Select your USB port.
  6. Download and open the SolarMonitor.ino file and open it in the Arduino IDE. At the top of the program there are 4 pieces of information that the program needs to run successfully. These are your wireless network ssid and password, your Envoy IP address listed on the Envoy screen, and the value of one kWh of solar energy in cents. You can get this last value from your electricity bill. If you are enrolled in an SREC program through your state, add that too.
  7. Upload the modified program to your NodeMCU by clicking the upload (arrow) button at the top left of the window.

Step 4: Build the Electronics

Refer to the wiring diagram above to build the electronics components. Summary is below:

  • Positive end of green LED connected to D6, Negative end to 100 ohm resistor.
  • Positive end of yellow LED is connected to D7, Negative end to 100 ohm resistor.
  • Positive end of piezo buzzer is connected to D8.
  • All circuits terminate at GND.

Step 5: Build the Box

Use the STL files above to print the box. I used yellow filament. To make the question mark inserts, cut three squares of plexiglass 3-1/8" x 3-1/8". I wanted the question marks to let light through but obscure the electronics inside so I gave them a light coating of white spray paint. I used Rust-oleum, but something more transparent would probably work better. Once the inserts are dry, use a few dabs of hot glue to secure them to the inside faces of the box. Then add the wall adapter to the box with the prongs sticking through the back. Secure it in place with a dab of hot glue on the bottom.

Step 6: Add the Electronics

Plug your USB cable to the wall adapter and connect it to the NodeMCU. I used a shortened cable here to minimize clutter in the box. Finally stick the breadboard to the back of the box using the adhesive on the bottom, or another dab of hot glue. Pop on the top and plug that sucker in. Before you know it, you'll be up to your eyes in Mario coins!

Step 7: Future Steps

  • If you have a solar panel system made by someone other than Enphase, I would love to help you get this working on your system too. As long as there is some sort of local or web-based API it should be straightforward string manipulation. Post a comment, and if I can help I will.
  • I may add a numeric display so I can see the cents ticking up each time it bings. Stay tuned.

Share

    Recommendations

    • Fix It! Contest

      Fix It! Contest
    • Tiny Home Contest

      Tiny Home Contest
    • Audio Contest 2018

      Audio Contest 2018

    12 Discussions

    1
    None
    bujnos

    22 days ago

    cool, but metering itself costs You about 2-3watts, it may mean ca 1% of all generated enery at about 500W nominal panels power

    1 reply
    0
    None
    ChristopherD196bujnos

    Reply 22 days ago

    Yeah a USB wall adapter uses a watt or two even when nothing is plugged into it, more when there is something plugged in. Still (0.002kW)*(24h/day)*(365day/year)*($0.21/kWh) = $3.67/year. It's not nothing, but also pretty small in comparison to what the panels generate.

    1
    None
    RobC184

    24 days ago

    This is cool. How often does it generate a penny's worth?

    5 replies
    0
    None
    ChristopherD196RobC184

    Reply 24 days ago

    It bings about every 15 seconds. I may add a potentiometer to the piezo circuit so I can turn it down when I want some quiet.

    0
    None
    PaulL283ChristopherD196

    Reply 22 days ago

    Great project. Obviously it doesn't, but I laughed at the thought of this using a penny's worth of electricity each time your system generates a penny's worth. Nice work.

    0
    None
    cquadrini56ChristopherD196

    Reply 22 days ago

    SO, reading this and watching the video I was thinking..."That is it." Then I did the calculation of $0.04 /min * 60 min * 8 hr/day * 365 d (granted this is semi ideal and it won't happen), but that is ~ $7k...Impressive stuff. I voted for this based on that and I love mario.

    0
    None
    ChristopherD196cquadrini56

    Reply 22 days ago

    Thanks for the vote!

    It only generates a penny every 15 seconds at its maximum for a couple hours during the middle of the day without clouds. Averaged over a year it generates about half of what you have above. Still with both the reduced electricity bill ($0.21/kWh), and the SREC payments ($0.27/kWh) it ends up paying for itself in 4-5 years. The panels are expected to produce for 10 years or more so it is a worthwhile investment. If you or anyone else is considering going solar, it is best to buy them outright if you can afford it or get financing. Many companies offer zero-down "PPA agreements" but they maintain ownership of the system which means they claim the SRECs and sell you the power that they produce so the benefit is far less.

    2
    None

    This is awesome. I love it when people find new ways to get excited about solar. Good luck in the Game Life contest.

    1 reply