Show Posts
Pages: [1] 2 3
1  Topics / Home Automation and Networked Objects / Re: Power and Data Communications over a single twisted pair on: September 07, 2012, 10:54:55 am

2  Topics / Home Automation and Networked Objects / Power and Data Communications over a single twisted pair on: September 07, 2012, 09:20:57 am
Hi All.

We started discussing about that on this thread,97347.msg917036.html#new but we went OT. So I decided to move it here.

This is the target and assumptions:
- A set of boards, Atmel 328 based, targeted to domotics
- All boards connected through a single twisted pair where either communication data, either DC is conveyed
- Bus topology: star or multi-star
- Bus sharing: multi-master with collision avoidance
- Data transfer: enough to provide command and parameters transfer for remote actuations (i.e. no realtime audio and/or video). A simple 9600bps should be enough for the most actuations
- Cheap and with a small PCB footprint

Discussions on this forum revealed that the bus should supply between 24V to 30V at, more or less, 1A. This is enough for a medium/small installation with up to 50 nodes on a single bus.

These are some already evaluated (and already discarded) solutions. More details on the mentioned thread.
- RS485 transceivers de-coupled with capacitors
- Tx based on open collector and/or open drain decoupled with capacitors
- Tx push-pull based decoupled with capacitors
- Each power supply on each board decoupled by mean of inductors
- Main power supply decoupled by inductors

We already discussed about the modulation that could be used to transmit data over the DC. An FSK solution was proposed because seems something doable taking advantage of some hardware peripheral present in the Atmel. The proposed two symbols where located at, more or less, 4KHz and 7KHz.
The solution to use inductors and capacitors, after simulations, ended up with the idea that it's not a reasonably cheap solution when running at that frequencies. So we need to think to a different hardware and, probably, a different modulation.

The main problem we faced are:

The proposed Tx behave like a pulsed generator. Either if implemented by a driver, either if implemented through an open collector or open drain, it was always powered by an onboard 5V regulated. It was always decoupled to the DC bus through a capacitor thus producing a no more than a maximum of 5V injected signal (when no load at the bus!). The internal resistance of the stage was not able to properly drive the bus when more than two or three units were connected to it.
Idea: what if replacing the proposed Tx stadium with something working directly with the DC bus? That means no decoupling capacitors and (theoretically) infinite current...

The proposed onboard power supply was connected to the bus through an inductor. This prevents the FSK signal to be shorted by the big capacitor in front of the voltage regulator. Without the inductor the capacitor is like a few ohms resistor for the FSK signal. This provides a "short way" for the ground... In order to provide a high impedance for the FSK signal, a too large inductor should be used. The best would be to have NOT a capacitor... but this is not possible for the voltage regulator (right?).
Idea: is there something we can use to replace the inductor? At school I remember I studied that an emitter follower presents an input equivalent impedance that was related to the beta of the transistor used.... Is that something valid even in this situation?

But I think we can start focusing on the Tx part than move to the other problems...

Who is interested on that!? This could poses the basis for a new set of open based protocol, shields and products.

3  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: September 07, 2012, 08:23:52 am
Hi Dario, hi All.
Sorry for the late answer to this thread I started a long time ago... but holidays and other jobs have taken precedence.

I would like to summarize the point where we are and what we understood by discussing on this topic.

We started the idea to develop an Arduino based system targeted to antitheft systems. The first approach was to develop a multi purposes Arduino with some relays, digital and analog inputs, digital outputs, a power supply and an RS485 based communication interface onboard. The main goal was to produce a board able to fit into a standard European 503 box so people could place it anywhere in the house. The RS485 was chosen because it's a well known standard, used on many commercial antitheft systems as main field bus.
We developed two version of that systems. The first version was build around a linear power supply that was replaced by a switching power supply on the second version. I've personally build two units fully working (some pictures are still at the EtherMania Blog) and I've developed a library useful to easy control the onboard SPI expander.
Suggestions came by this thread allow me to change a little bit the original target: the final unit I've on my desk mounts a set of Arduino's compatible headers that allow people to use the board not only for antitheft systems, but as a main block to develop/prototype domotics applications.
And that was the incipit...

