Hi All
I just want to thank all of you who contributed to this thread .
i have just managed to finish the project using the method suggested by
Darrel Taylor of which this project would not have being possible Great Guy
Lets just remember what the original problem was .
[QUOTE The Problem]
Hi Everyone
I am written to pick up some advice from you on a project that was presented to me.
i am working a design that would be fitted in trallers . the aim of the project is to have an Lcd display in the cab of the lorry that would tell the driver the lenght & High of the trailler
on the display.
BUt it is not as simple as if sounds.
i client does not want ANY wire connection between the cab and the trailler and does not want to use wireless.
The way he wants this to work is that there would be 2 units one in the cab and the other in the trailler.
The unit in the traller would be programmed with the lenght & High etc at programme time and the data would be stored in the internal eeprom of the pic.
so all the trallers would have there data stored there so they can be used with any cab.
The data stored in the traller would need to be sent to the unit in the cab
But there is only a single wire connection between the cab & traller (Which is the reverse line when not in use)
Question How can i communicate between the pics using a single wire to sent the data
is this posible or is he asking for too much.
Personally i would go for wireless using RF modules but he dont want any cable to be touched apart from the line i talked about.
Is there a way of doing this regards
Isaac
[/QUOTE]
The Suggestion By Darrel Taylor
Just thinking out loud here.
If on the cab side, the current to the reverse lights was monitored with a hall effect current sensor. And, on the trailer side a normally ON solid state relay or FET was placed in series with the light bulbs. Then the lights can be turned on and off (fast enough not to interfere with the lights being on) by a PIC sending serial data. The current sensor in the cab would pick up that signal easily for the receiving side.
Then every time you put it in reverse, the 24V will power up the PIC and it'll transmit what it's attached to. Same thing could be done with brake, turn signals or running lights
I did actually that using the Transmit line of the pic in the trailer unit to turn ON/OFF a solid state Relay with the lamp powered via the NC contact.
And then in the Cab unit i used a Hall Effect Current Sensor to monitor the same current of the lamp .
This current is converted to an analog voltage by the current sensor the one i used was ACS712
http://www.allegromicro.com/en/Produ...0712/index.asp
This sensor give a 2.5v output voltage when there is no current flow the voltage increases by 66 to 185 mV/A output sensitivity if there is current flowing in one direction and decreases by the same amount when flowing in the other direction.
But for this project the connection was made so that the current flow in the +ve direction to give us a positive voltage output.
I then fed this output to the +Ve input of comparator (LM311 pin 2)and used a ref voltage
of 2.52v applied to the -Ve input to the camparator (LM311 pin 3).
This way when there is current flow the ouptut of the comparator swings high corresponding to me switching the relay in the trailer unit.
This was now fed the to pic in the CAB to decode the data.
The Serial data using RS232 did not work i was unable to understand way as i was seeing the correct data on the scope so i decided to just do it by sending a freq and counting those pulses back in the cab unit .
That work perfect using just the count command to check the data .
so turnin the Relay the relay in the trailer unit with the following
Code:
Begin:
Start_Convert
high portc.6
pauseUS 6666
low portc.6
pauseUS 6666
GOTO Start_Convert
And using the Count command in the Cab unit gave me 75Hz
COUNT PORTC.2, 1000, W1 ' Count for 1 second
others tested were
'FREQ MAP
' pauseUS 6666 = 75HZ
'pauseUS 5000 = 100HZ
' pauseUS 3333 = 150HZ
'pauseUS 2500 = 200HZ
'pauseUS 2000 = 250HZ
' pauseUS 1666 = 300HZ
' pauseUS 1428 = 350HZ
'pauseUS 1250 = 400HZ
' pauseUS 1110 =450HZ
'pauseUS 1000 = 500HZ
This is just a simple way to differentiate the telling which trailers were connected to the Cab.
Thanks everyone for all your help couldn't have done it with u
Isaac
Bookmarks