Can I use Arduino IR codes from their mini remote to work with the picaxe ?

profcpw

New Member
We have a bunch of these little IR remotes. We have been using the Sony code and the TV dollar store remotes with our 18M2+, however, the tv remotes are no longer available at the 1.25 stores. We used them for the kids in our robotics club here in Great Falls Montana. The little remotes were made to control car stereos, and work well with Arduino's. But, we want to use Picaxes' in our classes. So has anyone used these mini remote devices to control Picaxes' ?
 

kranenborg

Senior Member
I would guess that if these mini-remotes can emit codes in Sony-format then it should work. Do you have a type/name code of these remotes so we can gain an understanding of their workings and confirm this?
By the way, could you give a short description of your robotics club and its (intended) audience?

PS: Good choice, and welcome to this forum!

/Jurjen
https://www.kranenborg.org
 

profcpw

New Member
We are a not for profit science and robotics club which consists of classes that I teach in my spare time. The classes start at age 10 and up both boys and girls. No cost for the classes... going on almost 40 years of touching young and old students minds.

No, unfortunately the mini's do not emit Sony codes, I wish. Their codes are in a hex format of such for example to send a code with Sony format using debug in the Picaxe editor displays say the number 92. When you press a button on the Mini Remote (MR) you get nothing at all. So I was hoping that someone knew how to either convert or interpret the codes for the Picaxe. An example of the MR press the power button you get FFA25D, press the up arrow or the + arrow you get FF02FD.
 

kranenborg

Senior Member
If I remember vaguely, with a fast Picaxe (20X2 or similar) someone has published a "universal" decoder here on the forum. A search on this forum would be needed, and I doubt whether your 18M2+'s are fast enough - but there is always hope, right? Where can we find technical info on those "Mini Remotes" (maybe the protocol they use is simple to process and not to fast such that even an 18M2+ might be able to decode ...)?

PS: You accidentally opened another, similar thread, maybe good to close that one ....
 

profcpw

New Member
Ah, I see ... , so the Arduino emits the code ... . But then its protocol can be suitable adapted, me thinks.
/Jurjen
No, the MR sends the signals via the buttons the Arduino receives the signals and interprets them to robot motor movement.
 

profcpw

New Member
If I remember vaguely, with a fast Picaxe (20X2 or similar) someone has published a "universal" decoder here on the forum. A search on this forum would be needed, and I doubt whether your 18M2+'s are fast enough - but there is always hope, right? Where can we find technical info on those "Mini Remotes" (maybe the protocol they use is simple to process and not to fast such that even an 18M2+ might be able to decode ...)?

PS: You accidentally opened another, similar thread, maybe good to close that one ....
How do I close it?
 

Technoman

Senior Member
Hi,
Did you think making your own remote control transmitter?

When I was teaching... students had to program the robot receiving IR codes but also the remote control. Each robot had special IR codes not to interfere with a next one. We were using the great Grove compatible AXE300 boards with Grove thumb joysticks.
You can use any chip starting with a 08M2. The sensor could be buttons, keyboard, ...
The program is using the IROUT instruction to send IR code througt the IR LED. See diagram down here.
25591
 

Attachments

kfjl

Member
If you're talking about these nasty little things, they probably send NEC codes.

I think Inglewoodpete has posted code for that protocol on this forum.
 

kranenborg

Senior Member
If you're talking about these nasty little things, they probably send NEC codes.

I think Inglewoodpete has posted code for that protocol on this forum.
Yes, this is InglewoodPete's link: https://picaxeforum.co.uk/threads/background-infrared-receiver-for-32-bit-codes.16576/
Also, a PICAXE running at 64MHz seems what is needed to decode ... although it is suggested that with clever coding a 32MHz M2 *might* be up to the job ... .

But, you still could consider reverting to the simpler Sony protocol and then build a few very simple and rugged IR-transmitters / Remote controls yourself, based on a Picaxe-08M2 and the IROUT command (or even the older 08M and INFRAOUT)? Your Robot club could take this as it's own small project (keeping it cheap by limiting it to a few key buttons and/or indeed the joystick?

/Jurjen
 
Last edited:

Goeytex

Senior Member
No, unfortunately the mini's do not emit Sony codes, I wish. Their codes are in a hex format of such for example to send a code with Sony format using debug in the Picaxe editor displays say the number 92. When you press a button on the Mini Remote (MR) you get nothing at all. So I was hoping that someone knew how to either convert or interpret the codes for the Picaxe. An example of the MR press the power button you get FFA25D, press the up arrow or the + arrow you get FF02FD.
Hex is simply a way of displaying and working with a number. A hex value of FFA25D consists of 3 bytes of data In decimal terms it would be 255,162,93. So as far as the software goes it does not matter if the code is looking for $FF or DEC 255. It's the same value. Many folks prefer to work with decimals.

