Pages: 1 2 [3] 4 5   Go Down
Author Topic: Some ideas for a domestic antitheft system... and probably more.  (Read 15863 times)
0 Members and 1 Guest are viewing this topic.
Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

assuming a system over 10 nodes rated at 24V and 100 m of bus for 1 mm2, at the end of the line we have lost 4V (4 Ohm/100m). Its enought to operate the coils (>16V) and power the boards. I was thinking that a single cable with two twisted pairs maybe one way to power the boards and get the signal.

Unfortunately cable with two pairs doesn't have size larger than 0.5 mm2, at least on eBay. That for sure are too small cables to carry out the power, and may create us problems in case of larger boards (with more relays).

Have you some suggestion?

In the while I'm looking to the library SoftModem.

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

I've looked a bit into SoftModem and I've to say that is really a nice library. It build a binary-FSK modulator/demodulator in hardware, using the analog comparator and an internal timer. Is interrupt driven and so isn't so heavy for the uC.

In attachment you can found the electrical sheme that I've used to build a bus of AVRs without any additional hardware (out of wires and resistors). I was able to readback what was written on the bus and find out collision on the bus.

I would like to build a library based on SoftModem, it will use a different managment of the buffer and include CRC and collision detection. This library will be a base option that shall be included in Souliss/vNet also.

Now the problem is find out a way to move the data over a powered bus, thats no so simple. Now I'm using a floating bus (see the attachment) that offers less realibility of a open-drain one, because the resistor split the voltage and so, the noise can create more problem rather than a solution without voltage splitting.

Now the question is how to insert a low 3.3/5V voltage over a 24V bus. I've always seen the capacitve coupling used to filter a DC signal and I'm not sure on how the same can be injected in.
Looking to some scheme in internet, looks that capacitive coupling shall be enough (with maybe a smith trigger in between), but I'm not sure about this. I will try to study the problem.

Let me say that with this library we can read back what we write, that means have an easy way to detect the collision. So we shall try to retain this capability.

Regards,
Dario.



* IMG_20120617_130446.jpg (276.71 KB, 1536x2048 - viewed 61 times.)

* IMG_20120617_141013.jpg (399.35 KB, 2048x1536 - viewed 42 times.)
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

