AG
Adrian Godwin
Mon, May 2, 2016 6:21 PM
They're a LED and some current limiting. Some are specced as low as 3V and
10mA but they're optimised for 12-24. I'd definitely use a transistor and
at least 5V, especially from something like a Pi or Teensy, which have 3v3
logic levels.
My reading is that Bill doesn't want to mess around with micros and
electronics, though. He wants an off-the-shelf timeswitch that - for
perfectly understandable reasons of engineering pedantry - is always
correct.
On Mon, May 2, 2016 at 5:56 PM, jimlux jimlux@earthlink.net wrote:
On 5/2/16 8:24 AM, Nick Sayer via time-nuts wrote:
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).
SSR data sheet at mouser (they are <$20)
http://www.mouser.com/ds/2/307/g3na_ds_e_11_1_csm165-892371.pdf
myriad varieties of inputs and outputs, whether it has an indicator (nice
for testing), whether it's a zero voltage switch.
BUT.. it kind of looks like it wants to see 4V to turn on for sure. Maybe
your 5V USB powered widget puts out that on a GPIO pin, maybe it doesn't.
I've had very mixed luck with driving SSRs directly from logic (because the
real threshold voltage and the real logic output voltage vary with
temperature, for instance).
I'd use the extra transistor as an open collector and a 12V wall wart or
similar to provide the current for the SSR input.
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to
https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
They're a LED and some current limiting. Some are specced as low as 3V and
10mA but they're optimised for 12-24. I'd definitely use a transistor and
at least 5V, especially from something like a Pi or Teensy, which have 3v3
logic levels.
My reading is that Bill doesn't want to mess around with micros and
electronics, though. He wants an off-the-shelf timeswitch that - for
perfectly understandable reasons of engineering pedantry - is always
correct.
On Mon, May 2, 2016 at 5:56 PM, jimlux <jimlux@earthlink.net> wrote:
> On 5/2/16 8:24 AM, Nick Sayer via time-nuts wrote:
>
>> 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).
>>
>>
>>
>
> SSR data sheet at mouser (they are <$20)
> http://www.mouser.com/ds/2/307/g3na_ds_e_11_1_csm165-892371.pdf
>
> myriad varieties of inputs and outputs, whether it has an indicator (nice
> for testing), whether it's a zero voltage switch.
>
> BUT.. it kind of looks like it wants to see 4V to turn on for sure. Maybe
> your 5V USB powered widget puts out that on a GPIO pin, maybe it doesn't.
> I've had very mixed luck with driving SSRs directly from logic (because the
> real threshold voltage and the real logic output voltage vary with
> temperature, for instance).
>
> I'd use the extra transistor as an open collector and a 12V wall wart or
> similar to provide the current for the SSR input.
>
>
>
>
> _______________________________________________
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to
> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
>
AG
Adrian Godwin
Mon, May 2, 2016 6:32 PM
Here's a possible solution. It's ethernet-connected and will switch a 10A
output. It's made for UK use but would probably be fine if you have a 220V
supply. It doesn't say whether it tracks NTP, but looking at the specs i'd
suggest it's linux inside and can do that.
http://www.audon.co.uk/webcontrol/EZ-21g.html
On Mon, May 2, 2016 at 7:21 PM, Adrian Godwin artgodwin@gmail.com wrote:
They're a LED and some current limiting. Some are specced as low as 3V and
10mA but they're optimised for 12-24. I'd definitely use a transistor and
at least 5V, especially from something like a Pi or Teensy, which have 3v3
logic levels.
My reading is that Bill doesn't want to mess around with micros and
electronics, though. He wants an off-the-shelf timeswitch that - for
perfectly understandable reasons of engineering pedantry - is always
correct.
On Mon, May 2, 2016 at 5:56 PM, jimlux jimlux@earthlink.net wrote:
On 5/2/16 8:24 AM, Nick Sayer via time-nuts wrote:
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).
SSR data sheet at mouser (they are <$20)
http://www.mouser.com/ds/2/307/g3na_ds_e_11_1_csm165-892371.pdf
myriad varieties of inputs and outputs, whether it has an indicator (nice
for testing), whether it's a zero voltage switch.
BUT.. it kind of looks like it wants to see 4V to turn on for sure. Maybe
your 5V USB powered widget puts out that on a GPIO pin, maybe it doesn't.
I've had very mixed luck with driving SSRs directly from logic (because the
real threshold voltage and the real logic output voltage vary with
temperature, for instance).
I'd use the extra transistor as an open collector and a 12V wall wart or
similar to provide the current for the SSR input.
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to
https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
Here's a possible solution. It's ethernet-connected and will switch a 10A
output. It's made for UK use but would probably be fine if you have a 220V
supply. It doesn't say whether it tracks NTP, but looking at the specs i'd
suggest it's linux inside and can do that.
http://www.audon.co.uk/webcontrol/EZ-21g.html
On Mon, May 2, 2016 at 7:21 PM, Adrian Godwin <artgodwin@gmail.com> wrote:
> They're a LED and some current limiting. Some are specced as low as 3V and
> 10mA but they're optimised for 12-24. I'd definitely use a transistor and
> at least 5V, especially from something like a Pi or Teensy, which have 3v3
> logic levels.
>
> My reading is that Bill doesn't want to mess around with micros and
> electronics, though. He wants an off-the-shelf timeswitch that - for
> perfectly understandable reasons of engineering pedantry - is always
> correct.
>
> On Mon, May 2, 2016 at 5:56 PM, jimlux <jimlux@earthlink.net> wrote:
>
>> On 5/2/16 8:24 AM, Nick Sayer via time-nuts wrote:
>>
>>> 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).
>>>
>>>
>>>
>>
>> SSR data sheet at mouser (they are <$20)
>> http://www.mouser.com/ds/2/307/g3na_ds_e_11_1_csm165-892371.pdf
>>
>> myriad varieties of inputs and outputs, whether it has an indicator (nice
>> for testing), whether it's a zero voltage switch.
>>
>> BUT.. it kind of looks like it wants to see 4V to turn on for sure. Maybe
>> your 5V USB powered widget puts out that on a GPIO pin, maybe it doesn't.
>> I've had very mixed luck with driving SSRs directly from logic (because the
>> real threshold voltage and the real logic output voltage vary with
>> temperature, for instance).
>>
>> I'd use the extra transistor as an open collector and a 12V wall wart or
>> similar to provide the current for the SSR input.
>>
>>
>>
>>
>> _______________________________________________
>> time-nuts mailing list -- time-nuts@febo.com
>> To unsubscribe, go to
>> https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
>> and follow the instructions there.
>>
>
>
NS
Nick Sayer
Mon, May 2, 2016 9:36 PM
On May 2, 2016, at 9:51 AM, jimlux jimlux@earthlink.net wrote:
The real question is whether "cron" is timely enough. No matter, just write a script (or python) that reads time in a loop (and you can put a sleep in there) and pulses the GPIO when needed.
A Raspberry Pi with nothing else on its plate will have a cron-to-shell script latency easily under 100 ms, possibly under 10.
If it were me and I were triggering a relay for some sort of external circuit, I’d probably be happy it was on the right side of 500 ms. If I cared more than that, then step 1 would be to do as others have suggested and come up with a microcontroller + GPS solution instead of NTP + cron. Ironically, that’d be around the same price (albeit more engineering work).
> On May 2, 2016, at 9:51 AM, jimlux <jimlux@earthlink.net> wrote:
>
>
> The real question is whether "cron" is timely enough. No matter, just write a script (or python) that reads time in a loop (and you can put a sleep in there) and pulses the GPIO when needed.
>
A Raspberry Pi with nothing else on its plate will have a cron-to-shell script latency easily under 100 ms, possibly under 10.
If it were me and I were triggering a relay for some sort of external circuit, I’d probably be happy it was on the right side of 500 ms. If I cared more than that, then step 1 would be to do as others have suggested and come up with a microcontroller + GPS solution instead of NTP + cron. Ironically, that’d be around the same price (albeit more engineering work).
AC
albertson.chris@gmail.com
Mon, May 2, 2016 11:00 PM
You don't care about the lag in cron. You care about the variation of the lag.
Then again. The main cause of lag in a fog horn is the speed of sound
You set cron to fire at T minus the average lag time.
On May 2, 2016, at 9:51 AM, jimlux jimlux@earthlink.net wrote:
The real question is whether "cron" is timely enough. No matter, just write a script (or python) that reads time in a loop (and you can put a sleep in there) and pulses the GPIO when needed.
A Raspberry Pi with nothing else on its plate will have a cron-to-shell script latency easily under 100 ms, possibly under 10.
If it were me and I were triggering a relay for some sort of external circuit, I’d probably be happy it was on the right side of 500 ms. If I cared more than that, then step 1 would be to do as others have suggested and come up with a microcontroller + GPS solution instead of NTP + cron. Ironically, that’d be around the same price (albeit more engineering work).
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
You don't care about the lag in cron. You care about the variation of the lag.
Then again. The main cause of lag in a fog horn is the speed of sound
You set cron to fire at T minus the average lag time.
> On May 2, 2016, at 2:36 PM, Nick Sayer via time-nuts <time-nuts@febo.com> wrote:
>
>
>> On May 2, 2016, at 9:51 AM, jimlux <jimlux@earthlink.net> wrote:
>>
>>
>> The real question is whether "cron" is timely enough. No matter, just write a script (or python) that reads time in a loop (and you can put a sleep in there) and pulses the GPIO when needed.
>
> A Raspberry Pi with nothing else on its plate will have a cron-to-shell script latency easily under 100 ms, possibly under 10.
>
> If it were me and I were triggering a relay for some sort of external circuit, I’d probably be happy it was on the right side of 500 ms. If I cared more than that, then step 1 would be to do as others have suggested and come up with a microcontroller + GPS solution instead of NTP + cron. Ironically, that’d be around the same price (albeit more engineering work).
> _______________________________________________
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.
BC
Bob Camp
Mon, May 2, 2016 11:38 PM
Hi
A cheap GPS module and any of the nearly infinite number of sub $20 “demo boards” would make
short work of looking at the pps, the time string out of the GPS and figuring out when it’s the top of the
hour. I doubt it’s over 200 lines of code. I’m sure somebody will pop up with an example well below
that. No need for an OS. No need for anything complex. There’s sure to be enough room even on a $2 board
to include added stuff like real time clock driver and correcting the “local time” against GPS.
Bob
On May 2, 2016, at 9:51 AM, jimlux jimlux@earthlink.net wrote:
The real question is whether "cron" is timely enough. No matter, just write a script (or python) that reads time in a loop (and you can put a sleep in there) and pulses the GPIO when needed.
A Raspberry Pi with nothing else on its plate will have a cron-to-shell script latency easily under 100 ms, possibly under 10.
If it were me and I were triggering a relay for some sort of external circuit, I’d probably be happy it was on the right side of 500 ms. If I cared more than that, then step 1 would be to do as others have suggested and come up with a microcontroller + GPS solution instead of NTP + cron. Ironically, that’d be around the same price (albeit more engineering work).
time-nuts mailing list -- time-nuts@febo.com
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.
Hi
A cheap GPS module and any of the nearly infinite number of sub $20 “demo boards” would make
short work of looking at the pps, the time string out of the GPS and figuring out when it’s the top of the
hour. I doubt it’s over 200 lines of code. I’m sure *somebody* will pop up with an example well below
that. No need for an OS. No need for anything complex. There’s sure to be enough room even on a $2 board
to include added stuff like real time clock driver and correcting the “local time” against GPS.
Bob
> On May 2, 2016, at 5:36 PM, Nick Sayer via time-nuts <time-nuts@febo.com> wrote:
>
>
>> On May 2, 2016, at 9:51 AM, jimlux <jimlux@earthlink.net> wrote:
>>
>>
>> The real question is whether "cron" is timely enough. No matter, just write a script (or python) that reads time in a loop (and you can put a sleep in there) and pulses the GPIO when needed.
>>
>
> A Raspberry Pi with nothing else on its plate will have a cron-to-shell script latency easily under 100 ms, possibly under 10.
>
> If it were me and I were triggering a relay for some sort of external circuit, I’d probably be happy it was on the right side of 500 ms. If I cared more than that, then step 1 would be to do as others have suggested and come up with a microcontroller + GPS solution instead of NTP + cron. Ironically, that’d be around the same price (albeit more engineering work).
> _______________________________________________
> time-nuts mailing list -- time-nuts@febo.com
> To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
> and follow the instructions there.