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.
Last edited:
hi,
Are you asking for the DB9 pin numbers and signal assignments.????


i am asking about where do i connect the rest of the pins of theserial port???.....like DTr is connected to the circuit, so what about the rest of them...should they be left open???
 
i am asking about where do i connect the rest of the pins of theserial port???.....like DTr is connected to the circuit, so what about the rest of them...should they be left open???
hi.

The unused pins on the DB9 should not be connected.

BUT.... pin #5 is the 0V/Common pin, which is connected to the 0V of the circuit diagram.

What language are you using in the PC to control the DTR pin.??
 
hi.

The unused pins on the DB9 should not be connected.

BUT.... pin #5 is the 0V/Common pin, which is connected to the 0V of the circuit diagram.

What language are you using in the PC to control the DTR pin.??

hey i am using C coding in linux.....i understand that signal ground will have to be given 0V but what abt the TxD pin coz i need to transmit the voltage values that i am getting after comparison.....are you understanding my point???
 
hey i am using C coding in linux.....i understand that signal ground will have to be given 0V but what abt the TxD pin coz i need to transmit the voltage values that i am getting after comparison.....are you understanding my point???


hi,
To transmit the values, using RS232 from the PC, the TXD line will have to be connected to a remote RS232 receiver.

Is this what you mean.?
 
hi,
To transmit the values, using RS232 from the PC, the TXD line will have to be connected to a remote RS232 receiver.

Is this what you mean.?

Hi there,

I am sorry but i was on a sick leave so couldn't continue with my things.....

well, from our last discussion....please see the diagram attached and suggest if i am doing the write thing???

from the PC i am sending data that is stored in a variable.....so should i write in my code that tranfer data to the TxD pin or what?
 

Attachments

  • Doc2.doc
    23.5 KB · Views: 128
Hi there,

I am sorry but i was on a sick leave so couldn't continue with my things.....

well, from our last discussion....please see the diagram attached and suggest if i am doing the write thing???

from the PC i am sending data that is stored in a variable.....so should i write in my code that tranfer data to the TxD pin or what?

hi,
Hope you are feeling better.

I think we have got our wires crossed.:)
The difference of this is what i want to give to the LED Lamp through serial port. But i am not getting the right way to do it.
The first post asked for a way to enable the PC serial port to drive an LED.?

Your last dwg shows the LDR as an input to the PC serial port.

Can you restate exactly what you do require.
 

Attachments

  • esp01 May. 20.gif
    esp01 May. 20.gif
    3.2 KB · Views: 172
  • esp05 May. 09.gif
    esp05 May. 09.gif
    4.9 KB · Views: 239
Last edited:
hi,
Hope you are feeling better.

I think we have got our wires crossed.:)

The first post asked for a way to enable the PC serial port to drive an LED.?

Your last dwg shows the LDR as an input to the PC serial port.

Can you restate exactly what you do require.


hi,
yeah thanks, but m fine now....

well....both are right but i think i confused you as usual....

1] LDR measures the ambient light
2] it is passed to PC using parallel port.
3] it is compared with preset voltages in the PC
4] the difference of the comparison is to be given to the LED using Serial port....

this is what is my query.....how to give the difference voltage to LED usig serial port?>??

you told me to connect to the circuit you gave to the DTR pin....but in that my question is what about the TxD pin i.ei data transfer pin??

i hope this makes sense now??? :)

[/LIST]
 
hi,
yeah thanks, but m fine now....

well....both are right but i think i confused you as usual....

1] LDR measures the ambient light
2] it is passed to PC using parallel port.
3] it is compared with preset voltages in the PC
4] the difference of the comparison is to be given to the LED using Serial port....

this is what is my query.....how to give the difference voltage to LED usig serial port?>??

you told me to connect to the circuit you gave to the DTR pin....but in that my question is what about the TxD pin i.ei data transfer pin??

i hope this makes sense now??? :)

hi,
If you need to transmit RS232 serial data from the PC to a remote UART, use the TXD pin and 0V.

For the varying brightness LED, you will need to drive the DTR with a PWM signal, thats a signal where the mark/space ratio is varied.

For full brightness the DTR would be set 100% of the time and for say [rough] brightness, 50% on/off ratio.

Do you follow that.?
 
hi,
If you need to transmit RS232 serial data from the PC to a remote UART, use the TXD pin and 0V.

For the varying brightness LED, you will need to drive the DTR with a PWM signal, thats a signal where the mark/space ratio is varied.

For full brightness the DTR would be set 100% of the time and for say [rough] brightness, 50% on/off ratio.

Do you follow that.?

yes i followed the concept...so in our case, we are using the second method right???
 
so how do we vary the mark/space ratio???

hi,
You have to switch the DTR line high/low at a fast rate.

The brighter you require the led the longer the high/on time compared to the low/off time.

You have to set the mark/ontime proportional to the LDR signal.

OK.
 
hi,
You have to switch the DTR line high/low at a fast rate.

The brighter you require the led the longer the high/on time compared to the low/off time.

You have to set the mark/ontime proportional to the LDR signal.

OK.

hmmm....makes sense....i will try doing it now
 
they thats quite helpful for me to do coding even....thanks....

hi there,

i did read that arduino thing...it is very very simple but still i am jammed in writing the code....

shud it be like this...

i initialise my comm port using :

#include <bios.h>
#include <conio.h>

#define COM1 0
#define DATA_READY 0x100
#define SETTINGS ( 0x80 | 0x02 | 0x00 | 0x00)

int main(void)
{

int in, out, status;
bioscom(0, SETTINGS, COM1); /*initialize the port*/

then make pin DTR high by just passing 1 to that pin...
and give a delay of my required amount????


i am really bad in writing codes even if i understand the logic

pls help me
 
but can you give me a flow for writing it...like the steps to be done????

hi,
I thought you were driving the LED via the PC's serial DTR port.??

Are you asking for the PC led drive program.?
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top