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.

I need more help with this circuit

Status
Not open for further replies.

Rexlan

New Member
I built this circuit up and substituted a resistor for the LDR and put a LED on the headlight line. The circuit flashes the LED correctly but I can not get the circuit to shut off no matter what the value of the LDR is. I have increased it all the way up to 1m ohm ... no difference. The idea is to have the LDR disable the circuit at dark. I also only have one pin left to use on the processor.

I am using a slow PWM signal from a PIC and I want the headlight line to provide the 12v being controlled by the PIC.

What am I doing wrong with this?
 

Attachments

  • Modulator.png
    Modulator.png
    2 KB · Views: 287
Why start a new thread?

You must write a zero to the port pin, or leave it pulsing at the PWM rate for the light to turn off in daylight. If you leave the pin high, the headlight will never turn off, regardless of the LDR resistance.

The LDR resistance must be LOW to never turn ON the headlight (i.e. daylight) even though you write a high or pulse the port pin high..
 
OH ... sorry, I started a new thread because I never got an answer to my last post on the old one so I thought it got burried.

I have the PIC running a simple high, pause 3000 , low pause 3000, start over. The light flashes as it should and it does so with the LDR substituted with a 10K resistor and with a 1M resistor. So it appears that the LDR is not working.

I thought that the LDR resistance increased when it was dark?? And the circuit would be disabled if the resistance was >75K .... now I am confused again ... LOL

What I am trying to accomplish is to have the PIC put out the PWM signal continuously and when it gets dark for the LDR to disable the circuit.

Ideally ... I would like to have the circuit work in daylight and to just stay high (headlight on) at dark AND if the PIC failed.
 
According to the circuit, the LDR must have a value of >75K to ENABLE, not to DISABLE. This circuit is designed to have the headlight turn ON in the dark, not turn OFF. It all depends on how the LDR is connected to the circuit whether it turns on when the resistance is high or off when it's high. For example, street lights are connected in a way that turns on the circuit when the resistance is high (in the dark), whereas certain light-activated alarms turn on when the resistance becomes low (in the light). I believe at the moment you have it backwards. Chances are if you connected a LOW resistance resistor in place of the LDR the LED would turn off. I don't think this is the right circuit for your project. You want one more like this one:



Depending on the load you plan to use with this circuit, I suggest you use a transistor that can handle a fair amount of current (perhaps a 2N3055). I'm a little confused about the last line of your post saying "Ideally I would like to have the circuit work in daylight and to just stay high at dark." Are you saying that you want it to stay on all the time?
Anyway, I hope this new circuit helps, and good luck!
Der Strom
 
Last edited:
What voltage are you running the PIC on?
 
I used a simple LED as the load so I could watch it. The real load is about 6 amps @ 12Vdc and the PFET will handle that easily. I have substituted a 1K resistor for the LDR and the circuit flashes on/off. I swapped in a 1M ohm resistor and there is no change.

The circuit it a headlight modulator for my motorcycle. It will modulate the headlight on/off at 960 Hz @ 60% duty cycle which is the prescribed rules in the laws. The headlight is not allowed to modulate when it is dark outside ... only during the day time. They sell commercial units but I want to make my own.

If it is daylight the circuit needs to be enabled. If it is dark it is disabled BUT the headlight needs to be on steady. If the PIC processor fails the headlight needs to be on steady.

Mike the PIC runs on 5 Vdc. My problem is that I only have one pin left to use on the PIC processor. If I had two it would be simple.

I am stumped???
 
I used a simple LED as the load so I could watch it. The real load is about 6 amps @ 12Vdc and the PFET will handle that easily. ...

The circuit depends on the high-current load being there. By substituting the LED, that explains why the circuit didn't work.

However, what I simulated would shut off at night, and pulse only in daylight.
 
Last edited:
Ok. I have redesigned the circuit to make it so the load is fully switched on in the dark (LDR resistance=>50K in the sim), and pulses on/off in step with the PWM signal when the LDR is illuminated (LDR resistance <=40K). I found a LDR on DigiKey which would work. I added a provision to adjust the sensitivity (Make R6 a 25K or 50K pot wired as a rheostat).

When simulating it, I noticed that the 10K gate resistor in the previous circuit made it so that the FET turned off very slowly, so that the FET dissipated ~2W. By actively using the 555 as a gate driver, the FET dissipation is now only 0.3W. The TRIG comparator inside the 555 is also used to get a clean switching point as the LDR changes resistance. Note that the TRIG and THRES inputs to the 555 work backwards in this circuit; TRIG shuts off the FET, and THRES turns on the FET. When the LDR resistance is high, the 555 internal flip-flop never gets SET, which means that the OUT pin stays Low, meaning that the FET is always on.
 

Attachments

  • Rex.png
    Rex.png
    42.4 KB · Views: 235
Great ... thanks Mike. As usual you're on top of the game! I can do simple stuff but this is over my head!

Can R2 and R4 be 10K ... looks like these are just a divider?
 
Last edited:
Last edited:
The circuit it a headlight modulator for my motorcycle. It will modulate the headlight on/off at 960 Hz @ 60% duty cycle which is the prescribed rules in the laws. The headlight is not allowed to modulate when it is dark outside ... only during the day time. They sell commercial units but I want to make my own.

Apologies. I guess I didn't really understand your question.:eek:
 
Status
Not open for further replies.

Latest threads

Back
Top