research. Research. Don’t reinvent a wireless protocol that’s robust.
If your link is unidirectional, you need a protocol that has some way for error correction via FEC or frequent-enough retransmission, but with error DETECTION in either case. This is minimally a half-sum but better, a simple CRC8
Projects section on AVRfreaks
PIC projects
These cheap on-off-keying radios (OOK) rely on an average voltage level at the data slicer, meaning the integrated data stream needs to have about equal numbers of 1s and 0s in sequence. Often, this is done with Manchester coding in the transmitter.
If you are just sending fixed datums, like on, off, up down, then use one of the coding chips made for this. If you are sending bytes with highly variable data, then you need the scheme discussed above - and implemented in a tiny microprocessor.
hcker2000:
Needs to be cheap so the xbee is out. Any tips on rolling my own?
You don’t want to.
Xbee is one direction. nRF24 is another option if you don’t mind a slightly lower level interface.
Those 433MHz transmitters are bare-bones. They simply provide a way to pass your own digital carrier over the airwaves. Transmitter control, etc, is going to be a challenge.
the good news is that it will not be bi-directional and simply needs to send an ON state if the sensor detects any thing.
I could probably get by with out handling any cross talk because by nature the sensors are going to be far apart and there is very little chance of them all tripping at once.
Holtek and others sell encoder and decoder pairs that are designed to work with these inexpensive transmitters and receivers. Have a look at the Rentron site to get you started in your search:
The receivers and transmitters are matched by address. But, set the single receiver and all transmitters to the same address and have each transmitter “press” a different button. That should give you four or eight transmitters depending upon the chip set you buy. You do need to manage collisions between transmitters, but you would have to do that anyway, and you shouldn’t have any issues with false positives.
For roll your own stuff, use a simple protocol with a checksum at the end of the packet. if the check sum on the receive end is correct, then the packet is good. If it’s wrong, then toss the packet. You’ll need that for more than just your transmitters stepping on each other.
Make sure that the transmitters have random delays between sending packets. Or at least make consecutive delays different.
riden:
The receivers and transmitters are matched by address. But, set the single receiver and all transmitters to the same address and have each transmitter “press” a different button. That should give you four or eight transmitters depending upon the chip set you buy. You do need to manage collisions between transmitters, but you would have to do that anyway, and you shouldn’t have any issues with false positives.
Thats right each encoder chip has 4 or 8 input pins. So on each sensor i would use a different input is what your saying correct?
hcker2000:
Thats right each encoder chip has 4 or 8 input pins. So on each sensor i would use a different input is what your saying correct?
Yes, that is right. Unless all the transmitters are on all of the time (and that would be in violation of FCC Part 15 in the U.S.), this approach should work.
hcker2000:
Thats right each encoder chip has 4 or 8 input pins. So on each sensor i would use a different input is what your saying correct?
Yes, that is right. Unless all the transmitters are on all of the time (and that would be in violation of FCC Part 15 in the U.S.), this approach should work.
Na they will only be on to transmit if the sensor has sensed some thing. I got to thinking about it and I dont even really have to know which sensor has been tripped but it would be very nice.
Dose any one know where to get the encoder chips for cheap? I am trying to keep the cost of the sensors down so far with sensor + pic + transmitter I am at about $13 each. The chips are going to add like $5 to each one
Yes, the chips add about $5 each to the project, but they are actually PIC devices with firmware that has been designed to address the issues that people have discovered with these inexpensive RF links. Bruce at Rentron has worked very hard to deliver a quality product. However, if you want to use stock Holtek chips, they can be bought cheaply from Futurlec and more expensively from Digikey (and probably other U.S. distributors).
For $4 you can get a 433Mhz or 915Mhz RFM12B transmitter/receiver. With proper programming you could then create a very simple peer to peer network, polling or time slicing. These modules or pretty sophisticated and if you Google them you can see some people playing with simple network protocols for them.
For no money you can simply implement manchester encoding yourself with those cheap rf transmitter/receivers you already have or 2byte → 3byte encoding in software and skip the hardware encoder/decoder all together.
For the cheap modules I had a simple 2byte → 3byte scheme written for my microcontroller based on white paper source code from radiotronix. Then I replaced it with code from an Arduino library called VirtualWire. It’s an Arduino library, but if you google it, you can find the C source code and it’s easy to adapt to any uC, all you need to do is attach it to a hardware timer set to 8x your required bitrate.
TheDirty:
For $4 you can get a 433Mhz or 915Mhz RFM12B transmitter/receiver. With proper programming you could then create a very simple peer to peer network, polling or time slicing. These modules or pretty sophisticated and if you Google them you can see some people playing with simple network protocols for them.
For no money you can simply implement manchester encoding yourself with those cheap rf transmitter/receivers you already have or 2byte → 3byte encoding in software and skip the hardware encoder/decoder all together.
For the cheap modules I had a simple 2byte → 3byte scheme written for my microcontroller based on white paper source code from radiotronix. Then I replaced it with code from an Arduino library called VirtualWire. It’s an Arduino library, but if you google it, you can find the C source code and it’s easy to adapt to any uC, all you need to do is attach it to a hardware timer set to 8x your required bitrate.
More good info. Thanks. Have you ever done any thing with the multi-transmitter and single receiver setup?
The only thing I have with the those regular cheap rf modules is a single transmitter and receiver. Other than all the silly test setups I have, the only practical thing I’m doing is using one as a remote for my gas fireplace.
I’ve really turned to using those RFM12B modules. From the manufacturer they are pretty cheap, they have a bunch of nice, more advanced features, but not crazy like a TI CC1101 or anything. If you want samples in singles, futurelec has them in the dual row pin configuration. If you get them from Futurelec they are twice the price at $8 each, but you can get them in singles. These things are seriously pretty small. I was pretty amazed when they got here.
I started playing with MSP430’s and I’m trying to make a really stripped down network protocol that will handle really simple nodes. I just got started on this a short while ago. It will be a simple time sliced multi node, single master protocol; no mesh.
Multiple TX to one RX: I have done exactly that, and it certainly works. Sharing one channel is a challenge but it’s possible. I regret doing it with these units though, and I seriously recommend thinking about spending the extra on something like the nordic or xbee units. I just found the 434 units were completely unreliable in their reception no matter what I did.
Actually I also used the holtek encoders/decoders to start with. If you already have a micro in the circuit then don’t bother with them, just use the micro UART.
In any case I’d be glad for someone to profit from my long and painful experience with these things, so drop me a line if you have questions about how to go about it