I'm running Raspbian Jessie on my Raspberry Pi 3 and I'm doing a little house alarm project. When the alarm is activated the Pi should transmit FM signal of an alarm sound on a frequency that a few radios in the house will be tuned at. The program I use for transmiting FM is here and it uses PWM (on GPIO 4) to transmit FM.
Transmiting audio works as expected but the problem is present on my LCD 16x2 display (it's connected to I2C). Whenever I run the LCD and transmit in the same time the LCD starts displaying gibberish (first couple of times it even raised an I/O Error 5, but I can't reproduce it anymore). All other functions of the alarm such as arming, disarming or disabling the siren are working as expected while transmiting.
The reason I think PWM conflicts with I2C is because on this post an I2C clock is mentioned, it's on GPIO 3, but that still makes me believe there are more I2C connections between the pins (even though I didn't find them in this reference)
The question:
How would I use the I2C LCD and transmit FM using the PWM method in the same time?
Extra tehnical info:
- LCD is I2C LCD1602 from this kit
- LCD module source can be found here. It's rather high level so it's simpler for me and my week of experience with a Raspberry Pi.
- Last time the I/O Error was raised was at the
BUS.write_byte
function in the LCD module source (can't remember what line, the error doesn't occur anymore but is surely linked with the LCD problem)
EDIT:
The Error 5 happened again (file at the github link above):
Traceback (most recent call last):
File "alarm.py", line 432, in <module>
setup()
File "alarm.py", line 133, in setup
LCD1602.clear()
File "/home/pi/alarm/LCD1602.py", line 75, in clear
send_command(0x01) # Clear Screen
File "/home/pi/alarm/LCD1602.py", line 21, in send_command
write_word(LCD_ADDR ,buf)
File "/home/pi/alarm/LCD1602.py", line 15, in write_word
BUS.write_byte(addr ,temp)
IOError: [Errno 5] Input/output error
There are the pictures. I don't think anything is incorrectly connected. (Sorry about the pictures being blurry, I don't have a good camera)