Plane Spotting: ADS-B Plane Director Script

Print Friendly

Phew! Been a while since I have posted something on my blog. Well, that does not mean that I have been too busy or idling around. Just that my work-life balance was heavily tilted towards the work side. Excuses aside, for a past few years I have been dabbling with the ADS-B setup that I have with me.

While the setup has worked beyond my wildest expectations, what I wanted next was design some aid to help guide me towards the direction of the plane. So the next thing I did was was to code a small script to do the same. What does it do? Outputs the slant range, bearing and elevation angle of the plane track dumped by my ADS-B receiver. The code has been written in C.

The next step: Maybe integrate it with gpsd daemon  and a pan-tilt camera mount.

Source Code: polarplot.c
To Compile use : gcc -o polarplot polarplot.c -lm

 

Posted in Default, DIY, GNU C, Programming, Projects | Tagged , , , | Leave a comment

Simple Script to Download epaper from Deccan Chronicle

Print Friendly

Wanted to download epapers in pdf from Deccan Chronicle.. Look no further… Click to download the script Deccan_Chronicle_New_Jul13

How to get it running

Copy the script to your Linux desktop
go to command prompt using terminal
type following commands

cd ~/Desktop
chmod +x Deccan_Chronicle_New_Jul13.sh
./Deccan_Chronicle_New_Jul13.sh

Posted in BASH, Programming | Tagged , , , , , , , | 1 Comment

Fun with IR Transmitter: Transmitting Sony SIRC protocol remote commands using TI Launchpad MSP-EXP430G2

Print Friendly

Simple code to transmit SONY remote control commands using Launchpad. The code can used to make your own IR Blaster. The code is not elegant but is certainly functional. This code would not have been possible without the lucid explanation about SONY SIRC protocol available at SB Projects informative web site.

Source Code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/* ----------------------------------------------------------------------
* Encode Data to Sony SIRC remote protocol using MSP430 Microcontroller
* Coded by Ishan Karve (ishan at the rate gmail dot com)
* 26 Jan 2013
* Platform : TI MSP-EXP430G2 Launchpad running MSP430G2231
* Software Suite : Code Compose Studio, Version: 4.2.3.00004
* Note:
*
* IR Led is connected at port 1.0
* GND--<Res>---|<|--------P1.0
* Diode
* ----------------------------------------------------------------------
*/

#include "msp430g2452.h"
#define LED_OFF LED_OUT &= ~LED_0
#define LED_ON LED_OUT |= LED_0
#define LED_OUT P1OUT
#define LED_0 BIT0
#define LED_DIR P1DIR

void tx_wait(void);
void tx_start(void);
void tx_bit(short);
void tx_cmd(int);
void tx_adr(int);
void delay_ms(unsigned int ms)
{
while (--ms)
{
__delay_cycles(1000);
}
}

void main()
{
//stop watchdog
WDTCTL = WDTPW + WDTHOLD;

//setup internal DCO
BCSCTL1 = CALBC1_1MHZ;
DCOCTL = CALDCO_1MHZ;
//General GPIO Defines
LED_DIR |= LED_0; // Set P1.0 to output direction
LED_OUT &= ~LED_0; // Set the LEDs off

while(1)
{

tx_start();
tx_cmd(21);
tx_adr(1);
tx_wait();

}
}
void tx_wait()
{

//delay_ms(45);//
delay_ms(500);
}
void tx_cmd(int n)
{

int i=0;
int k=0;
for (i = 6; i >= 0; i--)
{
k=n%2;
n/=2;
tx_bit(k);
}

}
void tx_adr(int n)
{

int i=0;
int k=0;
for (i = 4; i >= 0; i--)
{
k=n%2;
n/=2;
tx_bit(k);
}

}

void tx_start()
{
int i;
for (i=0;i<96;i++)
{
//40 Khz Carrier generation. 25us pulse time
//9us On and 16us off
//96 pulses in one start bit time
LED_ON;
__delay_cycles(4);
LED_OFF;
__delay_cycles(8);
}
__delay_cycles(320); //600us delay
}
void tx_bit(short bitval) ///just makes a 1 to 0 and vice versa
{
int i=0;
switch (bitval)
{
case 0:
for (i=0;i<24;i++)
{
//40 Khz Carrier generation. 25us pulse time
//9us On and 16us off
LED_ON;
__delay_cycles(4);
LED_OFF;
__delay_cycles(8);
}
__delay_cycles(320); //600us delay
break;
case 1:
for (i=0;i<48;i++)
{
//40 Khz Carrier generation. 25us pulse time
//9us On and 16us off
LED_ON;
__delay_cycles(4);
LED_OFF;
__delay_cycles(8);
}
__delay_cycles(320); //600us delay
break;
}

}

Download Project Source

Posted in DIY, MSP430, Projects | Tagged , , , , , , , , , , | Leave a comment

Jupiter with its four moons

Print Friendly

image

Posted in Astronomy | Tagged , , , , , , , , , | Leave a comment

Linux bash script client for 24Online

Print Friendly

This script emulates HTTP client login for 24Online broadband billing gateway. You can download the script here scriptRoam.
The script uses curl and hence curl is required to be installed on your linux box.  I have not tested the script on cygwin.

Prior using the script you need to change some parameters inside the script like the gateway address and username / password. Post that and assuming that u have ‘curl’ installed rename the script extension to .sh (dot sh) and chmod +x it to make it executabe.

 

 

Posted in BASH, DIY | Tagged , , , , , , , , , , | 1 Comment