Resend my activation email : Register : Log in 
BCF: Bike Chat Forums


Eletronics/Pi Questions

Reply to topic
Bike Chat Forums Index -> The Geek Zone
View previous topic : View next topic  
Author Message

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 13:48 - 11 Apr 2018    Post subject: Eletronics/Pi Questions Reply with quote

I'm making a RPi project, I have a power switch I need to use, I also want a LED to light up when the power is on.

I have little experience so just wanted to check before I start hacking things apart. It's going in a case so I have a Micro USB extender I'm going to fix a slot in the case to run power into the pi.

My plan to use the switch is to intercept the power wire in the cable and run it through the switch. I then plan to tap into the power and ground after the switch to power the LED.

Any reason that won't work?
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Paddy.
Red Rocket



Joined: 14 Feb 2008
Karma :

PostPosted: 13:53 - 11 Apr 2018    Post subject: Reply with quote

I'm probably just a spastic, by any reason you can't use the -ve wire?

I remember my old Clio had a big switch to manually turn on the fan cos sensor was fucked, it burnt through about 4 switches before I put it on the -ve side rather than +ve.

However... you could also use a switch with an LED on it to save the faff?

Following however, as my Pi and Win10 device are in the garage and control CCTV and I still find myself walking out to check they are on...
____________________
Current ride : Suzuki GSXR1000 L0 - Suzuki SV650 track bike - Yamaha Majesty YP250
My biking history so far
Rogerborg wrote: Whole life care for a VTR full of quadraspazzed Darrryls and Shoniq'uas cost mad dollah.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 14:03 - 11 Apr 2018    Post subject: Reply with quote

Paddy. wrote:
I'm probably just a spastic, by any reason you can't use the -ve wire?

I remember my old Clio had a big switch to manually turn on the fan cos sensor was fucked, it burnt through about 4 switches before I put it on the -ve side rather than +ve.

However... you could also use a switch with an LED on it to save the faff?

Following however, as my Pi and Win10 device are in the garage and control CCTV and I still find myself walking out to check they are on...


The Switch is part of the case, so I can't change it. I am using the neg wire?
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Pjay
World Chat Champion



Joined: 18 Jan 2016
Karma :

PostPosted: 14:46 - 11 Apr 2018    Post subject: Reply with quote

Can you do a wiring diagram so I can understand what you are doing?
____________________
struan80 - I'll go first - satisfied tick 1
 Back to top
View user's profile Send private message You must be logged in to rate posts

RhynoCZ
Super Spammer



Joined: 09 Mar 2012
Karma :

PostPosted: 14:54 - 11 Apr 2018    Post subject: Reply with quote

1) LED = use the GPIO: ground + 5V/3.3V (I don't remember the pins, google it) There are at least 2 maybe 3 ''rails'' on the Pi, that stay powered ON when the Pi is booted up. It's mostly used for fans, but you may stick a LED on it too.
2) Switch = turning the Pi ON is alright, turning off requires a script. If you don't use a script to turn the Pi off, you may corrupt the data on the SD card. Oh, and yet again, use the GPIO, don't break the power lead to the USB.
____________________
'96 Kawasaki ZX7R P1 (sold) - '90 Honda CB-1 (sold) - '88 Kawasaki GPz550 (sold)
'95 Mercedes-Benz w202 C200 CGI; At my disposal: MZ 150 ETZ
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 15:23 - 11 Apr 2018    Post subject: Reply with quote

Pjay wrote:
Can you do a wiring diagram so I can understand what you are doing?


There is one attached to the first post.
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 15:27 - 11 Apr 2018    Post subject: Reply with quote

RhynoCZ wrote:
1) LED = use the GPIO: ground + 5V/3.3V (I don't remember the pins, google it) There are at least 2 maybe 3 ''rails'' on the Pi, that stay powered ON when the Pi is booted up. It's mostly used for fans, but you may stick a LED on it too.
2) Switch = turning the Pi ON is alright, turning off requires a script. If you don't use a script to turn the Pi off, you may corrupt the data on the SD card. Oh, and yet again, use the GPIO, don't break the power lead to the USB.


I've had it running as a KODI box for years, that has only been shut down by yanking the power. I've never had a problem. I've been playing with my build and must have yanked the power 30+ times in the last couple of days, no problem.

I don't want to run the LED from the GPIO logistically it doesn't make sense.
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

RhynoCZ
Super Spammer



Joined: 09 Mar 2012
Karma :

PostPosted: 15:30 - 11 Apr 2018    Post subject: Reply with quote

I said it may corrupt the data.
____________________
'96 Kawasaki ZX7R P1 (sold) - '90 Honda CB-1 (sold) - '88 Kawasaki GPz550 (sold)
'95 Mercedes-Benz w202 C200 CGI; At my disposal: MZ 150 ETZ
 Back to top
View user's profile Send private message You must be logged in to rate posts

Pjay
World Chat Champion



Joined: 18 Jan 2016
Karma :

PostPosted: 15:31 - 11 Apr 2018    Post subject: Reply with quote

chris-red wrote:
Pjay wrote:
Can you do a wiring diagram so I can understand what you are doing?


There is one attached to the first post.


Ah yeah dead simple.
Just follow this guide https://pie.8bitjunkie.net/retropie-shutdown-and-startup-switch-the-easy-way

It's important to have it shutdown correctly as per RhynoCZ's advice.

You can just put 5V + LED to the +V and GND GPIO pins as suggested.
____________________
struan80 - I'll go first - satisfied tick 1
 Back to top
View user's profile Send private message You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 15:56 - 11 Apr 2018    Post subject: Reply with quote

