Author Topic: External IR  (Read 230 times)

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
External IR
« on: August 08, 2016, 04:06:10 am »
Hello.
I have made a simple IR receiver/sender based on BC547, BC557.
For some reason I can't get it to work with a mcModule the IR does not send anything, if I connect it to an arduino then it works.

What is the difference between the pins on arduino and mcModule?
This is not in the code it is something with the connection of hardware between the mcModule and my homemade IR i think.

The connection is only TX,RX,3.3v and GND I am using external power to both mcModule and the IR.

Code: [Select]
Define PinMode Pin1 As DigitalInput //RX
Define PinMode Pin3 As DigitalOutput //TX

Code: [Select]
Shared serial As Uart
    Shared Event Boot()
        serial = Uart.Create(1200, Pin.Pin3, Pin.Pin1)
    End Event
Code: [Select]
Shared Event Send() RaiseEvent Every 10 Seconds

        serial.Write(0x80)
        serial.Write(0x3f)
        serial.Write(0x02)
        serial.Write(0x35)
        serial.Write(0xe9)
        serial.Write(0x0d)
       
    End Event

On the arduino I use SoftwareSerial with same baud (1200).

Share on Facebook Share on Twitter


kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: External IR
« Reply #1 on: August 08, 2016, 09:41:16 am »
The IR is built for arduino that has Logic Level of 5V and mcModule has Logic Level of 3.3V so I am using a Level shifter, maybe it something wrong with that. I will investigate that.

mc-Abe

  • Full Member
  • ***
  • Posts: 167
    • View Profile
    • mc-Things
Re: External IR
« Reply #2 on: August 09, 2016, 02:31:14 pm »
I would lean towards that as well. I have verified that you code creates the correct sequence of bytes at the correct baudrate using a logic analyzer.

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: External IR
« Reply #3 on: August 09, 2016, 03:10:46 pm »
Thanks for that, I have ordered a logic analyzer but not yet received it.  :)
Iam going to rebuild the IR module for 3.3 Voltage, I will let you know how it goes in this thread.
Like Like x 1 View List

kristofferis

  • Sr. Member
  • ****
  • Posts: 287
  • Location: Sweden
    • View Profile
Re: External IR
« Reply #4 on: August 18, 2016, 03:45:24 am »
Hello.
I have now received my logic analyzer and i connected it to the mcModule that i have made the IR test with and i found out that it was not sending anything so this one seems broken, i switched to a new mcModule and now I could read the data with my serial analyzer but the result is not consistent, maybe 2-3 out of 10 readings matched what i was sending (the code I posted here).
I also connected an Arduino so the logic analyzer and 10 out of 10 is correct.

I am sending same data from my Arduino and mcModule and same baud rate.

What could causing this?