Shop OBEX P1 Docs P2 Docs Learn Events
Simple wireless data transmission — Parallax Forums

Simple wireless data transmission

eagletalontimeagletalontim Posts: 1,399
edited 2014-08-11 07:59 in Propeller 1
A continuation of my power meter logger... I am now attempting to learn how to send a signal to the "main brain" of my project via a very simple wireless circuit. Every time the external sensor picks up an IR pulse, I would like to send a signal to the "main brain". Any simple schematics using minimal components available and have been tested with the PROP?

I have researched and found very simple AM transmitters using a single crystal but those all have 4 leads. I only have crystals with 2 leads.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-08-10 15:57
    I don't know if these transmitter receiver pairs are still $0.99, but they're still probably inexpensive. I'm not sure, but I'd think it should work for this application.

    The nRF24L01+ transceivers are another inexpensive wireless option. I have info on these transceivers near the bottom of post #1 of my index.

    I think you could run into legal issues if you try to transmit directly with the Prop. IIRC, there's too much noise on other than intended frequencies.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-08-10 16:07
    I could buy a premade wireless setup since the FCC may have an issue with me broadcasting data from the electric company power meter... It would probably be best to get an Xbee setup, but I am not sure if RadioShack sells them. (Don't want to have to pay shipping and handling...) I plan on the IR sensor circuit running from a solar charged battery so the power usage needs to be as low as possible! By not using a micro controller on the sensor side, the power consumption will be much less!
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-08-10 16:37
    Hmmm. Xbee seems quite expensive for my project. I would need 2 modules at over $20 each plus shipping. That is around $50 just to send a pulse via wireless..... Ouch..... I don't see any information on the above $0.99 modules and I am extremely impatient! I can't wait a week or a month to get parts I need. By the time they got here, I would have moved on to another project or forgot why I ordered them in the first place.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-08-10 18:55
    Duane's link is one option. Those cheap RF modules transmit audio (you can connect the rx to an amp and listen if you like), so if you are monitoring an AC waveform then you will get an AC waveform out the other end. This is great if you are monitoring pulses from, say, an IR led. But what they won't transmit is DC, so if you are not using much power and the led is not flashing very often, that won't go through. Ballpark audio is 20Hz to 20Khz, ie if the pulse rate is less than 20Hz, it won't go through and you will get DC drift and other problems, like the pulse may not be a square pulse, but rather a positive brief pulse on the leading edge and a corresponding negative pulse on the trailing edge. A scope helps to visualise such things.

    In general, with radio that works in the audio band, you should be able to debug it replacing the radio link with a wire link and a blocking capacitor (1uF greencap). And if it doesn't work with the blocking cap and wired solution it won't work with wireless. There was a long discussion a few years back on the picaxe forum about this - and the answer for sending data was first to send a preamble of the ascii character which was binary 10101010 and send about 12 of these first to bias the AC into the correct region. Then keep the packets short, or send every alternate byte as the inverse so the number of 1s and 0s is the same. Poor man's Manchester coding.

    Then you can go up one level. Use a propeller or picaxe or similar to monitor the pulse as a digital input. Process than and send it out to something else via a serial link. Debug using wired serial links, then drop in RF transceiver modules to replace the serial link (these are about $10 on ebay). RF transceiver modules have an onboard microprocessor that does filtering and handles changing the baud rate.

    I'm looking into similar things at the moment. I'm reading through this site http://openenergymonitor.org/emon/. They are taking things to a higher level - sampling the actual waveform and calculating the true power. And also monitoring the voltage and the current waveform which gives the current direction (my meter also has a little flashing led, but it doesn't tell me if it is 5kw in which is running my air conditioner, or 5kw export from the solar panels).

    This stuff can get a bit complicated. I am tempted to go down the Arduino route as it has all been done before on that website. But I can see some scope for doing this with the propeller - maybe a propeller and an I2C ADC chip.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-08-10 19:10
    The one I have made already works pretty good. It calculates the distance between pulses and gives me a per second watt usage. At least a pretty close reading. Every 1 pulse equals 1 watt hour used. This is the same for both my meter and my neighbors meter. They are both different. I think the wireless option is not the way for me due to cost and FCC issues. I have a few friends who would love to have a system like my setup so I would have to keep things legal and cheap.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-08-10 21:13
    I've just caught up with your other posts - looks like you have it working well. The 1 pulse/1 watt is the same as my meter here in Australia. I've reading through about pulse counting now http://openenergymonitor.org/emon/buildingblocks/introduction-to-pulse-counting.

    Are you using a Propeller to do the sensing? If so, a and you have some spare pins, there would be quite a few options to get that prop to talk to another prop - either by wire or by wireless.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-08-10 21:31
    There are over 20 free pins since I am using the "programming pins" to serve as both programming and serial communication. Only 1 pin is needed to connect to the sensor to receive the pulse. There is 1 cog used on the PROP for computer data sync and the main just loops to wait for IR pulses. The Prop stores the pulses from the meter in a variable and every hour (The PROP time is synced with the computer), the VB program will request the value of this variable. If the computer never requests the variable (Maybe the computer is off), the PROP stores the value to the eeprom for retrieval the next time the computer requests it. This prevents missing segments in my data logging in case the computer is off or disconnected from the PROP.

    The current sensor is a radioshack IR detector that is wired up to a 50ft cable run under my house out to the meter. There is no circuitry attached to the meter. Just the IR sensor and the wire running back into my house. I would like to eliminate the 50ft of wire and all the electrical tape that blocks as much sunlight to the sensor. (Beau helped me with the detection circuit in another post.) Now that I can have a "stand alone" circuit run on the outside of my house, I was hoping to eliminate the 50ft of cable which seems a bit expensive when trying to go wireless and accurate. Since the PROP calculate the distance in time between each IR pulse to calculate the current Watts being used, I need to ensure the data is not lost and the time between pulses is accurate according to the meter's IR output.

    EDIT * : The reason I want to go with the simplest transmitter is to avoid using a PROP on the sensor outside. I plan to have this run via a small solar panel / battery and it needs to be able to run all night and even on cloudy days. The least amount of power usage, the better. I have several small 6V solar panels that I can use for the external circuit and a battery pack that holds 4 AA rechargeable batteries.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-08-10 21:50
    I was hoping to eliminate the 50ft of cable which seems a bit expensive when trying to go wireless and accurate.

    If you have already pulled the cable through, you might already have the best solution?! Just thinking of the alternatives - battery, solar panel, boxes for these, wireless tx/rx.

    Thinking aloud, it does seem strange to need solar panels when you have all this energy nearby in the meter box. I've been thinking through what you need to measure power - current and voltage transformers etc and it all takes space. My meter box already is pretty full up. Your solution you have might well be the best. I like the way you are logging locally if the PC is off.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-08-10 21:55
    The idea of using wireless is from some friends who are wanting the same kind of setup for their house. They don't have a crawl space under their house so wireless would be the best option for them. Don't think it will be cost effective for that though. I already have a weather proof box installed next to my meter that was from another project that I phased out so it could contain all the sensitive components for this project if I did decide a wireless route.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2014-08-10 22:38
    Sort of like this http://www.ebay.com.au/itm/Wireless-Energy-Monitor-for-Smart-Meters-/261181383086?pt=AU_B_I_Electrical_Test_Equipment&hash=item3ccf9fa1ae&_uhb=1

    Little thing that clips over the led. Battery powered wireless tx. receiver in the house. Hmm - does it upload to the internet though? The arduino solutions do, and the ethernet shields are only a few dollars.

    So many possibilities. I've also found some DIN mounted energy meters that give you the pulse output rather than needed to hook into the led. For 240V so not suitable for the US, but they are under $25. Depends if you are comfortable redoing mains wiring.

    I reckon you are onto a winner with your design.
  • Heater.Heater. Posts: 21,230
    edited 2014-08-11 03:29
    What kind of range are you looking for?

    Perhaps an NRF24L01+ will do? I'm just about to check them out myself. I'd get one with a stick antenna. Low power, very cheap, easy to drive.
    http://www.ebay.com/sch/i.html?_nkw=NRF24L01%2B
  • Mark_TMark_T Posts: 1,981
    edited 2014-08-11 05:00
    The nRF24L01+'s are short range only, they are 2.4GHz with PCB antenna.

    For longer range transceiver modules using lower ISM bands are better, like the RFM22
    (which I think come in 433, 866 and 915MHz versions) You will need an external aerial
    but that's partly why the range is much better. Simple 1/4 wavelength wire antenna will
    do well.

    RFM22's are a few dollars IIRC.
  • T ChapT Chap Posts: 4,223
    edited 2014-08-11 05:19
    50' under a house is likely more of a distance that you need compared to a direct line of sight with wireless. What is the distance in wireless terms? If there is not a lot of structure to pass through, the nRF24L01+ with whip antenna is a great solution for wireless Prop applications. You may even get the chip antenna version to work.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-08-11 05:49
    The range is at most going to be 100ft indoor range. Since it is connected to a computer, there will be a bunch of other noisy circuits around the main receiver.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-08-11 07:59
    You can get little Arduino type boads for a few dollars on ebay and the nRF24L01+ (as mentioned in post #2) are less than $2 each.

    I believe there's code to run the nRF24L01+ from the Arduino. They can be controlled with an ATTiny chip.

    When I did some range tests with the nRF24L01+ a few years ago and the only places I had trouble communicating between ends of our home was when a large appliance (oven, water heater, etc.) was between the two devices.

    If the $2 version of the nRF24L01+ doesn't provide enough range, you could move up to the version with an antenna.
Sign In or Register to comment.