No good it needs a momentary switch, the case switch isn't.

I'm not bothered about 'maybe' corrupting the data, it hasn't happened in all the years I've been using Kodi, it literally turned on and off every time my TV does. Once I finalize my build I'll make a backup, if it goes tits up I'll be back up and running in ~15 mins.
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Pjay
World Chat Champion



Joined: 18 Jan 2016
Karma :

PostPosted: 16:44 - 11 Apr 2018    Post subject: Reply with quote

chris-red wrote:
No good it needs a momentary switch, the case switch isn't.

I'm not bothered about 'maybe' corrupting the data, it hasn't happened in all the years I've been using Kodi, it literally turned on and off every time my TV does. Once I finalize my build I'll make a backup, if it goes tits up I'll be back up and running in ~15 mins.


Then just connect yours to the GPIO, job jobbed.
____________________
struan80 - I'll go first - satisfied tick 1
 Back to top
View user's profile Send private message You must be logged in to rate posts

benvanwell
Nitrous Nuisance



Joined: 10 Apr 2007
Karma :

PostPosted: 22:10 - 11 Apr 2018    Post subject: Reply with quote

The only issue I see is that the LED will need something to limit the current flowing through it. If it's a standard 2-legged 'bare' LED then simply putting a resistor in series should do it.

Just look at the voltage drop (across the resistor) and the current through it to work out what resistance you need.

As an example, if you have a 5V supply, and a 2V LED requiring 25mA then you'd need to drop 3V across the resistor so you'd need a 120Ohm resistor (3V/25mA).

Some packaged LED's have this resistor built in - in which case your proposal will be fine.
____________________
Currently Riding: Triumph Sprint ST 1050
Previous: GSF600s, GS500, BMW F45, CG125
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

chris-red
Have you considered a TDM?



Joined: 21 Sep 2005
Karma :

PostPosted: 21:41 - 14 Apr 2018    Post subject: Reply with quote

It works Cool

PiStation. Original Controller ports work as does the power switch and the led lights up when it comes on.

It's overclocked and runs well It's not gone higher than 55c that's with the lid shut.

http://scontent-lht6-1.xx.fbcdn.net/v/t31.0-8/29983043_10156195279523476_15200640296681690_o.jpg?_nc_cat=0&oh=f63624beda44090226a32161b0974732&oe=5B5E2AE9

http://scontent-lht6-1.xx.fbcdn.net/v/t31.0-8/29983763_10156195279403476_8773411088492963784_o.jpg?_nc_cat=0&oh=c71cd80270747b145fe45955e2c6c6e1&oe=5B6A7007

http://scontent-lht6-1.xx.fbcdn.net/v/t31.0-8/29873461_10156195279163476_6224936349439404137_o.jpg?_nc_cat=0&oh=eeeca00083f161fcca8e6d6beae09731&oe=5B2A3DF6

http://scontent-lht6-1.xx.fbcdn.net/v/t31.0-8/30072719_10156195278943476_2134421362109926421_o.jpg?_nc_cat=0&oh=d37cac894b98f2ce7cf3fd2e12b55531&oe=5B74A858

http://scontent-lht6-1.xx.fbcdn.net/v/t31.0-8/29983043_10156195279103476_4364128348856023995_o.jpg?_nc_cat=0&oh=a304f50574f2a1da798809e1bd4a2e50&oe=5B6DE6A9
____________________
Well, you know what they say. If you want to save the world, you have to push a few old ladies down the stairs.
Skudd:- Perhaps she just thinks you are a window licker and is being nice just in case she becomes another Jill Dando.
WANTED:- Fujinon (Fuji) M42 (Screw on) lenses, let me know if you have anything.
 Back to top
View user's profile Send private message You must be logged in to rate posts

Paddy.
Red Rocket



Joined: 14 Feb 2008
Karma :

PostPosted: 11:03 - 16 Apr 2018    Post subject: Reply with quote

Now that is cool. Thumbs Up Thumbs Up
____________________
Current ride : Suzuki GSXR1000 L0 - Suzuki SV650 track bike - Yamaha Majesty YP250
My biking history so far
Rogerborg wrote: Whole life care for a VTR full of quadraspazzed Darrryls and Shoniq'uas cost mad dollah.
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

DrSnoosnoo
World Chat Champion



Joined: 28 Mar 2012
Karma :

PostPosted: 12:18 - 23 Apr 2018    Post subject: Reply with quote

So? When are you going to post a guide for this?

I want to make one...
____________________
I'm Sam; Northern, Ginger, Lover
snoosnoo's guide to ZZR600 Valve Clearances
snoosnoo's partial guide to ZZR 600 fork seals and head bearings
 Back to top
View user's profile Send private message Send e-mail You must be logged in to rate posts

Pjay
World Chat Champion



Joined: 18 Jan 2016
Karma :

PostPosted: 12:28 - 23 Apr 2018    Post subject: Reply with quote

That's wonderful and pisses on my retropie consoles :/

http://oi66.tinypic.com/2qch7ix.jpg
http://oi65.tinypic.com/2nszaq0.jpg
____________________
struan80 - I'll go first - satisfied tick 1
 Back to top
View user's profile Send private message You must be logged in to rate posts
Display posts from previous:   

Post new topic   Reply to topic    Bike Chat Forums Index -> The Geek Zone All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Read the Terms of Use! - Powered by phpBB © phpBB Group
 

Debug Mode: ON - Server: discovery (www) - Page Generation Time: 0.09 Sec - Server Load: 3.47 - MySQL Queries: 17 - CDN Objects: 38 - Page Size: 99.08 Kb