"If Variable = $A2" is compiled/interpreted exactly the same as "If variable = 162" .

Sony and NEC are probably the most common IR protocols. My guess is that yours is using NEC (but possibly something else like Adduino RC5?). If you can provide a link to where these remotes were purchased it would help the folks here to help you. "For Arduino" really does not mean much. It could be anything.

With remote in hand you will need 'IR receivers' that are compatible with the remote. Not all receivers are the same. Some are intended for 38Khz and other for 40Khz. Mismatching the receiver ( IR Sensor) to the transmitter (IR LED) will result in poor performance or none at all.

The bottom line is that folks need to know what protocol your new remotes use. That will get things moving along.

Goey
 
Last edited:

profcpw

New Member
Hi,
Did you think making your own remote control transmitter?

When I was teaching... students had to program the robot receiving IR codes but also the remote control. Each robot had special IR codes not to interfere with a next one. We were using the great Grove compatible AXE300 boards with Grove thumb joysticks.
You can use any chip starting with a 08M2. The sensor could be buttons, keyboard, ...
The program is using the IROUT instruction to send IR code througt the IR LED. See diagram down here.
View attachment 25591
Nice. This would be very useful. Can you send me the code?
Edited Address removed. e
 
Last edited by a moderator:

profcpw

New Member
You guys are wonderful. Yes, the format is NEC. I built up a test box with Arduino. The MR's are made in the far east and are dirt cheap they all seem to use the NEC format. I hope this paste of the data works. I found this information on Technoblogy

NEC remote control protocol
This version of the IR Remote Control Tool decodes NEC format codes, originally developed by the consumer electronics firm NEC. For a full description of this protocol see San Bergmans's excellent SB-Projects site [6].

The data is encoded using pulse distance encoding. Each bit starts with 562.5µs of carrier. A zero has a total width of 1.125ms before the start of the next bit, and a one has a total width of 2.25ms before the next bit:

IRCodes4.png


The carrier pulse consists of 21 cycles at 38kHz. The pulses usually have a mark/space ratio of 1:4, to reduce the current consumption:

IRCodes7.png


Each code sequence starts with a 9ms pulse, known as the AGC pulse. This is followed by a 4.5ms silence:

IRCodes5.png


The data then consists of 32 bits, a 16-bit address followed by a 16-bit command, shown in the order in which they are transmitted (left to right) :

Note that there needs to be one extra pulse at the end to terminate the last bit.
 

AllyCat

Senior Member
Hi,

The Forum's "Search" facility is most frustrating in that it rejects any 3-character "Words", which causes searches for sample programs concerning "NEC" , "I2C" , etc., etc. to nearly always fail. :( So you might find This Code Snippet Thread of relevance. ;)

Cheers, Alan.
 

Flenser

Senior Member
The Forum's "Search" facility is most frustrating in that it rejects any 3-character "Words", which causes searches for sample programs concerning "NEC" , "I2C" , etc., etc. to nearly always fail.
The forum posts are indexed by google so you can search for short terms on the picaxeforum site using a google search term like this:
Code:
site:picaxeforum.co.uk nec i2c
This particular search did not come up with the Code Snippet Thread link that Alan provided to but the second result was a link to the Code Snippet Forum and the text listed under the result does contain the name of the snippet thread in Alan's link:
25592
 

erco

Senior Member
Decoding NEC codes is possible but a real PITA compared to letting the Picaxe firmware auto- decode Sony SIRC codes. Lots of precious Picaxe code space & overhead required, quite likely to frustrate students. IMO it's worth paying more for a remote with Sony codes.
 
Last edited:

kfjl

Member
I agree with erco. Using anything but the native Sony protocol with a Picaxe is a bad idea.

Even if you end up using an Arduino or whatever, it would be worth testing the range of those little remotes first. Telly remotes have a range of 25 feet or more and have buttons with a better "feel".
 

erco

Senior Member
However, the tv remotes are no longer available at the 1.25 stores.
I assume you mean Dollar Tree, which now charges $1.25. You might try the 99-Cent store, I have bought several universal remotes from them for a dollar or two. The remotes can be configured to send Sony codes.


Besides simplicity, another good reason to stick with Sony codes for robot control is that the Picaxe firmware's IRIN command works simultaneously with SERVO & SERVOPOS commands. If you are using traditional continuous rotation servos (as most simple differential drive robots do), your robot can drive continuously until you send it a new IR command.

Here's a video where I'm actually sending/receiving IR codes via radio link, but as far as the Picaxe is concerned, it's an IR signal. Shows smooth driving using SERVOPOS with IRIN.

 
Top