Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Breadboard to PCB Question: Circuit Line Errors?

Status
Not open for further replies.

WiFiSunset

New Member
New to the Forums here. To summarize my knowledge: I went to college for Programming, and work in a NOC. I'm starting to get back into circuits and breadboards, but I only had basic circuit and circuit component knowledge beforehand. The concept I get from both a programming standpoint, but my weakspot now lies in the fact that I'm still dealing with a learning curve (as is natural lol).

Question: I extended a Photosensor design to add leds that detect if the light in the room is either (bright, dim, or dark). I know how to solder, and I want to order a pcb of the design. My question is, are the 'Circuit Lines' on the pcb connected properly. I'm slightly sure they are, but I have doubts about if they're correct for the Ground & 3.3V Power Pins. I want to make sure those are connected properly on the pcb.

Also adding the schematic for the circuit as well. (Posted this on another circuit forum website, but didn't get any answers sadly lol).
Any help is appreciated !
 

Attachments

  • Photoresistor LED_bb.pdf
    462.2 KB · Views: 101
  • Photoresistor LED_pcb.pdf
    409.1 KB · Views: 98
  • Photoresistor LED_schem.pdf
    933.6 KB · Views: 96
Thanks so much! And that's okay. (Is it how I worded the question?)


I don't think you will get any useful information from your photoresistor the way it is connected if you leave the pin 7 connection as an input. On the other hand, if you plan to toggle between charging and discharging the cap with software, then you will blow out your pin 7 if you set the mode to output (low) as the 1000uF cap discharges to the pin without a resistor.
 
I don't think you will get any useful information from your photoresistor the way it is connected if you leave the pin 7 connection as an input. On the other hand, if you plan to toggle between charging and discharging the cap with software, then you will blow out your pin 7 if you set the mode to output (low) as the 1000uF cap discharges to the pin without a resistor.

Ahhh, Would adding a resistor here help (referencing Edit 1 & 2 pdf).

And I'm able to get useful information from it (I can tell when the lights are dim, dark, or bright) in my program (I extended someone's function to include led input-output, and updated it for python3).

I can't add .py files (it won't let me upload them). I placed the entire code into a txt file.
 

Attachments

  • Photoresistor LED_Edit-1_bb.pdf
    473.2 KB · Views: 99
  • Photoresistor LED_Edit-2_bb.pdf
    483.3 KB · Views: 94
  • led_light_sensor_values.txt
    2.9 KB · Views: 98
The rip zero does not have an ADC, what are you measuring? The time to charge the cap until the pin flips from low to high? Then you discharge the cap?

If that is what you are doing, you will soon burin out the sense pin because you are dumping the full current load to the pin (output low). You should add a 300 ohm resistor from the photo resistor to that pin so the cap can't unload with zero impedance.
 
The rip zero does not have an ADC, what are you measuring? The time to charge the cap until the pin flips from low to high? Then you discharge the cap?

If that is what you are doing, you will soon burning out the sense pin because you are dumping the full current load to the pin (output low). You should add a 300 ohm resistor from the photo resistor to that pin so the cap can't unload with zero impedance.

Dang. I didn't know that. I fixed it on the physical breadboard, and in all of the schematics as well.

Edit: Fixed. I had a question about if the Anode should be heading to the pins, but double-checked the breadboard and an led image showing the long pin is the Anode, and fixed my schematic. The schematic should be final, same with the pcb as well (though a second verification from someone here would help too).

And yes the code measures uses the LDR and retrieves the time it takes to go from low to high. And I'm using that as the variable to determine light values in the room.

(P.S. Thanks for being super helpful too :) )!

Code:
--------------------
#defines the pin that goes to the circuit
pin_to_circuit = 7

# Function: def rc_time(pin_to_circuit)
# Description: This function displays the photoresistor's values by using the 'count' variable,
# and sets the led to flash either red, green, or blue depending on the values given.
def rc_time(pin_to_circuit):
count = 0

#Output on the pin for
GPIO.setup(pin_to_circuit, GPIO.OUT)
GPIO. output(pin_to_circuit, GPIO.LOW) # Edit: Put a space between GPIO. output because it turns it into an emoji on forum otherwise.
time.sleep(0.2)

#Change the pin back to input
GPIO.setup(pin_to_circuit, GPIO.IN)

#Count until the pin goes high
while (GPIO.input(pin_to_circuit) == GPIO.LOW):
count += 1

return count
 

Attachments

  • Photoresistor LED_Edit-2_bb.pdf
    483.3 KB · Views: 92
  • Photoresistor LED_Edit-2_pcb.pdf
    373.5 KB · Views: 85
  • Photoresistor LED_Edit-2_schem.pdf
    1 MB · Views: 98
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top