[time-nuts] help
Nick Sayer
nsayer at kfu.com
Mon May 2 11:24:43 EDT 2016
To flesh this out a bit more, on a Raspberry Pi, it would be easy to make a cron job that would pulse a GPIO pin high. They really *want* you to use Python (thus the name), but this is easy to do in just a shell script. First, do this to set things up:
#! /bin/sh
GPIO_PIN=9 # pick whatever one you like
echo $GPIO_PIN > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio${GPIO_PIN}/direction
echo 0 > /sys/class/gpio/gpio${GPIO_PIN}/value
Next, run this script out of cron:
#! /bin/sh
GPIO_PIN=9
echo 1 > /sys/class/gpio/gpio${GPIO_PIN}/value
sleep 1
echo 0 > /sys/class/gpio/gpio${GPIO_PIN}/value
That will make a positive going pulse with the leading edge synchronized to cron (for sufficiently vague definitions of “synchronized”).
As for the hardware side, take the GPIO pin and connect a 10k resistor between it and the base of a 2N4401 transistor. Connect the emitter to ground and the collector is a classic “open collector” switching output. Think of it like a switch connection to ground. When it’s on, there is a low impedance path to ground. When it’s off, it’s high impedance. You can use it to work a relay (be sure to add a flyback diode across the relay coil) or directly to switch any load that doesn’t exceed the abilities of the transistor.
If you want to be a little safer, you can use an opto-isolator instead. Connect the GPIO pin to a 150 Ω resistor and then to the anode of the LED in an optoisolator. Connect the cathode to ground. The optoisolator itself can be either a phototransistor type or a driver triac type (the latter would be used to drive a power triac to switch AC loads on and off).
> On May 1, 2016, at 6:30 PM, Chris Albertson <albertson.chris at gmail.com> wrote:
>
>> But are you sure you want SMPTE... Do you have a source already?
>>
>>
> You don't need GPS or SMPTE if you have an Internet connection. The
> computer can use a set of NTP servers from the "pool" to get time. The
> result is good enough that the seed of sound delay resulting from your
> random distance to the bell will be the largest source of error.
>
> If you convert timing errors to distance at the speed of sound. You would
> need the GPS only if you car about bell to ear distances of about one foot,
> give or take
>
> So for this use case the OP does not need a GPS or even a SMTPE connection
> just a WiFi link to the internet would be more than enough for controlling
> a horn blast from a light house
>
>
> --
>
> Chris Albertson
> Redondo Beach, California
> _______________________________________________
> time-nuts mailing list -- time-nuts at febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
More information about the time-nuts
mailing list