Turning pc on with 12 led trigger

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
Hi all,
I’m looking for a little help creating a switch for my pc mining rig, using an led from a solar battery charger,
The solar battery charger has an led that comes on once the sun is up and is charging, I want to use that led as a trigger for my mining rig to come on and only mine when the sun is up,
I was thinking of a relay that uses the 12v from the chargers led for the input, to trigger the pc’s on/off button, the only thing is, I need it to just click on for a millisecond to start the mining rig, then use the other led (that states no solar charging) to click on (again for a millisecond) for shut down, the relays ive seen stay on or off,
Any help would be great,
Thanks,
Phil.
 
Last edited:

visionofast

Joined Oct 17, 2018
106
so,you need a light activated switch circuit like this using a photoresistor or LDR with a DC realy.
You also have to stick the photoresistor/LDR to LED of charger enough to make sure it's the only light source that triggers your switch and makes your relay on.
 

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
Thanks very much VISIONOFAST that would be spot on but I’ve just noticed the led on the charger flashes when charging, another led stays on when there’s no charge,
Funny you should mention ldr’s, I’ve just been looking at YouTube videos on them, I think as I’m looking for it to work when the sun comes up, I may as well have an ldr on the outside so when the sun comes up, it turns it on?
Is there a relay that can flick on for a millisecond to activate the pc, then flick the relay again when the ldr goes off?
 
Last edited:

Wolframore

Joined Jan 21, 2019
2,619
Sounds like you need a controller of some sort... pulse on on positive edge and pulse again on negative edge. Could be a good Arduino project might be the easiest.
 

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
That is spot on, I definitely do,
I have a few arduino’s but I really want to see if it can be done by relays and a few other components, if there was such a relay?
 
Last edited:

Wolframore

Joined Jan 21, 2019
2,619
Just control the relay with the Arduino. Digitalwrite high. Wait for your delay the write low. It can be done without a microcontroller but it gets complex and many more components than just a microcontroller.
 

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
It’s gone slightly over my head lol,
I’ve not used the arduino for around 2 years,
I’ll look on eBay for arduino add ons, see what I find,
Thanks for the input WOLFRAMORE
 

Wolframore

Joined Jan 21, 2019
2,619
Just get a 5v relay module. It has everything you need to connect to an Arduino (transistor to drive it with a fly back diode to protect the input pin). They’re inexpensive and can be found all over.
 

Reloadron

Joined Jan 15, 2015
7,887
Since the charger has an On and Off LED I would take the uC (Micro Controller) route. The uC is your choice but you really only need a tiny uC like a PICAXE 08M2, or go ahead and use an Arduiono. Each method has merits. Either choice only requires a few lines of code which is really basic (not complicated) to write. The start button on most PCs is merely placing ground on the PS-ON line through the motherboard. Just make sure that 1 mSec is adequate for what you want to do. Also, consider that your Off may cause a Hard Shutdown, is that OK? As mentioned, you need to well define what you have and what you want.

Ron
 

Wolframore

Joined Jan 21, 2019
2,619
You can use an attiny 8 pin but it’s more complicated PIC would work just fine. You can get an Arduino nano for a few bucks. Don’t get the mini. Although it’s smaller it doesn’t have the usb connection so requires more steps and parts. Also get the 5v version. Doesn’t matter if it’s the 328 or the 168 for your use. If you’re more comfortable with a bigger device the UNO is fine.
 
Last edited:

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
Thanks guys, that’s a lot for me to digest and investigate, I have 3 uno’s so I’ll use one of them,
I’ll have a look at all the suggestions and let you know what I decided,
Thanks very much again for all the help,
Cheers guys.
 

Wolframore

Joined Jan 21, 2019
2,619
Yep use what you got. Reload Ron is right it won’t take much to do and it’s overkill but it’ll work and Arduino are so inexpensive. Plus it’s in a ready to go package.
 

MrChips

Joined Oct 2, 2009
34,807
I was going to add to the microcontroller solution.

Since you want to mine during daylight, you do not need to connect to the solar charger.
Connect an LDR to your MCU and detect daylight directly. Use the MCU computing power to vet your sunup input along with time-of-day information and any other criteria you wish to include.
 

Ya’akov

Joined Jan 27, 2019
10,235
I was going to add to the microcontroller solution.

Since you want to mine during daylight, you do not need to connect to the solar charger.
Connect an LDR to your MCU and detect daylight directly. Use the MCU computing power to vet your sunup input along with time-of-day information and any other criteria you wish to include.
I don't really understand exactly why the TS wants to start the computer at daylight, but I surmise it is to ensure the solar cells are producing current. If that is the case, it would seem more appropriate to use a hall effect current sensor to detect actual output from the solar cell itself.

I don't know how or if the TS plans on turning off the computer, or if a drop in output should shut the computer down.

It would be most helpful to know more about the reason for this, and the charge controllers itself.
 

Wolframore

Joined Jan 21, 2019
2,619
I thought there was a decision to detect sunlight using an LDR or photodiode. So detect high then detect low. Set on and off threshold. Check every 5 min or so to conserve power.
 

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
WOLFRAMORE is right on the money, I only want the miner to come on during the day using solar energy, as bit mining prices have come right down, so in effect mining for free,
I’ll eventually use the arduino uno with the ldr.
 

Thread Starter

Bigfillly

Joined Jan 4, 2019
73
Ok, so i think I’m getting there, if I use the uno with an ldr, can I use one of the pin outs to power a relay for half a second once the ldr sensors a level of light?
then once the level of light goes below the setting, send another half a second of power to the relay to turn the pc off?
I realise the pc will do a hard shut down but I can’t see how else it can be done.
 
Top