I have been a little disconnected from Spark/Particle for a while and things certainly have changed. I received my Photon and want to attempt a project. It seems simple enough but I am looking for some guidance before I start as I am unsure about RS232…
I want to control a monitor that has RS232 input to turn ON and OFF.
I think this can be done with a simple Serial.write command to the serial port?
For the hardware, can I use SparkFun RS232 Shifter - SMD? I presume plugging this into the monitor would take care of the level shifting or would I have to provide a 12v Power supply for the monitor side?
I was hoping there would be a shield for RS232 for the photon but possibly the closest would be the upcoming Shield-Shield and use an Arduino RS232 Shield.
Finally I would like to activate this via the IFTTT Go Button. This would allow me to turn the monitor ON and OFF via simple iPhone button.
Any guidance would be appreciated and if there is an existing similar project on the RS232 side that you can refer me to it would be appreciated. I looked around but mostly found only 5v Serial Particle to Arduino type projects.
The SparkFun device seems to have the RS232 to Particle side (RX) covered but I question the TX direction. It uses the logic side VCC for transmit voltage and the core/photon 3.3v is barely adequate to cover RS232. I would look more closely at that before committing. The suggestion from @hardwater is proven and reliable.
Yes that would be fine. What a max232 does is use the caps to make a charge pump to create the ( as I remember +/- 15 volts).
Looking at the sparkfun device I bet it will work just give the same +v & gnd to it that you are going to use to power the photon. That assumes your supply can provide enough power. Most anything you would probably choose would.
Thank you for the replies. Sorry if I sound dumb but just want to double check before frying anything - The description on the Sparkfun device says power the board at 5V and the unit will convert RS232 to 5V TTL, So i understand that INCOMING RS-232 signals will be converted to 5V or whatever level i power the board with. Does this also mean that OUTGOING signals will be Upconverted to 10V?, I presume this is supplied by the Monitor side?
I’m actually working with Cisco Devices, these devices usually output 12Volts, would this still be okay? 12V into the MAX3232 then from the MAX3232 into the Particle Photon
My other question was could I use the 12Volts being supplied from the RS232 port and use it to power the Photon, as well as have the RS232 signals be converted to UART?
Its my understanding the MAX3232 IC needs either 3.3V or 5V to operate also?
@dylanger, the spec sheets for the MAX3232 indicate they can handle the full +/-25v voltage range defined in the RS232 spec.
There are two parts to the MAX3232 - One is the RS232 interface which uses those 10uF caps as charge pumps to create the +/- voltages required by the RS232 spec. So, the +/- 12v from the Cisco device on the RX/TX lines is fine. The other part is the low voltage interface logic which uses 3.3v - 5v. Ideally, you would power the MAX3232 with 3.3v so its logic outputs work with the Photon’s 3.3v GPIO. Since the MAX3232 is a low current device, you could use a number of small (50-150ma) LDO voltage regulators to get the 3.3v.
The RS232 spec does not include a 12v supply on any of the RS232 pins unless it is added by the Manufacturer. I have seen some designs that “harvest” power from the DTR/RTS/TD pins but I would not rely on that. Where were you proposing to get that voltage?
@dylanger, I would power the RS232 board from the photon’s 3V3 pin. Connecting all the grounds is absolutely required.
As for powering the Photon, I would not rely on power from the RS232 pins UNLESS Cisco specifically specifies that pin as a 12v power source with a max current load. Since I doubt they would do this, I suggest powering the Photon for a good and reliable source.