In the while of the development of the library for the FSK (it will require a bit, because I've a planned release of Souliss in short time), I'm studying the circuit with a SPICE simulator (I'm using LTIspice) to learn more about a singnal over the power line.

As now I've cleared some of my dobuts, the first was how I can inject a low voltage over a cable that has a bigger one, the answer was the internal generator resistance.
The simulation has highlighted a point that I've forget, also if we use a FSK wave that is always >0V, after the filtering it will have a wave above and below the zero, so an offset is required.

Now the interesting matter is find what happen in case of collision, what I mean, I've studied (in my previous attachment) what happen on the electrical side in case of time-invariant bits. Now the goal is understand what happen when a bit is no longer a time invariant voltage, but a modulated one.

I will try to post some result as soon.

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
EtherMania - For network enthusiasts
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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: http://www.catalogo.bticino.it/sites/default/files/media_files/BT00094-a.PDF. 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: http://e2e.ti.com/support/interface/industrial_interface/f/142/t/75687.aspx. 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.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

yesterday I've played with paper and simulator to find out how data are injected and basically how much voltage is really transferred.

On my side, I think that the RS485 solution shall be discarded, just because all the available IC doesn't allow to read back the values that are on the bus. This feature is important to build an easy collision detection. Relevant the push-pull, the main problem is the requirement of a dual-voltage +V,-V.

I'm using a capacitive coupling and a resistor to protect the output pin in case of collision. In fact, if two devices write at same time, the pins output pins may be damaged. Damage may happen if one pins apply H voltage and the other L, the resistor protect the pins and avoid the use of tri-state devices. The RS485 chip, use a tri-state enable to avoid this problems.

The open-drain will not create problems in discharging of the the bus, but require a non-floating bus. If fact, the bus will be forced at H voltage and discharged by the open drains MOSFET when a L shall be transmitted. Using an open drain, there is a common "load" for all the MOSFET on the bus an collision doesn't make longer electrical problems.
In case of MOSFET, on the line is required a "load" that shall be an inductor. Using a non-differential transmission, just a classic single inductor can be used. Problem on space and cost shall be addressed.

So I'm proposing two ways:
- Capacitive coupling with a protection resistor,
- Capacitve coupling with external open-drain MOSFET.

The first solution offer a less reliability to noise, because the voltage that is "injected" on the bus is splitted between the resistor that protect the pins, rather the open-drain solution offer the full voltage over it.

In my test I was using the internal resistor of the main power supply to transfer the FSK wave from the pins to the bus, but due to small resistance, the voltage drops mainly on the protection resistor. Using an inductor as load will solve the issue, if in series with the bus, the voltage will drop on it and so on the bus.

I will post an electric schematic to be more clear.

Let me know your opinion.

Regards,
Dario.



Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

<ADD>
Two more issue that shall be taken in account:
- The 100u capacitor used to filter-in the input voltage to the DC/DC will act as filter for the FSK-wave. During the transmission (discharging) this will be in parallel to the capacitor used for the coupling on the bus.
- The DC/DC will produce noise also on the bus, this noise will increase if the inlet 100u capacitor will decrease.
</ADD>
« Last Edit: June 20, 2012, 03:35:21 am by veseo » Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
EtherMania - For network enthusiasts
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Dario.

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

http://ww1.microchip.com/downloads/en/DeviceDoc/22052b.pdf

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.

Thanks!
Marco Signorini.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

as push-pull I've intended this, the one that you inserted looks more likely a power CMOS.


Let me propose my schematic for open-drain solution, in attachment the draft.

Interesting discussion.

Thanks!

Regards,
Dario.


* FSK over PowerLine.png (17.16 KB, 791x527 - viewed 46 times.)
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
EtherMania - For network enthusiasts
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Thanks!

Marco Signorini.


* foto.JPG (1694.11 KB, 2592x1936 - viewed 63 times.)
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

yes are basically the same, out of one point, your are using a CMOS output and I'm using an NMOS open-drain one. I've only one concern, if two node are forcing an FSK-wave, you will have before C1 a mixed wave, so basically you are connecting directly +V or GND from the MP1401 to a voltage value that could be between +V and and GND. So you can short the MP1401 output drivers during  a collision.

In your schematic I wonder to add a resistor or a tri-state gate. The resistor will reduce the noise reliability, rather the tri-state gate require some logic (and pins). In my schematic, I don't have this problem due to the use of a open-drain solution.

I agree in the use of an inductor to filter the inlet feed of the power to the DC/DC converter, it will solve the problem.

Your point on inductor current rate open a big issue, how big is?

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
EtherMania - For network enthusiasts
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Dario.

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

Quote
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.

Thanks!
Marco Signorini.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

this are the first results of the simulation, not bad, but the resistor to protect the pins doesn't work so well. This simulation shall be equivalent to the circuit that you have proposed, adding a protection resistor and an offset on the output.
The first FSK-OUT (PB3_1) is active, rather the PB3_2 is not, but the voltage injected on the bus goes back to the inactive pin, thats not nice!

I will try the option with the open-drain solution, where the problem that now I've should disappear.

Let me know if you have any comments.

<EDIT>
I've pressed two many times 0 key for C3, the right value is 220uF that will give pretty similar results.
</EDIT>

<EDIT2>
The MIC845N may fit the requirement and can be used for input and output, because has a smith trigger embed.
http://www.micrel.com/_PDF/mic845.pdf
</EDIT2>

Regards,
Dario.


* FSK-BUS Circuit.png (197.11 KB, 1280x1024 - viewed 56 times.)

* FSK-BUS Graph.png (218.8 KB, 1280x1024 - viewed 49 times.)
« Last Edit: June 20, 2012, 09:24:35 am by veseo » Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

yesterday I've sized a bit better the resistor, in attachment you can found the results.

The first graph is with the input 1 with a "1" wave, rather the other with input 2 with a "0" wave. In both is shown the voltage at the output of the not used MCP1401, that basically is fixed, so the voltage on the mosfet is in accordance with the issued command.

Relevant the coils saturation, using a single coil that is not coupled the saturation problem shall not occur. Does the coil use a magnetic support (like the one used in the transformers to couple the coils) ?

Thanks.

Regards,
Dario.


* FSK_Circuit.png (212.68 KB, 1280x1024 - viewed 48 times.)

* FSK_Graph01.png (224.15 KB, 1280x1024 - viewed 48 times.)

* FSK_Graph02.png (209.01 KB, 1280x1024 - viewed 46 times.)
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

0
Offline Offline
Newbie
*
Karma: 0
Posts: 38
EtherMania - For network enthusiasts
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Napoli
Offline Offline
Sr. Member
****
Karma: 7
Posts: 356
Post fata resurgo
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Marco,

yes is a suitable solution if tri-state is not used. Regading the overall voltage transferred, you are right, it will change with the number of devices connected on the bus. On the proposed circuit, the MOS state is inverting type, so when not used, the pin is a 5V and not at 0V. This means that there is no sink, but a source, that will rise the overall voltage. Increasing the number of devices, the lower values of the wave will move near 5V and this may lead a miss communication.

The problem can be solved with tri-state devices, used only for the TX. The problem is that it will require one more pin to set the third state, or we have to enable the third state only when there is no output wave, but I've no idea on how get this.

Any idea?

Back on the coils, is my assumption right?

Thanks.

Regards,
Dario.
Logged

Souliss - Open-source Distributed Home Automation with Arduino and Android

http://www.souliss.net
Follow at @soulissteam

@veseotech

Pages: 1 2 [3] 4 5   Go Up
Jump to: