RT5350 Part I – HAME MPR-A1 Teardown

The MagiQuest project got the old braincells churning about how one of these home games might be networked in the backyard for Halloween or something.  One thing led to another, and a big old journey into the land of Wifi was born.  This first article does indeed include a teardown of a low-cost Wifi widget and all it’s gory details, but it starts with the story of how the MagiQuest project meandered into the land of embedded Linux and other assorted tomfoolery.

We begin with the idea of networked home MagiQuest:  How to implement it?  Does anyone make a “thing” that can attach to our Microcontroller, and allow it to talk wirelessly?  Aside from low cost, bidirectional data transmission and a simple way to interconnect or mesh the devices were the main goals.

After researching cheapo RF links and getting turned off by ZigBee’s outrageous prices, we found a couple of devices that were actually sending RS232 and other simple protocols over good old 802.11 Wifi.  Really?

Initially, Wifi seemed like overkill.  Sounds expensive, and might require bloated devkits and a complicated stack to do anything useful.  But it could certainly do the job if the price was right.

A bit of googling later, A Chinese company called Hi-Link showed something that looked like a winner. They manufacture a $11 (Wow!) module called HLK-RM04, an RS-232 to Wifi Converter, along with a simple development kit for it costing only $16 (and including one RM04 module) – not bad!  No stack, no buffering, just plug and play.. Their magical widget takes care of the rest.  And it can do it for cheap.

It’s low cost made it worth the risk.  An order for a handful of these and a devkit was placed. While waiting for it to arrive, there was time to study the product images and search out the main chipset, the Ralink (Now Mediatek) RT5350. Not too shabby! Here’s what a few bucks will get you these days (Taken from Mediatek product page):

RT5350 Product Features

  • 1T1R 2.4/5 GHz with 150 Mbps PHY data rate
  • Embedded MIPS24KEc (360 MHz) with 32K I-Cache and 16K D-Cache
  • 16bit SDRAM, 1.8/3.3V option SPI Flash x2
  • I2C, I2S, SPI, PCM, UART, JTAG, GPIO interfaces embedded
  • USB EHCI 2.0 host/device with 16-EP
  • 5-Port 10/100 Ethernet Switch with PHY 1 USB Host + 1 USB OTG
  • P2P: 802.11z (TDLS) & WiFi Direct
  • Hardware NAT, QoS, TCP/UDP/IP checksum offloading

What?  Onboard CPU, Wifi b/g/n, USB2.0 (and OTG), plus a 5-port switch?  That really would be a router on a chip.  Things like hardware checksumming and NAT means that a lot of the busy work is offloaded from the CPU, so it doesn’t need more than 360Mhz to get the job done.  And all those crazy ports buit in?  This thing is sounding more promising by the minute!

Posted in Projects, Reviews/Teardowns | 12 Comments

MQ Widget Part III

Welcome back to some technical content for a change!  Hopefully you’ve already been following Part I and Part II of our articles on decoding the signals from Magiquest infrared wands.

In Part I, we discussed the game and how to pick up the wand data using a common IR receiver meant for remote controls.  In Part II, we discussed a routine for parsing the pulse-width IR data into bytes suitable for further processing.

We put our newly-discovered knowledge to use in building up a little circuit to make Magiquest wands “magically” do stuff.  It’s centered around a PIC12F508 and Radio Shack IR Receiver Module that watches for a wand shake, then actuates a relay to power a light, sound, or other effect of your choosing.  We’ll actually show two versions, one running from a single 9V battery that can actuate a smaller 1A relay, and one that runs from 12V (or 2x 9V batteries) that can run a more heavy-duty relay.  Some simple options are programmable via header pins and DIP switches, but more about that soon.

The MQ Widget

WidgetFig 1 – Widget Prototyping!

The widget is sized 1.175″ x 3.625″ so it can fit inside a low-cost 3/4″ junction box available for a few bucks from your local big box store.  The specific junction box used was called a 3/4″ PVC Conduit Body, C Style.  Although it’s not easy to find on the Home Depot website, it was right there in the conduit section of electrical.  Manufacturer is CANTEX.

There’s enough room inside this cheap watertight enclosure for the board, battery, and to feed through a chopped off outdoor extension cord for the relay to activate.  Our store was out of gray Cantex plugs for the endcaps, but 3/4″ white PVC plugs fit just fine.  Drill holes in them to feed the extension cord through, then drill a hole in the side of the enclosure for a little plexiglass window for the IR receiver, and you’ve got yourself the makings of a great outdoor Halloween effect for the kiddies.

MQ Widget Features

Header-programmable momentary or toggle on/off function – Blink a light, play a sound, or run a fog machine (with a fatter relay, of course) in momentary mode, or turn on and off your lamps, TV, coffeemaker, all with a magic wand!

DIP-Switch selectable momentary time – Choose time from a minimum of 200ms for triggering an external effect, to 5, 10, or 60 seconds for longer effects or operating secondary equipment.

RS-232 Wand Data Output – Read out your wands with a PC, or extend the widget with some kind of crazy networking scheme.  Warning: 5V RS-232, needs FTDI or MAX232 to interface PC.

Built In Debounce – Tested to avoid double-triggering, even with the wildest of kid-wand-shaking!

Open Source and Freely Hackable – Soon, you’ll get the schematics, PCB layout, PIC code and hex files.  Have at it.

Posted in Projects | Tagged , , , , , | 1 Comment

Back Up

Well it looks like the site has (mostly) survived the transfer of host, DNS, and many new versions of the tools running on the site.  What a pain!

You’ll notice the new look, hopefully smoother and more readable on mobile – except of course for the image sizing..  Which looks like it may need to be fixed manually per article.  Expect that done slowly over the next month, or perhaps never.  It’s definitely more readable on mobile, and the load times seem to have been greatly reduced.

They’ll be some more tuning here and there, so feel free to comment on anything broken you may find – it will surely get added to the TODO list.


In Progress – Paginate the long posts so the homepage doesn’t take 50 swipes to see the latest content.

TODO – Resurrect the old REB1200 posts that have been stolen from category and page view by the big bad SQL link demon.

TODO – Resurrect the subdomains for the old-schoolie projects

Welcome Back!

Posted in Uncategorized | 2 Comments