Knucklehead
Posts: 6
Joined: Thu May 18, 2017 6:36 pm

Help for a complete Noob

Thu May 18, 2017 6:46 pm

Hi all

This is probably more of a electronics question than a Raspberry question but here goes. I am trying to learn to work with the GPIO pins. I set up a simple circuit on a breadboard consisting of one LED and a 1k resistor. When I plug it into the 3.3 rail it works fine (its a little dim because of the resistor but that is on purpose).

So then I set up my python script to blink the lights and play with PWM output. I attach to pin 7. When I run either program it will blink perhaps for 10 seconds and then refuse to turn on again. I am running a loop in the python program to turn it on and off. I have tried different intervals 3 seconds and .1 second. I have tried different LED's, Different transistors. to no avail. Any ideas what is going on?

User avatar
Burngate
Posts: 6313
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Help for a complete Noob

Fri May 19, 2017 9:03 am

If the LED lights when plugged into the 3v3 rail (pin 1?), and lights when moving it from the pin 1 to pin 7 (if only sometimes) then your circuit is fine.
When the LED is lit, there's 3v3 on pin 7. When it's not, there isn't.

So if it isn't lighting when you think it should, your script isn't doing what you want it to do.
Can we see your script?

Also note the thread viewtopic.php?f=91&t=184052
Pin 7 (GPIO 4) is used by the 1-wire protcol

Knucklehead
Posts: 6
Joined: Thu May 18, 2017 6:36 pm

Re: Help for a complete Noob

Fri May 19, 2017 7:21 pm

Thanks, I think I found the culprit, I think pin 7 on my pi is hosed. I changed the script to pin 37 and it worked fine.

User avatar
Burngate
Posts: 6313
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Help for a complete Noob

Sat May 20, 2017 8:33 am

It's more likely that 1-wire is enabled.
From that other thread
DirkS wrote:Also check if 1-wire is activated in /boot/config.txt; check for a line with 'dtoverlay=w1-gpio' in that file.

Return to “Automation, sensing and robotics”