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.

Electromagnetic interference

Status
Not open for further replies.

winterhunter

New Member
Hi everyone,

I'm currently building a small SCADA for my house, using a computer as supervisor and connecting it to a PIC via the serial port.

The first step will be to control the air conditioners (I have two in my living room).

I have tested the PIC and it does communicate successfully with the computer, and also can control one A/C perfectly. However, I have two EMC problems, and I wanted to get your opinions:
1) I use PWM at 38 kHz to control the A/C. I multiplex the CCP output using a 74HC00 to be able to selectively control one, the other or both A/Cs. This goes to a 7 m cable that feeds both power and signal (+5V,GND, PWM output) to an NPN transistor controlling an IR LED. However, the A/Cs don't recognize the IR commands (they do when I don't use the cable).
Is there a simple fix for this?

2) In the final configuration, I will be placing the PIC around 10 m away (make that 15 m of cable) from the computer. I've read somewhere that this is pretty much the limit for RS-232, and was thinking of using RS-432. On the µcontroller side, the PIC won't even notice if I replace the MAX232 for a MAX488. However, can I use a MAX488, suitably connected to the computer serial port to "translate" back to RS-232?

Thanks a lot!
 
winterhunter said:
1) I use PWM at 38 kHz to control the A/C. I multiplex the CCP output using a 74HC00 to be able to selectively control one, the other or both A/Cs. This goes to a 7 m cable that feeds both power and signal (+5V,GND, PWM output) to an NPN transistor controlling an IR LED. However, the A/Cs don't recognize the IR commands (they do when I don't use the cable).
Is there a simple fix for this?
I think the problem could be that the capacitance of the cable is filtering out the 38kHz PWM signal.
Instead of putting the transistor at the LED end of the cable, put it at the74HC00 end of the cable and just use two wires (twin-twisted) to connect the transistor to the LED.
I think you will find that the current drive to the LED will work better than the voltage drive to the transistor.

winterhunter said:
2) In the final configuration, I will be placing the PIC around 10 m away (make that 15 m of cable) from the computer. I've read somewhere that this is pretty much the limit for RS-232,
Depends a lot on the data rate.
If you are using a high speed, 19200 bps or more, then yes you could have a problem.
But if the comms link is run a a slow speed, RS232 will be fine.
How fast does the link have to be, I guess not very fast.
Try 300 bps, it will probably work well.

winterhunter said:
and was thinking of using RS-432. On the µcontroller side, the PIC won't even notice if I replace the MAX232 for a MAX488. However, can I use a MAX488, suitably connected to the computer serial port to "translate" back to RS-232?
Thanks a lot!
Yes you could use two MAX488s to create an RS422 link.
But be aware that the MAX488 does not directly interface to RS232 on its "single ended side", you would probably have to use a MAX232 to get the correct voltage levels for RS232.

Lots of hardware when a slow RS232 link will probably do it all for free!

JimB
 
You used PWM to control an airconditionar?

What sort of motor does the A/C use?

I thought they normally used induction motors which can't be controlled using PWM.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top