What is it?

A1MicroModem is an open-source implementation of a 1200-baud AFSK / Bell 202 modem on the popular ATmega328p microprocessor. MicroModem can be used for things like ham radio APRS, AX.25, TCP/IP over SLIP, experimentation with mesh-networks, long-range wireless communication with sensors (Or friends! Or strangers!). It basically comes in two flavors: Prebuilt or DIY.

It is simple enough that, if you have some basic electronics experience, you can understand and build it yourself with a few components and an Arduino. You can also get a more advanced and prebuilt, fully tested MicroModem directly from me. I manufacture them personally, to the highest quality.

Please note that the resources listed here for building your own MicroModem are for an earlier, more simple version, than the one I currently offer for sale. While the two modems are functionally identical, the version I offer for sale has some technical refinements, and is implemented as an integrated board with MCU, USB and everything on one board, measuring only 3×5 cm. The DIY version is a board with all the external circuitry needed for turning a standard Arduino (or compatible like Microduino) into a MicroModem!

Can I buy it?

Yes! If you don’t feel like building it yourself, I sell a completed version flashed with the firmware of your choice, fully tested and ready to go. Just visit my shop and browse through the options! Buying the modem from me helps me fund continued development of the firmware and hardware. I also sell kits for the easy-to-build version. The kit comes with a PCB and all needed through-hole components for easy assembly!

Resources

Specifications

Here’s a list of specifications for the version I offer for sale. If you have any other questions regarding specs, just send me an email, or ask in a comment on this page.

  • ATmega328p @ 16MHz (2KB RAM / 32KB flash)
  • Powered from USB or external regulated 5V source
  • 51mA idle power consumption
  • Operating range: -20°C to 70°C (non-condensing)
  • Modulated analog output level adjustable from approximately 15mV to 1.5V peak-to-peak
  • Minimum analog input level for good decode is about 100mV peak-to-peak
  • ADC running on 3.3v reference
  • Arduino compatible (You can program the board from the Arduino IDE, over USB)
  • Connectors:
    • USB Mini-B (USB-powered)
    • Audio out (modulator output)
    • Audio in (demodulator input)
    • Ground x2
    • VCC (5V) x2
    • 3.3V output (Max current 50mA)
    • PTT_V+ (for Kenwood style PTT)
    • PTT (logic level PTT signal)
    • UART – RX / TX (Arduino pins D0 & D1)
    • I2C – SCL / SDA (Arduino pins A4 & A5)
    • SPI
      • SCLK (Arduino pin D11)
      • MISO (Arduino pin D12)
      • MOSI (Arduino pin D13)
      • DTR (Reset pin)
  • Flexible firmware support, use one of the provided firmwares, or create your own!
    • APRS KISS
    • APRS SimpleSerial
    • SLIP TCP/IP
    • MP1
  • Arduino APRS library available, create your own APRS firmwares easily!
  • All firmwares are Open Source, and available on GitHub
  • Hardware design is Open Source, and available on GitHub

How do I build it myself?

If you want to build MicroModem yourself, you should have a look at the GitHub repository for MicroModem. It contains all the source-code, schematics, PCB layout, documentation and everything you need to get started. If you’re not familiar with GitHub and just want to get going, here’s the basic resources:

The general-purpose firmware

The MicroModemGP firmware is ideal if you want to build your own applications running over radio, or just want to experiment. It lets you send packets over almost any radio with up to 792 bytes of data per packet. This means you can also use SLIP to use the modem as an TCP/IP interface. The MicroModemGP firmware features forward error correction (12,8-hamming code), 12-byte interleaving, and CRC checksumming on all packets. It should be easy to expand the protocol to support addressing and routing, encryption, or whatever you find useful. If you have a cool idea but aren’t sure how to go about it, let me know and I will try and help! The protocol was written as an example of how to implement a basic protocol with error correction.

Don’t expect live video-streaming and rocking out to DI.fm over this though. This is only 1.2 kilobits per second. Loading Hackaday Retro took around 15 minutes when I tried. If you’re not using TCP/IP you will have better throughput than that though. But TCP/IP works fine for very simple synchroneous-style connections (like: connect to server -> send request -> wait for response -> send another request -> receive another response -> disconnect). Anything complicated, and you will get a lot of packet loss!

Other Notes

I designed MicroModem to be as simple an introduction to digital wireless communication as possible, while still being very flexible and functional. Micromodem will let you learn the basics in how to build digital wireless systems from scratch, and also offer an interesting platform to build further projects on. I hope you will find it educational and useful!