but... we wanted more....

We started speaking to replace the RS485 transceiver with a custom communication system that should provide the power required by each board and allow multimaster communications between boards. This should be done through a simple twisted pair, thus reducing the connection complexity. The idea is to have a distributed system where all boards are connected together by a "simple two wire cable" altogether connected in a multiple star topology and, luckily, not terminated.
We don't need super high transfer rates: we need to be able to transfer only actuation commands and other possible parameters like the status of a remote switch, temperature and so on.

Summarizing the full thread contents I can say that:
- we opted for a modulation system based on FSK. Two different symbols for the 0 and 1 bit statuses. The modulation is simple. The demodulation could be done through an hardware comparator embedded on the Atmel micro and measuring the timing between incoming frontends. We can do some hardware assisted time measures so they are enough accurate for the purpose.
- we defined a physical layer based on a set of capacitors, inductors, drivers and comparators/filters. The first were used to decouple either the Tx either the Rx stages from the DC on the bus; the inductors were used to provide high impedance to the FSK signal when feed into the main and distributed power supplies. Push pull drivers were used to "inject" the FSK over the DC line and comparators and active filters were used to filter out and square the incoming Rx signal.

This solution was very interesting and strong enough to produce good results in the simulated environment. We were able to transmit and receive the simulated FSK signal between nodes connected together by simulated cable (with some added resistors and inductors to simulate a real working situation).
Unfortunately this is not something that could be easily replicated in the real world. The proposed circuits work well when large inductors are used. Inductors are big and not cheap. Large inductors are not "friends" of electronic systems because they introduce spikes, high voltages and currents.

So we ended up with a NO valid solution but with a lot of information and experience that I would like to use to start a new thread because I think that here we're now out of topic.

The new topic is here:,121868.0.html
4  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: July 02, 2012, 09:26:46 am
Hi Dario.

You said:
In your previous schematic, using 220uH coils and 1uF capacitor you were in the rage 10-86 KHz (omega0, omega1) so the 50 Hz should be out of these problem. Maybe you are finding this using new values?
Yes. If you have time, please download the latest github simulation version and change the 24V bus supply with a 24V+5sin(50Hz) generator. Look at the voltage before and after the passband filter. It was late when I did it yesterday, so probably I did errors, but I remember something I wouldn't see... :-(

If you have time, please try the numbers that I've proposed.
I did it and I can confirm that the current flowing from the driver is compatible with your results. Unfortunately is not so easy to find a 13mH cheap and small inductor... so I used a 6.8mH inductor in the simulation. The current handled by the driver is reasonably small enough for a commercial unit.

... but...

I don't think that increasing the inductor is the correct way to have something cheap and reliable. If I well understood, we can have the same effect we have increasing the inductor size if we increase the injected signal frequency. If we can rise the modulated signal frequency to something about, for example, a MHz, the inductor reactance will be multiplied by a factor of  100. This let us able to reduce the inductor size.

I know it's impossible to demodulate by software any FSK signal within a MHz range but we can use a MHz carrier to replace the high level of generated FSK. I mean... it's like placing an OOK modulation on top of the FSK.

The receiver side would be a pass band centered on the MHz carrier followed by an integrator and the usual Shmitt thrigger. The recovered FSK signal would be demodulated as before.
The circuit is a little bit complex but I think it could perform better than what's actually doing.

What do you think about?

Marco Signorini.
5  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: July 02, 2012, 01:34:35 am
Hi Dario.
Effectively the inductors I've placed on the first revision of the simulation file are not correct. Yesterday I've got the same conclusions you wrote in your last post. I've simplified the overall schematics in a piece of paper and I could now better understand how currents flows on the circuit. I've then manually calculated the reactances for inductors and for the equivalent circuit.

The problem is that, adding more boards, the overall impedance "seen" by the transmitting board falls down: each board is a "resistor" that adds in parallel to the bus. The overall impedance seen by the transmitter is a set of parallel impedances made by the power supply and the boards.

Increasing the inductors size will reduce the problem because it increases the impedance introduced by each board in the bus.

