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.

Light Sensor Project

Status
Not open for further replies.
haha...but you remember you gave me a design...i did the same....nothing different than that....

but i will check n test it again and let you know what happens...

cheers.

hi there!!!!

Sorry to respond back so late....

Well, i tried to test using the circuit that you posted here. Now the LED is turning ON but the issue is the DTR signal is not toggling as it was before. the voltage level is staying at around -12mV. Can the serial port be damaged due to which i am facing this problem???

Also, about the voltage to be sent out to LED according to the LDR output...

I am designing the PWM for three levels like 10%, 50% and 100% and then sending out the voltage to the LED so that issue is solved too.

Well, can you briefly explain me whats happening with the LED drive circuit when DTR goes high and low. I just want to cross check if i am taking it in the right sense...

Cheers,
payal :)
 
Now the LED is turning ON but the issue is the DTR signal is not toggling as it was before. the voltage level is staying at around -12mV. Can the serial port be damaged due to which i am facing this problem???
With a DTR voltage of only -12mV the transistor cannot be ON, so the LED will not be lit.???


Well, can you briefly explain me whats happening with the LED drive circuit when DTR goes high and low. I just want to cross check if i am taking it in the right sense...
You said earlier that the DTR voltage on the pin switched from +10.6V to -11V
When the voltage is +10.6 the transistor and LED are ON, when -11V the transistor and LED are OFF.

payal :)

hi,
That -12mV signal on DTR dosnt sound correct.
Do you have the 0V/Common of the external psu connected to pin#5 [0V] of the PC's 9pin serial connector.??? it should be.
 
Last edited:
hi,
That -12mV signal on DTR dosnt sound correct.
Do you have the 0V/Common of the external psu connected to pin#5 [0V] of the PC's 9pin serial connector.??? it should be.


i did connect all the pins properly but dnt know whats wrong..it was working fine the other day..my proff said to change the serial connector, for which i have to wait for uni to open on monday
 
i did connect all the pins properly but dnt know whats wrong..it was working fine the other day..my proff said to change the serial connector, for which i have to wait for uni to open on monday

hi,
I cannot see how changing the serial connector is going to help.?

If you suspect the DTR output is damaged, you could try the RTS line.
Dont connect the led directly across a serial pin and 0V.
 
hi,
I cannot see how changing the serial connector is going to help.?

If you suspect the DTR output is damaged, you could try the RTS line.
Dont connect the led directly across a serial pin and 0V.


hey...

i could finally get it...there was something wrong with the serial port connector. I changed the port connector and now its working. Even the code for adjusting the brightness is working fine.

Now started joining the bits and pieces of code together and trying to solve the errors.

Do you know how we can run two concurrent processes at a time??

Like i have my LDR sensor who outputs the data very fast and my Serial Port is sending out data slow. So what should i do in such a case....

any expert advices??:)
 
hey...

i could finally get it...there was something wrong with the serial port connector. I changed the port connector and now its working. Even the code for adjusting the brightness is working fine.

Now started joining the bits and pieces of code together and trying to solve the errors.

Do you know how we can run two concurrent processes at a time??

Like i have my LDR sensor who outputs the data very fast and my Serial Port is sending out data slow. So what should i do in such a case....

any expert advices??:)

hi,
Well done.!:)

If you write the 'data' to the Comm, the hardware will do all the timing.
There should be enough time to refresh the LED and send RS232 data.

What baud rate are you using.?
 
Last edited:
hi,
Well done.!:)

If you write the 'data' to the Comm, the hardware will do all the timing.
There should be enough time to refresh the LED and send RS232 data.

What baud rate are you using.?


i havent set the baud rate to any value...its working at the standard PC baud rate only...
 
i havent set the baud rate to any value...its working at the standard PC baud rate only...

How often are you writing serial data to the Comms and what is the data string.?
 
How often are you writing serial data to the Comms and what is the data string.?

Hey mate!!!

my ADC is converting data with 2ms conversion time and i am just toggling my DTR pin. the delay of the toggling is designed according to the condition:

Ton + Toff = 10ms.

i am not getting errors while runing the code ..its just that if keep ADC conversion time same, i can't see the LED brightness chnaging since its too fast....if i slow down the ADC conversion time by adjusting the delay...the process becomes slow....

hope u getting me:)
 
Hey mate!!!

my ADC is converting data with 2ms conversion time and i am just toggling my DTR pin. the delay of the toggling is designed according to the condition:

Ton + Toff = 10ms.

i am not getting errors while runing the code ..its just that if keep ADC conversion time same, i can't see the LED brightness chnaging since its too fast....if i slow down the ADC conversion time by adjusting the delay...the process becomes slow....

hope u getting me:)

hi,
I would not slow down the adc conversion, it should not affect the PWM drive to the LED.
The PWM drive is determined by the adc 'value'.

Are you saying the 'toggling' PWM is variable Ton= 0mS to 10mS and Toff = 10mS to 0mS.?

That is full ON, to full OFF.

Its a pity we dont both use VB in the PC, I could run your program.:)
 
Last edited:
hi,
I would not slow down the adc conversion, it should not affect the PWM drive to the LED.
The PWM drive is determined by the adc 'value'.

Are you saying the 'toggling' PWM is variable Ton= 0mS to 10mS and Toff = 10mS to 0mS.?

That is full ON, to full OFF.

Its a pity we dont both use VB in the PC, I could run your program.:)


Well, even i think it will not affect the driving but still wanted to confirm it....Yes PWM is determined by ADC value...

if ADC output is high then the duty cycle will be low and vice versa...

Also about the Ton and Toff..

if i set my Ton i.e. LED on to 2ms then i have to set my Toff to 8ms this means that the total pulse width cannot be greater than 10ms....

n you know what i cudnt have ever used VB....i used to hate programming but now i am doing because i had too but now its fun.... ;)
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top