The source code for the modem firmware is very heavily commented, and should be easy to understand. In fact there is more comments than actual code most places. Some of the concepts can be a little daunting just from looking at the code, but it is actually all quite simple, when taken one step at a time. If you have any questions, drop me a comment here and I will try to help out.

Connecting to a Radio

You will need to connect the Audio In port of the modem to the speaker output of your radio, and the Audio Out port of the modem to the input of your radio. Most handheld radios will need microphone level audio on the input port, otherwise the transmitted audio will distort, making packets hard to decode. You should also also connect GND from your radio (usually the GND pin of the speaker jack) to the GND port of the modem. The PTT circuit works by closing a switch (using a MOSFET) between the PTT+ and PTT_GND pins. Most Kenwood-style handhelds will have +3v on the ground pin of the MIC jack, that will trigger PTT when connected to the ground pin on the SPK jack. The PTT connector supplies a logic-level PTT signal. If you can trigger your radios PTT like this, use this connector instead.

33 thoughts on “MicroModem

  1. Hi Mark,

    I am currently working on light communication system, will be open-source of course that and will probably adapt MicroModem for communication. For this however no AFSK is needed, just serial transmission. Any thoughts how the most input/output serialized data to MicroMode without changing the rest?

    1. Hi Musti!
      That sounds really interesting! Can you tell me a bit more about how it’s going to work? Are you going to have serial communication between two modems, directly over a wire connection, or is it still going to be over radio? Also, what kind of communication do you want to send? Is it mostly human communication, or machine data?

  2. Hi Mark,

    the idea is very simple, sending UART data across a distance with light. i have prototyped the system by sending 1200baud UART, modulating a laser and picking it up on the other end with a photodetector. Using it directly is however a problem with reliability, random bit losses etc, so forward error correction is required.

    Instead of implementing this from scratch I believe MicroModem could be used, changing the AFSK part for serial bit output at about 1200baud, possibly with configurable 1 and 0 duration. Since all encoding and data processing is already done, only swapping the AFSK encoding with serial encoding should be required. Any thoughts how to best approach this?

    1. Ah, I understand now! I misunderstood first, thinking you meant “light” as in the opposite of “heavy” ;)
      That’s a very cool project! Great that it was actually working with direct UART! But yes, I can imagine there will be some loss. You should take a look at the MP1 protocol implementation in MicroModem, it has everything you need, Forward Error Correction, 12-byte interleaving and even compression if you want that (using heatshrink lib). It would be pretty simple to adapt it to just take input from the UART serial instead of from the AFSK modem. Take a look at it, and let me know if you have any questions!

      1. Exactly my thoughts, MP1 appears to be perfect for this. Since you are working on rewriting the code away from BertOS, I would like to make my implementation on that, for it to be compatible in future. The aim is really to change only the AFSK part and leave as much as possible unchanged. Please let me know if there is any way I can start working on this before you release the code, privately of course.

        1. Hi Musti!
          The code is out now and compiles on various MCUs, without any BertOS dependencies :) If you want compatibility with the Arduino IDE, have a look at the source for the Arduino library, otherwise you should probably go with the MicroAPRS firmware source, since it is more structured, and it should be pretty easy to rip out the AFSK part and just use that.

          I’d really love to help you write a robust protocol with error correction, checksumming and maybe compression, but I’m taking a break over the holidays here, so I probably won’t get much done. I might give it a go in january though, if time permits :)

    1. Hi Serge!
      Thanks a lot! Yes, I will definitely include that as an option in both the MicroAPRS firmware and the Arduino library. Since they are both pretty new at the moment, I will wait a little until it is tested some more to add more features. There’s might be a few more bugs here and there, so I want to be confident that the base software is working perfectly before adding more exciting stuff :)

  3. Thanks for the heads up Mark, I have seen your release and will look into building upon it shortly, probably mid-January.

  4. Hi!

    Many thanks for sharing this with us!

    Question: For testing I uploaded the APRS firmware to an Arduino. It works nicely, although on my first impression the decoding is only achieved with a very clear signal (S9+).

    I noticed in your layout you reference AREF to +3.3V, the input pin is centered at half of this (1.65V). Can you shortly explain (to a non-C programming master ;-) ) how you trigger the signals and at what voltage you assume your crossing-point (i.e. interrupt is driven)? I would find it promising to know this data, because we can center our signals exactly on that point and maybe decoding rate is going up?!

    many thanks,

    Reinhard

  5. When I make the projekt, how do I control if I get the simple serial or KISS version?

  6. Hi,

    I’ve been looking for web server solution, wired or wireless, and the micromodem looks perfect! I originally looked at the ESP8266 but the micro doesn’t seem to have enough resources for what I need.

    Do you know how much of the Atmel flash/ram is currently used for the SLIP/KISS implementation? I’d like to have it read a few sensor data inputs and present the data as a webpage to a host connected via usb-serial. Do you think it would all fit?

    I guess along those lines, I have a vague understanding of SLIP, but I’m not really sure what KISS is or if it can be removed to make room for more web pages. Which files implement SLIP? Is KISS a common protocol that’s needed to run on top of SLIP?

    Also, I know it’s a loaded question depending on many factors, but do you know as a rough ballpark how much current the micromodem board takes when it wakes up to communicate a few KBs over serial and then goes back to sleep?

  7. Thanks Mark for all your hard work, I got it working perfectly :-).
    Loving the innovation and the open source spirit.

  8. Musti:

    Did you work out the method for a digital (not AFSK) interface.
    I would like to try this with digital modems I have. First try will be with the Sunrise VHF module which has a 1200 baud digital input option. But they don’t do any processing internally – its up to the user.

    Let me know how you did that – Your good work will save me some time.

    And thanks Mark for your original work.

    Henry

  9. Is the functionality there to use the traditional converse mode? Which is a one to one station connect, or one to one via a digi or another station. If not i’m sure it wouldn’t be too difficult for me implement..

    The other mode is general packet sending, or one to many type protocol. Which is what aprs is, but this would be for packet sending. From the sound of it, it already does this now..

    Thanks, and what are the chances of getting one of these? I see they are both out of stock.. which is good in a way..

    I have a few applications I’d be interested in setting up, our club helps alot with public events, and are always looking for more reliable and better ways of doing things.

    Thanks

    1. You can use MicroModem for one-to-one converse mode. The MicroAPRS KISS firmware is really just a KISS-compatible TNC firmware, so it will work for anything that talks KISS over the serial port. I did test this out with AWG Packet Engine on Windows at some point, and it worked fine :) The converse mode is not built directly into the firmware though (but could be, if someone wants to implement it).

  10. While we’re discussing other operating modes, I wanted to try to interface a digital radio – such as the Sunrise radio modules.

    http://www.sunrisedigit.com/en/Show.asp?id=20

    This little Dorji like device is inexpensive and different from the dorji in one interesting way. It can accept digital packets.
    I’m more a radio guy than an arduino guy (although I’ve made great strides in the last 2 months thanks to this threads motivation) , how would one modify the code to output the processed digital data via uart, and not as an afsk. Thanks

  11. Great to see my software from BeRTOS still lives on!!

    I only implemented the HDLC and KISS stuff to enable the transfer of sensor data from remote sections of my irrigation system by sharing the wiring the valves use. As with many things, this got superseded by new technology (in my case nrf24l01+ modules).

    I still add stuff to BeRTOS on occasion, the nrf driver I’ve implemented is in regular use on both AVR and STM32 micros as are an I2C LCD driver. The modular features of BeRTOS are attractive as is the cross CPU support.

    1. Hi Robin!
      Thanks for dropping by! And thanks for your contributions to BertOS. BertOS has been a great help for me in underestanding a lot of stuff about µC programming. And I’ve probably studied your code more than most :) Thanks a lot for all the stuff you’ve contributed. There’s many things I wouldn’t have been able to understand without your code.

    1. You can see the prices on the shop page, both for the modem and for shipping!

    1. Hi!
      I haven’t actually tried it yet, but I did implement the possibility to use many alternative baudrates; 300, 960, 1600 and 2400 baud are all supported. Please note that I have only tested these locally though, and not even over a radio for some of them. So while it is possible, I make no gaurantees it will work in the real world with a HF APRS signal, but please do try and report back!

      You will need to compile the firmware from source for that feature. You just need to change one line in the code. Have a look here:

      https://github.com/markqvist/MicroAPRS/blob/master/hardware/AFSK.h#L50

  12. Hi,

    I’m using this as part of my team’s telemetry package for our rocket, and it’s pretty cool. I was wondering if you have a schematic file for the prebuilt MicroModem for ease of PCB design. Thanks!

      1. Hi, I was hoping for a schematic for the pre-assembled MicroModem you sell – specifically HW REV: c2.4 board. We are using that board in our payload, and having a premade schematic would be really helpful. Thanks!

Leave a Reply to Karl Kristian - LA3BNA Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>