Jordanaras
Posts: 4
Joined: Tue Dec 17, 2019 7:18 pm

Cant get pins to output 0

Fri Jan 17, 2020 3:16 pm

I am having problems trying to light a led through batteries by giving the signal with my raspberry pi 3B+. This is my current setup.
The chip is 74HC08. Doesnt matter if i set output to 1 or 0, the led randomly turns on and off. I even connected the led+ to raspberry GND or 5V but still absolutely nothing changed. The chip is tested and works well, so does the driver that i also used to ensure my problem.(Ignore the driver in this example)
Attachments
problem.jpg
problem.jpg (204.31 KiB) Viewed 242 times

pcmanbob
Posts: 9462
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Cant get pins to output 0

Fri Jan 17, 2020 5:08 pm

So possible errors with your circuit.

1. Feeding chip from 6v means you need 4.2V input to be seen as a high input ( pi gpio is 3.3V ).
2. There does not appear to be a ground from the pi connected to your bread board.
3. There does not appear to be a current limiting resistor in the LED circuit.
4. I am not even sure you can drive an LED from the output of a logic gate directly.

So why do you want to use the 7474HC08 as a driver for your LED ?

A red,green or yellow LED connected in series with a 470 ohm resistor , connected to your pi between a gpio pin set to output and ground will light up if the output is set to high.

if you specifically want to power your LEDs from 6v use a simple transistor/resistor driver circuit between the gpio pin and the LED.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

drgeoff
Posts: 10765
Joined: Wed Jan 25, 2012 6:39 pm

Re: Cant get pins to output 0

Fri Jan 17, 2020 6:27 pm

pcmanbob wrote:
Fri Jan 17, 2020 5:08 pm
4. I am not even sure you can drive an LED from the output of a logic gate directly.
74HC08 is specced for +/-25 mA output maximum. The spec sheet gives minimum output voltage when sourcing 5 mA and maximum voltage when sinking 5 mA. Ample for a modern LED.

Jordanaras
Posts: 4
Joined: Tue Dec 17, 2019 7:18 pm

Re: Cant get pins to output 0

Fri Jan 17, 2020 7:20 pm

pcmanbob wrote:
Fri Jan 17, 2020 5:08 pm
So possible errors with your circuit.

1. Feeding chip from 6v means you need 4.2V input to be seen as a high input ( pi gpio is 3.3V ).
2. There does not appear to be a ground from the pi connected to your bread board.
3. There does not appear to be a current limiting resistor in the LED circuit.
4. I am not even sure you can drive an LED from the output of a logic gate directly.

So why do you want to use the 7474HC08 as a driver for your LED ?

A red,green or yellow LED connected in series with a 470 ohm resistor , connected to your pi between a gpio pin set to output and ground will light up if the output is set to high.

if you specifically want to power your LEDs from 6v use a simple transistor/resistor driver circuit between the gpio pin and the LED.
Well i noticed that when the pin was 1 the light was the most time on but also switched off randomly. When the pin was 0 the light was the most time on but switched on randomly for short. So maybe your first point is right and i need more voltage.

pcmanbob
Posts: 9462
Joined: Fri May 31, 2013 9:28 pm
Location: Mansfield UK

Re: Cant get pins to output 0

Sat Jan 18, 2020 10:45 am

Try changing the 6v power supply to the 74HC08 to 4.5V , then your 3.3v gpio input will be seen as a good high.
We want information… information… information........................no information no help
The use of crystal balls & mind reading are not supported

Return to “Troubleshooting”