Thorian technical details

 

 

PC<> PIC communication

Communications between the PC and Thorian receiver are via a USB > TTL serial port, directly connected to the PIC eliminating any other components.

Data rate is 9600 baud, 8 bits, no parity, 1 stop bit standard serial data.
Commands from PC to PIC (and visa versa) are sent as 4 bytes. These are in the order:

 

Device address > Data1 > Data2 > Data3

 

 

PIC<> RF communication

Once the PIC receives the 4 bytes, it retransmits this over RF as 8 bytes.
Every 2nd byte is the inversion of the first.

 

Device address > Device address inverted > Data1 > Data1 inverted >
Data 2 > Data 2 inverted > Data 3 > Data 3 inverted >

 

The inverted bytes are used for checksum

 

Reserved addresses
Address 0

If the PC sends an address 0 then anything for data1,2,3 the USB interface will respond back to the PC with address 0, data1=1, data2=2, data3=3
This is used to verify comms is working both between the PC and PIC micro.
Currently the Thorian plugin for OSA does this every 2 minutes to verify comms. Failed comms will appear in the error log.

 

Address 255

If the USB PIC device receives an address of 255 from the PC, it will reroute the data in standard TTL 9600 to PIC pin 13 RB7 - ICSP pin 4. This is used to program a Thorian device with a new address.
Example.

To set a new address on the receiving device, say 201, send
Address 255
Data1 201
Data2 201
Data3 201
The receiving thorian device will verify that data1, 2 and 3 all match. If true, new address is programmed. Thorian device may need a reboot.

 

(Future features like 2 way comms will require a confirmation bit (address, A.C.K. ?).
Since the future rgb controller uses all of address, data1,2,3, an additional bit/byte is needed.
Alternatively addressing could be reduced to 127 devices.)


 

Bit timing:

The on time is the same for every bit.

The off time however varies. This determains whether the bit is 0 or 1

 

0 (space/off)

On for 337μS

Off for 243μS

1 (mark/on)

On for 337μS

Off for 813μS

 

The receieving PIC re-syncs after every bit to minimise on data timing errors when it receives over the air.

 

 

Temperature sensor information

Data Format:

The PIC sends data to the PC in the following format:

 

Address Data1 MSB Data2 not used
00000001 100 00 000 00000000  

 

Calculating the Temperature

 

1. Convert Data2:

Read the value in Data2 as a decimal number (its value ranges from 0 to 256).

 

2. Process the additional bits:

The three highlighted bits in Data1 MSB correspond to the following decimal values (from left to right):

First bit: 1024

Second bit: 512

Third bit: 256

For every one of these bits that is set to 1, add its corresponding value to the decimal value obtained from Data2.

 

3. Compute the temperature:

Divide the sum (the value of Data2 plus the added bits’ values) by 16.
The result of this division is the temperature in Celsius.

 

Additional flags

Battery low

This flag is activated when the battery voltage drops below 2.6 V.
Temperature is negative

When this flag is set, it indicates that the measured temperature is below zero.

 

Note:
Be aware that the Dallas temperature sensor may initially provide a false reading, which can result in an indicated temperature higher than the actual temperature.


 

Some details below if the 434 Mhz AM transmitter and receiver pair:

 

Transmitter Head Parameters

  • Launch (Transmission) Distance: 20–200 meters (Note: Distance varies with operating voltage)
  • Operating Voltage: 3.5–12V

  • Dimensions: 19 x 19 mm

  • Operating Mode: AM

  • Data Transfer Rate: 4 KB/s

  • Transmitting Power: 10 mW

  • Transmitting Frequency: 433.92 MHz

  • External Antenna: 25 cm cable (compatible with either multi-core or single-core wiring)

 

 

Receiver Module Parameters

  • Operating Voltage: DC 5V

  • Quiescent Current: 4 mA

  • Receiving Frequency: 433.92 MHz

  • Receiver Sensitivity: -105 dB

  • Dimensions: 30 x 13.5 mm

  • External Antenna: 32 cm single-core wire, wound into a spiral

 

 

 

 

 

 

← Back to Projects