I've found on the market some inductors with physical size compatible with PCB restricted size. They're in the range of 6.8mH, with an overall current of 0.15Amps. For the power supply I can find a 33mH rated at 1.5Amps.
For higher values, the physical size of the inductor is too big and the inductor is too costly.

If you run the simulation you can see that so big inductors introduces a lot of "artifacts" at the beginning and at the end of the modulated signal. A 50Hz superimposed on the voltage bus is catastrophic :-(

With a commercial three state buffer we can manage up to 30mAmps... so the budget is very limited.

I'm start to thinking that the overall proposed solution is not affordable due to costs and/or technical problems.
I have to think about.

Marco Signorini.
6  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 30, 2012, 03:38:04 am

I tried to follow all the ideas generated by this thread and I've created an LTSpice simulation testbench. I would like to share with the Community the results, so I've created a github repository and I've placed the LTSpice source file on it. You can find the public github repository at this link: Comments and contributions are welcomed!

Here is a brief explanation on what you can find on the file.

- A bus with parasitic capacitor (C4), resistor (R10) and a 50Hz 5V sine superimposed to simulate the effects of a possible noise on the line
- A MOSFet simulated Three state buffer injecting FSK on bus, with a protection resistor (R1). Note that the output stage generates a little short-circuit on the transitions. This is not important because this stage will be probably replaced.
- An Rx stage composed by a banbpass filter and the hypothetical comparator embedded on the Atmel processor
- A suitable power supply retrieving 5V from the bus, used to supply either the Tx than the Rx stages. A load resistor (R11) is added to simulate a realistic 0.5A consumption
- A set of 4 power supplies, with a 0.5A load, added to simulate other 4 nodes on the bus sinking (a lot) of current.

Running the simulation is the best option to understand what's happening on each stage. The most important thinks I can resume here are:
- At the Tx stage the current drawn by the bus is around 30mAmps. It's more than the maximum provided by the driver I've proposed on my previous post. Increasing the resistor R1 will limit the current but reduces the injected FSK voltage increasing the probability of a not well recovered at the Rx stage
- At the Rx stage is mandatory to have a band-pass filter in order to increase a little bit the noise immunity. Best would be to have two bandpasses centered at the FSK frequency (7.35kHz and 4.9kHz) each one, but this will increase the required components. I've added a simple 1st order active bandpass filter centered at 6kHz, with a gain of 12dB, with low cutoff frequency at 4kHz and high cutoff frequency at 8kHz. This increased (a lot) the overall Rx performances.
- The effect of a parasitic capacitors on the bus (I've set it at 1uF that's very huge.. I'm not expect to have something so big in the real world) is not dramatic. It decreases the overall FSK voltage at the Rx stage and increases the current sink from the Tx.
- The effect of a series resistor, introduced by the cable on the bus, is not interesting.
- The effect of a superimposed 50Hz (I've tested a superimposed value of 5V over the 24V of the bus. I think is very high compared on what we can find on the real world) is to change the duty cycle of the recovered signal. Not the frequency (as expected). When no data is present, a set of spurious transitions are generated by the comparator. They should be discarded by the soft-modem library (it's already performing like that).
- Coils characteristics are very important. I used a simulated real world coils I've found on the provided library and not a general coils.
- I've added a set of power supplies to simulate what's happening on the bus when more than one device is added. This power supplies are made by normal linear regulators so the current drawn from the bus is higher than what is expected.
- The current sink by the Rx stage is so low that's not important.

I've attached the schematics and the results of a simulation. In the simulation is present the decoded signal (green), the incoming signal from the bus (the blue, with a big 50Hz superimposed). The red line is the output of the bandpass filter (the signal will be feed on the Atmel pin).

Thank you for following me.
Marco Signorini
7  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 28, 2012, 09:33:12 am
Hi Dario and Rob.

I think is just a matter of finding the best compromise... the best would be to have coils running on linear zone... anything that differs from this situation should work "not bad".
In the real world, inductors are not only the one we add on the power supply... but "virtual" inductors are added by the cable used on the bus... I mean, I'm expecting that in a working installation a lot of variables will be injected by the bus configuration and other and the real situation we will have will be slightly different from what we are simulating with software tools and/or test benches.

I would start testing with a "normal" ferrite based coil rated for more than 2A at the supply side; hundred of mAmps at the board side. With a signal generator and a driver I can inject a signal and measure it on the scope, either coupling on AC with a capacitor, than  directly on the bus, than on the cold and hot side of each inductor.

I'll do as soon I'll be able to have here all needed components (and time).

@Dario. At the very beginning, the RS485 output enable pin was already connected on PB1. We can opt to have the same OE either for the new driver. This will reduce the number of components used (no RC integration for the enable signal generation) but requires a total of four pins for the data handling. It's a huge number of pins... but on the other side this allows the programmer to properly control the bus management.

@Dario again: about using the Schmitt trigger on the output of the op amp used for the receiver... I'm not sure it will be so useful. We already can define what's the level discriminating the zero or one on the incoming side through the selection of a reference voltage applied to the analog comparator inside the Atmel. We can assign this voltage to a little bit more than Vcc/2. We can also define the offset applied at the output of the decoupling capacitor to be a little less than Vcc/2. We can increase the gain of the op amp in order to have it working in the saturation zone for signal with amplitude more than, I don't know, 3/4Vcc. The full system (op amp + comparator) will work as a sort of Schmitt trigger (or something similar) for our purposes....


8  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 27, 2012, 03:38:04 am
Hi Dario, Hi Rob.

@Rob: Welcome and thanks for reading/commenting this thread that started with some easy proposals and moves to a set of interesting ideas!
@Dario: Thank you for your recap on what we are doing

I've attached a schematics that should (I hope) explain what I've in mind. I'm sorry but I don't have the proper symbols for the drivers so I've used a general set. I've also searched some possible components in the market could easily do the job without "consuming" space on the PCB.
I would like to leave free as much as possible the pins on the Atmel so people could use it like on the "standard" Arduino boards. For this reason I'm proposing a schematic that uses external components.

Here is a brief explanation on what I'm proposing.
Let's start on the left side where the FSK modulated output is branched. One leg goes to a three state buffer (the proposed NC7S125 is able to drive a max of 32mAmps, half than what's performed by a 485 transceiver). The other leg goes through a diode on a simple RC stage. The zener is placed here to limit the voltage across C1. The output of the RC stage goes into a NL17SZ17 implementing a Schmitt triggered buffer. His output is used to enable the line driver, attached to the buffer through the R3 (a limiting resistor) and C2 (the decoupling capacitor). In the RC I've added the R2 needed to discharge C1 when the modulated signal stops. I think R1 should be greater than R2 but should be small as possibile in order to have a fast discharge.

On the receiver side the modulated signal coming from the bus is feed from C2 to a not inverting op amp amplifier. This is usefull for two reasons: the first is that it has a very high impedange (so it's not charging the bus) the second is that it can be used to easily apply the required Vcc/2 offset. Vcc/2 is generated by IC2A (it can be replaced by a resistor set and a capacitor butan op amp will present a very low impedance). R6 could be very high (like 100kohms) in order to limit the current sink from the bus.
The op amp gain should be useful to recover a squared modulated signal.

I think that the schematics is missing some diodes to protect output and input stages. Unfortunately it's a little bit complex...

What do you think about? Suggestions?


Marco Signorini.
9  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 26, 2012, 08:02:42 am
Hi Dario.

Yes, being inverting or not inverting is not important... the problem is the same on either conditions. I think this is not a valid solution so we need to think to use a three state driver to allow boards that are not transmitting to detach from the bus.
I'm thinking to something that generates the three-state enable signal without requiring a dedicated pin on the board. Let's imagine to generate a carrier trailer on modulated signal: we can integrate the modulated signal with a "simple" RC circuit used to enable a three state driver. The RC could be driven by a diode connected to the gate of the driver. As soon as the trailer is detected, the enable signal is generated. As soon as the modulated signal stops, the enable signal falls down and disables the output buffer.
We can try to understand what's the minimum RC time required to have a working solution without affecting too much on the data transfer... Adding a Schmitt trigger will probably enhance the performances...

About the coil, unfortunately I don't have any experience on that... so probably the best option is to ask to the Community or setup a test-bench.
I plan to use a normal SMD coil made on a ferrite core.

Marco Signorini.
10  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 26, 2012, 04:57:41 am
Hi Dario.

As far as I can see from the simulation the MCP1401 based implementation, with a series resistor, could be a valid solution. I'm I right?

I'm trying to understand what happens when more than two units are bounded to the bus. I can imagine that the MCP1401 and the resistors (but also the resistors on the "receiver side") will provide a current path for the modulated signal... so more than two units will sink current from the modulated signal on the bus.
This will change the ddp introduced by the series resistor, decreasing the overall modulated signal amplitude injected into the bus.

So, strictly speaking, let's imagine to have a set of N devices in the bus and only one of that devices is transmitting the modulated signal. The modulated signal flows through the capacitors and other resistors and go to GND. The bus will be joined in the middle of a (N-1) parallel resistors and the 1 serie resistor.

Is there something I'm missing?

Thank you for your help.
Marco Signorini.
11  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 20, 2012, 05:24:34 am
Hi Dario.

Yeap! You're right. A resistor is required!

Your point on inductor current rate open a big issue, how big is?
I think we have to study the current budget of the board.

We supposed to have three relays operating to 24V@15mA + 3 LEDs @ 15mA -> 90mA
We could rate the 5V current to 300/400mA, and with the tests we had a 80% switching efficiency. We can imagine 5/28/0.8*0.4 more or less 90mA. We could look at inductors targeted to an average value of 200mA. I did not calculated how much mH are required but looking at the example provided by TI I can assume that we should be on the 20mH range.
I'll do a simple search on the producers site to have an idea on the inductor dimensions but I don't think this will be a problem to find something small enough to be fitted in the board. We have to consider that the overall RS485 + a half of connector will be deleted from the schematics freeing some space on the PCB.

As soon I'll have a spare time I'll try to build a shield prototype to be used to test the solutions here proposed.

Marco Signorini.
12  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 20, 2012, 04:25:29 am
Hi Dario.

Yes, nice discussion!
I think we did the same, or at least something very similar.
I've attached my schematic version here.

On the left side the main power supply is shown. It's a normal power supply but it has a series L1 inductor that drops the modulated signal. The L1 should be rated at 1.5A or more.

Following the bus is a schematic of a board. On the right side the inductor L2 blocks the modulated signal and feeds the power to the switching power regulator. The presence of L1 and L2 avoid that the (big) filter capacitors and the 100nF filter out the modulated DC signals.
The FSK out on the DIG3 pin is feed on the MCP1402 driver. It's a buffer normally used to drive a low side MOSFET but in this situation is useful because it integrates the complete logic and (reverse current) protection for the output buffer. In this case it's powered by 5V coming from the switching power supply but it could be interesting to rise up the value to 10V (I'll tell you mi idea below).
The modulated signal flows through C1 and is injected on the power bus.
The C2 capacitor spills out the modulated value and allows DIG6 pin to demodulate it.

L1, L2, C1 and C2 should be dimensioned.

I've not done any simulation and I'm trying to figure out what type of signals we have on each node. I can imagine that the modulated signal will be 0/5V on the MCP1402 output side. The modulated signal will be centered on 28V on the bus (so a floating value between 25.5V and 30.5V) and a floating value centered on 0V at the DIG6 pin (so -2.5 to 2.5V). Please correct me if I'm wrong.
With this assumptions we can't properly handle the incoming modulated signal... so we need to center it between 2.5V. A set of resistors could be added to the DIG6 pin in order to have an "idle" value of 2.5V. A different solution would be to power the MCP1402 to 10V. In this case the bus will float between -23 to 33V and DIG6 between -5V to 5V. With a clamp diode we can eliminate the -5V having a resulting value between 0 to 5V.
In this last approach there will be no current flowing to DIG6 pin when in idle mode... on the other side a suitable 10V should be generated on the board.

Is there something I'm missing?


Marco Signorini.
13  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 20, 2012, 03:40:05 am
Hi Dario.

I agree to discard the RS485 solution.
As a "push pull driver" I've this on my mind:

It's a compact (protected) unit able to directly drive a line either to high then low side. This avoid the usage of the common load.

I'll try to post you as soon as possible an example of schematics I've in my mind that I think solves the two problems you arise on the <ADD></ADD> section below.

So we can discuss in front of a schematics.

Marco Signorini.
14  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 20, 2012, 02:41:17 am
Hi Dario.
Thank you for your contributes and sorry for the delay in my answers... but my spare time is limited, unfortunately.
Let me answer to some of your questions.

1. The cable. I've some examples of real installations coming from the big players. An example is here: It's available in 100m and 500m and it's made by a two 0.35mmq cables. The number of devices you can power from the bus is obviously dependent by the length of the cable and the consumption of devices itself. We can assume that not all relays are powered on at the same time... so there is a little statistical margin. Looking at this brand I can tell you that the most used power supply is rated at 1.2A@27V and it's normally enough to serve a small/medium size home. When more than 1.2Amps are needed, they provide a sort of "bus merger" that convey data over the busses but electrically insulate them in order to allow the user to have more than one power supplies on the same plant.

2. Injecting the data over the DC bus. I've found an interesting example here: I like the idea to use the same RS485 transceiver but there are some drawback on that. As you can see in the example TI provides, there are a set of capacitors used to block the DC on the data lines. Capacitors are cheap, small and do the job. Some diodes are probably needed to limit spikes that can damage the driver... but I'm not sure because the RS485 driver is already protected.
When data line is applied on the DC it's mandatory to use inductors in series to the power generators/regulators. This prevents that the power regulator low internal resistance and the filtering capacitors "cut" the data injected on the bus. Inductors should be rated in order to provide high resistance to the data signal (that's not a DC signal but it's a modulated signal) and very low resistance to the DC. Inductors are not cheap... and not small... so I think this could be a little problem. This problem is amplified when using the RS485 driver because this type of driver works in differential way, so it introduces modulated signal on either cable on the bus, with inverted polarity, requiring a set of common mode chokes instead of normal inductors! I was not able to find in the market common mode chokes that can easy provide 20mH rated at 100mA (I'm assuming to have a max of 100mA power consumption on each board at 28V) and that are either cheap and small  smiley-cry
This is not a problem at the power supply side where a 1.5Amps rated chokes could be easily found (they are normally used on switching as EMI suppressors).
So I've to investigate about the possibility to replace the RS485 driver with some other and/or replace the common mode chokes with something different....

I think a push pull type driver is required. I think the simple open drain solution is not enough to warranty that the bus voltage drops instantaneously when the drive is open either because the decoupling capacitors are on the line, either because the line is a (small) capacitor.
Due to the presence of the decoupling capacitors, I think that there is no need to have a three-state driver: the current flowing to GND when the push-pull is driven to the low side (when in tx idle state) will be blocked by the capacitor.. so the RS485 is probably something overkill. I'll look on MOSFET drivers...

Ideas and suggestions are welcomed!

Thanks and bye!
Marco Signorini.
15  Topics / Home Automation and Networked Objects / Re: Some ideas for a domestic antitheft system... and probably more. on: June 15, 2012, 04:34:50 am
Hi Dario.

I'm planning to use the T7SS5E6-24. I've already used the 5V version without problem in these years and I like it.
They have a 360mW coil consumption so I can calculate a 15mA for the 24V version... (quite like a normal LED). Having three of that + LEDs I suspect we are in the range of a 100mA at full load.
I think we can also reduce the coil dimension used in the last PCB because I suspect that nobody needs a 0.4Amps on the 5V... and probably reduce the switching output capacitor.

But... speaking about DC and power related... I'm thinking to something that could help to have an easy deploy of these items in the house. I'm thinking to merge the data and power on the same line.
What do you think to have a carrier modulated injected over the DC line?
I'm thinking to something like DTMF tones or the "simplest" FSK. I'm quite sure we can do something like what was used in the sotware modem library for Arduino:

Pages: [1] 2 3