Wireless Microcontroller/PC Interface For $3

uc

Sending data from a microcontroller to a PC usually requires some sort of serial connection, either through fiddly on-chip USB, FTDI chips, or expensive radio ICs. [Scott] didn’t want to deal with this when creating a network of wireless temperature sensors, so he hacked up a few cheap 433 MHz radio transmitters and receivers to transmit data to a PC for about $3.

After sensor data is collected on a microcontroller and sent over radio, there’s still the issue of getting it into a PC. For this, [Scott] piped the data into the microphone port of a cheap USB sound card. We’ve seen this trick before both in the world of microcontrollers and loading programs onto a Commodore 64 via a cassette interface.

Once the data is sent into the sound card, it’s decoded with a a small Python app. Given the range and quality of the RF transmitters and receivers  [Scott] says it’s not an extremely reliable way to send data to a PC. It is cheap, though, and if you need to read sensors wirelessly on a budget, it’s hard to do much better.

Check out [Scott]’s demo of his creation below.

[youtube=http://www.youtube.com/watch?v=GJHFldPwZvM&w=580]

48 thoughts on “Wireless Microcontroller/PC Interface For $3

    1. I love nrf24l01+, I pay less then $1USD each for a standard one or about $9 for a higher powered version with PA LNA and SMA ant. I have also found them to have good power consumption levels (about 12mAh @ 3.3V TX/RX)

        1. It depends Ive got a few in a wireless thermocouple setup tossing data and displaying on an lcd. My room is full of electronics and wireless stuff (emi etc) and the radios are sandwiched between. With two standards (1$) it usually can span my room. With one hi power SMA and one standard it does a pretty quality job making it the length of the house. I would expect much better performance too, say out in the country , or even rural and not in my lab/room.
          All my results are totally unshielded , with no effort to reduce interference. I wanted to see if it would be ok at an RC track as the setup is a head temperature gauge. For one way you can get away with the SMA version on the receiver.

          1. You must have a lot of interference. I easily get the length of the house with the lower power ones. I can even get from outside the house to inside the opposite end of the house.

    1. My ultimate goal is to try different temperature controller algorithms for a crystal oven which is encapsulated in multiple layers of Styrofoam. While transparent to RF, IR wouldn’t penetrate well… although I did consider it! From the PC side, what is the simplest/cheapest cross-platform way to receive IR?

      1. You could literally wire an ir diode and reciever directly to an rs-232 port via a few resistors and transistors, power it parasitically from the port as well. No ttl or usb adapters needed, but this only works if you still have a serial port. (Some motherboards do support COMs via headers and sometimes an IR plug-in board, I’ve forgotten the name of this but it will require extra programming as its actually designed to be reliable, performs modulation, etc.

        1. You only need an ATMEGA328 and crystal clock at the PC end to feed your USB->Serial (a CP2102 will set you back about $1, an ATMEGA328 costs about $2.20 in lots of 5, a 16MHz crystal plus a few capacitors for less than $0.50). You can keep your ATtiny chips at the remote end. Swap the radios for NRF24s (about $1 each) and all your error detection and correction is offloaded, plus they handle clock speed conversion/correction and you can feed data faster than 250,000 bps

          1. *facepalm*

            He told you what he has, and what he wants. Obviously he would’ve gone your way if he has the parts or decided to go with a more expensive approach, but he didn’t.

          2. So showing him (and others who are thinking about the same sort of thing) that the PC end and radios can be done for the same kind of money, without changing remote micro controllers and whatever they are hooked to, and without clocking or interference issues is a bad idea? Was that a facepalm or were you just burying your head in the sand?

        2. I have been using soft uart at 19200/9600/1200 baud for the past years with internal RC oscillator clocked at 4 or 8 Mhz. Usually on the PIC10F2xx or above. After the project is finished and I am done with debugging I switch to a lower frequency, though this can also be done dynamically if you only need bursts. It might be possible to power everything parasitically from the USB-RS232 converter.

  1. Bluetooth modules are dirt cheap now as well. I recently got a couple from ebay for $7 a piece. Transmission distance was longer than he showed here and you don’t have to worry about false data/noise. Sometimes spending a couple of extra bucks is worth it to avoid headaches.

    But, as a hack it’s neat.

  2. Nice! You will probably find that there are other things on that band or that the receiver is picking up a wide range of signals? You may get better results if you use a circularly polarised antenna (maybe this won’t work for 433Mhz? I use it on 5.8Ghz and works great) which should reduce multipathing and rejecting some unwanted data. Have you looked into the NRF24L01? They use SPI so that may be a bit more complicated.. but it does have a ton of features!

    1. I haven’t seen any noise on that frequency, but I haven’t looked for too long. Also, I was unaware of NRF24L01 until now – they look fantastic! A little over a dollar each on eBay too. I’ll have to buy a few and check them out…

      1. I’m currently doing a project with them and they’re great :) There are 2 libraries for Arduino that do a lot of the heavy lifting (Mirf and RR24) and the modules can work 2 way (so theres no seperate ‘transmitter’ and ‘receiver’ hardware to worry about). I got 115200 baud transparent serial working both ways pretty quickly :) But still, manually pulsing bits and reading it the other end is fantastic work! :D

  3. AM radios are notoriously sensitive to interfearance. To minimize bias drift and DC stabilize the receiver, preceded each transmission with a train of 010101… For at least 16 cycles, then a start of message signature, then use Manchester encoding to maintain the DC balance and you will more consistent results. Use a checksum and design your protocol to send frequently so you can tolerate tx errors

  4. these modules wont work with multiple transmitters active at same time as these are simple ASK modulates. for multiple modules to work together you have to go for Time-division multiplexing which can be pretty difficult if you are powering sensors individually.

    1. Since these modules can transmit 700+ data points a second, if I send a few points it will take only a few hundredths of a second. If I send an identifier then the data “bursting” for a fraction of a second every several seconds, yeah every once in a blue moon they’ll chime at the same time and no data will get through, but usually they won’t overlap. This is a simple, cheap way to allow multiple transmitters to send data to the same RX, as long as they loosely take turns.

  5. I did long distance this way using DRM for a lab project. It’s not practical till you can source ICs that can handle the bandwidth through buffering or frequency clock.

  6. I tried sending mirror imaged bytes for parity over wireless. I found it’s not as reliable as you would think, I STILL got false positives. I had to actually calculate an odd-bit checksum, and an even-bit checksum and that solved the problem for me. I would bet that the problem is if you sent something like 0b11100111 then the inverse would be identical and any problem interpreting the signal may bleed over to the inverse check.

    Doing an even-odd checksum is beneficial for sending more than 1 byte of data at a time because no matter how long the message, there’s just 2 bytes sent with it.

    In any case. Very cool. I was especially fond of the QT interface. Makes me think I should get back into Qt as my “any OS” programming solution.

    1. Thank you for bringing up this topic! I recommend everyone consult the pretty ARRL band chart http://www.arrl.org/files/file/Hambands_color.pdf and observe 420MHz-450MHz is indeed the UHF amateur band in the USA.

      (A) Since the signal is so weak it can’t be detected more than a few feet away, I can’t imagine I’m causing significant interference with amateurs (who mostly operate FM in this region anyway), and as far as the FCC goes I doubt black helicopters will swarm my facility.

      (B) As a licensed amateur radio operator (call sign AJ4VD), I have privileges to transmit
      in this range anyway, so I’m even less concerned.

      (C) These modules can be purchased in a variety of frequencies, so if anyone is truly concerned about using an unapproved radio device in the USA, ease your mind by choosing RX/TX modules which are sold in the USA and specifically certified by the FCC.

      1. As another licensed amateur I really don’t care about another Amateur’s operation if it doesn’t affect others. Now that was brought up my curiosity became on the probability of others stumbling on the transmissions. While the are voluntary the band plan for 70 cm is voluntary your operation may be in or near the segment for low power CW operation, CW is basically a digital AM whose receiver will hear your signals. In the event your sharing the code meets the FCC definition of “any technique whose technical characteristics have been documented publicly” you are good to go. Anyway it’s always good to read accounts of radio hams experiments, thanks for sharing.

      2. > (B) As a licensed amateur radio operator (call sign AJ4VD), I have privileges to
        > transmit in this range anyway, so I’m even less concerned.

        I do hope you’re including your call-sign as part of the data transmitted if you are going to operate these under part 97, no greater than every 10 minutes, and at the end of your transmissions, rather than a part 15 “intentional radiator”.

        As far as band plans are concerned, this is the ATV simplex range. They’ll likely not care what you do.

        What we don’t want is someone unlicensed in our band to fire one of these up with a better antenna and/or amplification which would exceed the Part 15 limits.

    2. I believe Scott is licensed. At these power levels it’s unlikely that interference to others will be caused. As long as his call is in the data stream, the data transmission protocol is a common one isn’t using this for profit he should be fine. However it sounded like he was using a protocol of his own making, if so that might attract the interest of of others amateurs in range of the signals drawing attention to his project.

Leave a Reply to SWHardenCancel reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.