Jump to content

Bit anxious to ask as I recently registered to the forum. I honestly don't know why I didn't do it sooner as I've been watching LTT for several years. Anyhow;

 

In interest doing DIY IoT projects I stumble on the fact that my "electrical enginering" is.. well.. laughable.

I know a few basics. Confident with low and high currents. And like to "live on the edge" so to speak. Though my question, of which I think is very basic and easy, I just can't give it a proper answer or use a good Google Search term to get with a satisfaction-able result.

 

What I need are 2 things:

- A toggle switch, controlled preferably 3.3 or 5v (As I'm planning to control it with either a Raspberry Pi or an Arduino), that "remembers" it's position even when power is not present. Just like a mechanical Toggle switch, but then controlled by a digital or analog signal.

- A way to detect if a certain line is "live". As in, currently is a closed circuit. For example, when I switch a light bulb on by a mechanical switch, I like to be able to report to either my Raspberry Pi or Arduino that the circuit is on.

 

Both of these are probably fairly easy, but I just can't think of a solution. I've got in no way any education around these subjects and just wing it. So far I've made a temperature controlled Peltier cooled loop. (Just for laughs) and a "Smart" thermostat that is controllable with any browser-capable device, that is temperature sensitive.

 

I don't need "clean" solution. Just something that is "easy", works and isn't a direct fire hazard. (As I do enjoy my life quite a bit.)

 

Anyways thanks in advance for the help.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to comment
https://linustechtips.com/topic/744397-toggle-switching-and-live-feedback/
Share on other sites

Link to post
Share on other sites

1 hour ago, Aelita Sophie said:

-SNIP-

That would simply just need to be a latching relay:

http://www.ebay.com/itm/1-Channel-5V-Latching-Relay-Module-with-Touch-Bistable-Switch-/191100353978

Link to post
Share on other sites

1 minute ago, W-L said:

Oh you are a LIFE SAVER. I knew there was something like that, but just couldn't find it with the proper names. Though little question (I did a fast scan-read), does it save the state even if the board doesn't receive any power at all? This is in case I would restart the system behind it etc.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

1 minute ago, Aelita Sophie said:

Oh you are a LIFE SAVER. I knew there was something like that, but just couldn't find it with the proper names. Though little question (I did a fast scan-read), does it save the state even if the board doesn't receive any power at all? This is in case I would restart the system behind it etc.

Yes that is how a latching switch works once it receives a signal it will latch and keep it closed or open until further notice, it's done via either the push button on the board or 2 pin connection if you want it controlled by the ardunio or raspberry pie. 

Link to post
Share on other sites

1 hour ago, Aelita Sophie said:

- A toggle switch, controlled preferably 3.3 or 5v (As I'm planning to control it with either a Raspberry Pi or an Arduino), that "remembers" it's position even when power is not present. Just like a mechanical Toggle switch, but then controlled by a digital or analog signal.

If it truly needs to hold the state when the power is off, you can use a latching relay, flash memory chip, or even an EEPROM. Most likely for your purposes using a latching relay as @W-L mentioned is the best bet, as I assume that you only need to store 1 or 2 bits. BTW, it will store the bit even when supply power is fully removed.
 

1 hour ago, Aelita Sophie said:

- A way to detect if a certain line is "live". As in, currently is a closed circuit. For example, when I switch a light bulb on by a mechanical switch, I like to be able to report to either my Raspberry Pi or Arduino that the circuit is on.

You would just connect the output of the switch to one of the digital i/o pins on an arduino (or any GPIO on a Rpi) and then ask the pin if it is high or low.

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

Just now, W-L said:

Yes that is how a latching switch works once it receives a signal it will latch and keep it closed or open until further notice, it's done via either the push button on the board or 2 pin connection if you want it controlled by the ardunio or raspberry pie. 

Awesome, going to order a few of them.

Do you also have any idea's to check if a circuit is closed? Like a reversed switch, in lack of better words.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

1 minute ago, straight_stewie said:

You would just connect the output of the switch to one of the digital i/o pins on an arduino (or any GPIO on a Rpi) and then ask the pin if it is high or low.

Nah, I need to check if for example the light bulb is on seperately. As I'm planning on to add a IoT switch adjunct to the existing light switches.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

1 minute ago, Aelita Sophie said:

Awesome, going to order a few of them.

Do you also have any idea's to check if a circuit is closed? Like a reversed switch, in lack of better words.

Most of those units have a LED on the board to give an indication but if you needed it as a data connection you can program it so the ardunio is matched to the relay's position. 

Link to post
Share on other sites

Just now, W-L said:

Most of those units have a LED on the board to give an indication but if you needed it as a data connection you can program it so the ardunio is matched to the relay's position. 

As stated in my previous post towards straight_stewie, I need the check regardless of the relay switch. As I will add the relay switch adjunct with 2 other mechanical switches. 

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

3 minutes ago, Aelita Sophie said:

As stated in my previous post towards straight_stewie, I need the check regardless of the relay switch. As I will add the relay switch adjunct with 2 other mechanical switches. 

What are you trying to setup exactly? 

Link to post
Share on other sites

7 minutes ago, W-L said:

What are you trying to setup exactly? 

Trying to sketch a picture, I hope this clarifies.

 

schema.png

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

6 minutes ago, Aelita Sophie said:

Trying to sketch a picture, I hope this clarifies.

What is it suppose to achieve is probably what I should say, it's a single mechanical switch (mech2) with a polarity switch as mech 1? 

Link to post
Share on other sites

Just now, W-L said:

What is it suppose to achieve is probably what I should say, it's a single mechanical switch (mech2) with a polarity switch as mech 1? 

I want to, in basic case, control the light with an Pi or a Arduino. Switching it on or off. While also be able to use the existing wallmounted switches. Since from the Arduino/Pi I can only read the state of the Latching Relay switch, it wont tell me if the light is actually on or off due the fact that other 2 switches can change the state of the light as well. Like in most rooms with the main light. At for example the door you;ve got a switch to turn it on/off, and at your bed youve got another to also turn it on/off. 

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

11 minutes ago, Aelita Sophie said:

I want to, in basic case, control the light with an Pi or a Arduino. Switching it on or off. While also be able to use the existing wallmounted switches. Since from the Arduino/Pi I can only read the state of the Latching Relay switch, it wont tell me if the light is actually on or off due the fact that other 2 switches can change the state of the light as well. Like in most rooms with the main light. At for example the door you;ve got a switch to turn it on/off, and at your bed youve got another to also turn it on/off. 

Oh ok so this would be AC power then, and yeah that would be the same as a 4 way switch diagram. In terms of check to see if the light is on, other than having a sensor at the light bulb itself an induction current sensor may work to see when there is a load being applied through the circuit.

https://www.sparkfun.com/products/11005

 

http://users.wfu.edu/matthews/misc/switches/4WayAnimation.html

4 way switch animation

Link to post
Share on other sites

6 minutes ago, W-L said:

--SNIP--

Does this work for very low loads as well? Because all the lights here are LED, and will not use more then 3 Watt.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

16 minutes ago, Aelita Sophie said:

Does this work for very low loads as well? Because all the lights here are LED, and will not use more then 3 Watt.

I'm not too sure how sensitive those are but iirc you can increase that by having more coils through the inductor to look like it's a larger load, don't quote me on it though. 

http://www.panucatt.com/product_p/cs-45al.htm

http://files.panucatt.com/datasheets/cs45al_datasheet.pdf

Link to post
Share on other sites

Just now, W-L said:

I'm not too sure how sensitive those are but iirc you can increase that by having more coils through the inductor to look like it's a larger load. 

Keeping this one in mind, are there any other options as well?

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

3 minutes ago, Aelita Sophie said:

Keeping this one in mind, are there any other options as well?

Other than having a sensor near the light not many others I can think of that could do the same as a current sense.

Link to post
Share on other sites

3 hours ago, Aelita Sophie said:

I want to, in basic case, control the light with an Pi or a Arduino. Switching it on or off. While also be able to use the existing wallmounted switches. Since from the Arduino/Pi I can only read the state of the Latching Relay switch, it wont tell me if the light is actually on or off due the fact that other 2 switches can change the state of the light as well. Like in most rooms with the main light. At for example the door you;ve got a switch to turn it on/off, and at your bed youve got another to also turn it on/off. 

We just need to sample the AC output from your switching circuit and determine if there is wall voltage there or not. This chip: PBK-1-5 takes 120 volts (American wall voltage) and converts it to 5 volts DC. If the output of the PBK chip is 5 volts, the light is on, otherwise the light is off. This avoids the problem of potential false positives when using a photovoltaic sensor to check if the light is on or off.
 

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

8 hours ago, straight_stewie said:

We just need to sample the AC output from your switching circuit and determine if there is wall voltage there or not. This chip: PBK-1-5 takes 120 volts (American wall voltage) and converts it to 5 volts DC. If the output of the PBK chip is 5 volts, the light is on, otherwise the light is off. This avoids the problem of potential false positives when using a photovoltaic sensor to check if the light is on or off.
 

That does seem like the most elegant solution. While the inductor sensor seems cool, I'm afraid for non-accurate measurements. As I don't care about the usage of my light, but just about it's state. I feel like the inductor sensor might not indicate "usage" with just a 3 Wat load. The PBK-1-5 seems also to be well within specs with the EU wall voltage. (210-230v). I'm a little bit worried about heat. But the specification does state only 0.2A on 5V. So that is 1 Watt. If I'm correct that should result in not to much heat dissipation?

 

While going there, could you maybe give an example for wiring the 5v output to a Pi or Arduino? I'm not sure if I can just straight up hook up the positive side to a GPIO pin and ground obviously on a GND.

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

2 hours ago, Aelita Sophie said:

While going there, could you maybe give an example for wiring the 5v output to a Pi or Arduino? I'm not sure if I can just straight up hook up the positive side to a GPIO pin and ground obviously on a GND.

While in class today (microprocessors II coincidentally) I was thinking about how I would do this problem if it was for me, and I came up with a better way to solve the problem. We can view this as a Finite State Machine. The circuit that we make will be a little more complex, but it will have mainly two benefits that stem from the same result: The output of our finite state machine will be a single 5 volt signal. We can connect this signal to a relay, and also connect it to a GPIO input. This gives us the benefits: The ability to easily tell whether the light is on or off, and that the light will only have 1 route to get power (this makes diagnosis of problems easier, and it makes the circuit safer). 

I have a couple more classes today, but I'll have some circuits drawn up and posted tonight.

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

32 minutes ago, straight_stewie said:

While in class today (microprocessors II coincidentally) I was thinking about how I would do this problem if it was for me, and I came up with a better way to solve the problem. We can view this as a Finite State Machine. The circuit that we make will be a little more complex, but it will have mainly two benefits that stem from the same result: The output of our finite state machine will be a single 5 volt signal. We can connect this signal to a relay, and also connect it to a GPIO input. This gives us the benefits: The ability to easily tell whether the light is on or off, and that the light will only have 1 route to get power (this makes diagnosis of problems easier, and it makes the circuit safer). 

I have a couple more classes today, but I'll have some circuits drawn up and posted tonight.

I need the courses you are learning. Sadly my school period is over. I'm 23 nearly 24 years old and a retired student. But you are the best! Thank you for thinking with me!

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

5 hours ago, Aelita Sophie said:

But you are the best! Thank you for thinking with me!

It's absolutely my pleasure. I like applying my knowledge, even though I'm still learning.

So I have the physical circuit complete. It's relatively simple, and the circuit should cost around $30. There are some things you should know about the circuit ahead of time:

  • This circuit does not include a bypass mode. Currently the only way that the light can turn on is if the Arduino (or RPi) turns on the latching relay. This feature can easily be added with only the inclusion of another mechanical switch.
  • The "State machine" that will control the light exists purely in software, which I have not completed yet. I have psuedo code for the entire algorithm. I'm going to prettify the psuedo-code and then post it here, but I'm not going to write the entire code for your microprocessor, as I'm not sure what else you will be doing that will be affecting it (such as wireless control), or whether you will be using an RPi or Arduino
  • This circuit may not be up to your local, regional, or national electrical codes, but I have a sneaking suspicion that you don't particularly care. That does not mean that this is not a safe circuit, just that it may fail an inspection.

So here's the circuit (sorry for the bad handwriting):
17036600_10208368532436960_1712973854_o.jpg


Here's the parts:

 

WARNING:: I just thought about something: I'm making an assumption about the recom power module. If it is wrong the sensing circuit may not work properly. However, it is possible to avoid the problem completely by using a relay or some other similar device. I'll post back in a while with it. I have some more classes.

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

5 minutes ago, straight_stewie said:

-SNIP-

Oh wow, that is quite the schematic. So this will only work with 1 existing light switch + the latching relay I intend to use?

For the rest, especially with your explanation underneath it is follow able for me. I should be able to produce this with a soldering iron and parts. The fuse is out of spec as far I can tell. I don't have any knowledge regarding the electric codes here, but our mains is typically rated at 210-230 at 16A. 25A sounds like it will break only if the mains circuit breaker would fail. Which for the wiring would be a hazard. Not entirely sure about the gauge of the wire, but It's probably rated for less than 25A. So I would rather use a 16A or less. Also does this breaker/fuse do selfrepair? As in, turn the circuit off and on again would make it work again? (Like most powersupplies do in PC's if it would happen to make a short circuit somewhere)

Main RIG: i7 4770k ~ 4.8Ghz | Intel HD Onboard (enough for my LoL gaming) | Samsung 960 Pro 256GB NVMe | 32GB (4x 8GB) Kingston Savage 2133Mhz DDR3 | MSI Z97 Gaming 7 | ThermalTake FrioOCK | MS-Tech (puke) 700W | Windows 10 64Bit

Mining RIG: AMD A6-9500 | ASRock AB350 Pro | 4GB DDR4 | 500GB 2.5 Inch HDD | 2x MSI AERO GTX 1060 6GB (Core/Memory/TDP/Avg Temp +160/+800/120%/45c) | 1x Asus Strix GTX 970 (+195/+400/125%/55c) | 1x KFA2 GTX 960 (+220/+500/120%/70c) | Corsair GS800 800W | HP HSTNS-PD05 1000W | (Modded) Inter-Tech IPC 4U-4129-N Rackmount Case

Guest RIG: FX6300 | AMD HD7870 | Kingston HyperX 128GB SSD | 16GB (2x 8GB) G.Skill Ripjaws 1600Mhz DDR3 | Some ASRock 970 Mobo | Stock Heatsink | some left over PSU  | Windows 10 64Bit

VM Server: HP Proliant DL160 G6 | 2x Intel Xeon E5620 @ 2.4Ghz 4c/8t (8c/16t total) | 16GB (8x 2GB) HP 1066Mhz ECC DDR3 | 2x Western Digital Black 250GB HDD | VMWare ESXI

Storage Node: 2x Intel Xeon E5520 @ 2.27Ghz 4c/8t (8c/16t total) | Intel ServerBoard S5500HCV | 36GB (9x 4GB) 1333Mhz ECC DDR3 | 3x Seagate 2TB 7200RPM | 4x Western Digital Caviar Green 2TB

Link to post
Share on other sites

4 hours ago, Aelita Sophie said:

So this will only work with 1 existing light switch + the latching relay I intend to use?

Correct. You can drive more than 1 light with a single microcontroller, but you will need 1 relay and one sensing circuit per individual light switch. (You can power more than 1 light at a time so long as they are all on the same light switch). 
 

4 hours ago, Aelita Sophie said:

The fuse is out of spec as far I can tell. I don't have any knowledge regarding the electric codes here, but our mains is typically rated at 210-230 at 16A. 25A sounds like it will break only if the mains circuit breaker would fail. Which for the wiring would be a hazard. Not entirely sure about the gauge of the wire, but It's probably rated for less than 25A. So I would rather use a 16A or less. Also does this breaker/fuse do selfrepair?

The fuses rating is 1 amp. This is what's specified as needed by the 230v-5v manufacturer. What you saw was the "breakage rating" which is the rating at which the fuse is no longer able to prevent current flow, even if it is broken. This means that anywhere from 0 to 24 amps is safe for the fuse, but the fuse will break if the input exceeds 1 amp and arcing will occur between the leads if input exceeds 25 amps.

On the sensing circuit, my recommendation would be to add another relay to the output side of the sensing circuit. This one should not be a latching relay. You can do the same thing with a MOSFET if you need it to fit in a smaller space, but that's a more complicated circuit.

ENCRYPTION IS NOT A CRIME

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×