Shop OBEX P1 Docs P2 Docs Learn Events
Volume vs Channel Remote Buttons: Difference? — Parallax Forums

Volume vs Channel Remote Buttons: Difference?

lardomlardom Posts: 1,659
edited 2014-06-27 08:29 in General Discussion
A remote control volume button increments but a channel button doesn't repeat. What's the difference?
My goal is to accelerate/decelerate, turn/straighten a 3 wheeled robot by pressing and holding channel buttons on a remote.
I'm experimenting with an object written by Bob Belleville. I'm testing my logic by controlling two LED's. The problem is I have to press a button repeatedly for changes to take place. What am I missing?
«1

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-06-13 09:11
    Have you checked the front of the remote with a camera to see if the IR LED continues to flash when the channel button is held down?

    The microcontroller in the remote probably treats the two type of buttons differently.

    I had a heck of a time when I added support for SparkFun's Nordic fob to my Mood Enhancing LEDs project. It was easy to know when the buttons hardwired to the project were being continually pressed but the Nordic fob only send a single transmission even if the button was held down. I suspect the channel buttons also one sends a short burst from your remote.
  • ercoerco Posts: 20,256
    edited 2014-06-13 09:16
    The difference could be either in the remote or in the object. Try another remote first; even the dollar store has universal remotes. You're probably using the SIRC protocol, right?

    http://www.electronics-base.com/index.php/general-description/ir-remote-control/137-sony-sirc-protocol
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-13 10:26
    Well, remote controls have different buttons that do some extremely different tasks.

    The numeric channel buttons are one-shot that sends the channel code 0-9
    The volume control buttons send a repeated code that either increases or decreases the vol.
    Another button reverts to the transmit a one shot of a previous channel by using a bit of memory.
    Another button chances a completely different data bit field so that a VCR or other alternative device, rather than the TV receives the data from the channel buttons.

    In is not a simple device.

    I just purchased a much simpler IR remote that has only 0-9 buttons and a set of 5 direction buttons.
    I am pretty sure the 0-9 is all one-shot transmission, but the direction buttons may autorepeat their code.
    This kind of device is what I have always really wanted for projects, but the darn thing doesn't declare which IR code it actually uses. I have to dig through downloads of sample programs and an Arduino library to figure that out. Ugh.
  • ercoerco Posts: 20,256
    edited 2014-06-13 14:26
    I can't find it written down on a webpage right now, but my hunch is that some keys on the remote sends out an auto-repeating string (certainly volume+/- and possibly channel+/-) and that others digits 0-9, and power) send out a short number of repeats. Should be easy enough to test with an IR receiver module and a scope (or even a Stamp, looking for 0's, active low).

    I know that many remotes shut down if you hold a key too long, like 10 or 20 seconds. Thus ended my instant el cheapo IR beacon for navigation experiment. :)
  • NWCCTVNWCCTV Posts: 3,629
    edited 2014-06-13 16:23
    Would the Basic Stamp IR test not help determine the problem? [FONT=Arial,Bold][FONT=Arial,Bold]
    RecordAndDisplayPwm.bs2

    [/FONT][/FONT]

    http://www.parallax.com/sites/default/files/downloads/70016-Web-IR-Remote-for-the-Boe-Bot-v1.1.pdf

    Starts on page 33.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-06-13 20:16
    Most of the remotes I've used will send the code sequence for non-volume buttons once, then an "empty" code (often 0000000 or something similar) to tell the receiver it's repeating. As Erco says, to save batteries when someone is sitting on the remote, most of them will stop transmitting after a few seconds of continuous pressing.

    So, it depends on the remote AND the receiver. For robotics, if you can determine the the receiver continues picking up a stream of codes when a button is depressed, you can write your code to repeat the last valid command for as long as the stream of 0000000 codes are there.

    You can always make your own remote control. Most controllers can generate SIRC and other standard codes. Parallax sells some nice (and cheap) joysticks. Use one of those to make any kind of remote you want, doing anything you want. I think Andy has a project like this on the Learn site (learn.parallax.com).
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-06-13 20:43
    If you make your own remote, a game controller is any easy way to add a joystick or two to a project. You'll need to make sure it's one of the older controllers which has a ready made object to use with it.

    My favorites are Wii Nunchucks and PlayStation 2 controllers.

    Of course this adds a whole new level of complexity to the project.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-13 21:31
    There are hundreds of IR remote devices out there with special codes and special purposes. It has always been a bit frustrating that such a handy little device gets very complicated to hack in the real world. It is best to start with a remote that uses Sony 12bit.

    The 12 bit Sony code is by far the most popular example on the internet. This is the only one that Parallax seems to provide example code for.
    http://www.hifi-remote.com/sony/

    I believe it has 7 bits to designate the button down and 5 bits to address the device that should be listening. IN the Parallax BasicStamp examples, reception of only the first 7 bits is down, there is no verification of the device target. That makes the code simpler and shorter to process.

    Other device have more bits, some have many more bits in each serial burst. And as I mentioned about, the array of features makes a big portion of the buttons useless for most simpler projects. It is easier to buy a simple, bare-bones remote.

    This is the one I like and am attempting to verify if it is indeed Sony 12bit code

    http://www.aliexpress.com/item/Hot-Selling-New-Infrared-IR-Wireless-Remote-Control-Module-Kits-For-Arduino-Wholesale/1373993649.html


    IF you don't know the code of your remote. IN Linux, LIRC project has the software and schematics of the hardware to decode anything. But it is a big diversion from just getting a remote with a known code. AND, LIRC has a data base of known remotes and their button codes.

    http://www.lirc.org/
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-14 04:35
    lardom wrote: »
    The problem is I have to press a button repeatedly for changes to take place. What am I missing?

    There are ways for the object code to ignore the repeated transmissions of the IR Remote... effectively making repeat sends into a one-shot device. That might be what you are having trouble sorting out.

    On the other hand, an LED might take a lot of input to show a noticeable change if the increments of increase and decrease are too small.

    I will take a look at IR Kit.zip and see if I can get it working with my KEYES IR Remote which seems to not be anything like a Sony 12bit.

    At least you seem to have the Propeller receiving and responding to the IR Remote control.

    I am not sure how many actual bits the KEYES remote is, the Arduino code supposedly works with the Arduino lR library and manages to hide the generic info. Arrgh.
  • lardomlardom Posts: 1,659
    edited 2014-06-14 09:57
    This forum is the absolute best...period. There is no way any one person could think of every possibility that a group of like-minded people could think of. I zipped my test code to show what I was doing. Button 8 is a toggle command because I want to use it to toggle 'forward' and 'reverse'.
    The zip shows where I was at the time I posted. I tried to replace 'press and hold' with toggle 'start and stop' but that did not work either.
    I need a clearer understanding of the SIRC protocol and I have to write small code chunks to answer really basic questions.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-14 10:10
    @Lardom
    It is correct to presume by the upbeat tone of your message that the problem is now solved?

    I am just getting into using my new KEYES IR remote with the Propeller. So I don't know what I will run into.
  • lardomlardom Posts: 1,659
    edited 2014-06-14 10:29
    Loopy Byteloose, Not yet. I'm upbeat because I had a dialogue with some of the top programmers on the planet. Finding answers to these problems are a ton of fun. Crossword puzzles don't do it for me!
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-14 22:10
    Well, I guess I need to explain more about where I am and what I am thinking.

    A. I have used universal remotes in the past with the BS2 code. In that situation, the volume+/- and channel+/- buttons are auto-repeat.

    B. I recently purchased a KEYES remote just because it doesn't have the clutter of all the extra buttons. I was hoping that it was a Sony remote and that I could get it up and running without too much fuss, but the device is supported by the Arduino world .. and they seem to go about things differently.

    C. I downloaded the Arduino code in hopes of locating the format for the remote. No luck, but a list is provided of what the Raw Codes for each key are. The procedure to determine the remote is similar to IO_kit.zip. It doesn't identify particular remotes, but instead identifies the timing of the serial by various brands.

    D. In the process of reading the Arduino code, I see that at the end of the listing a Delay(500) is inserted with a note that this blocks the Repeat function of individual keys. So that is possibly why you are not getting auto-repeat if available in the Propeller code --- a similar repeat blocking might be included and need to be removed

    E. You could verify the auto-repeat by reverting to using a BasicStamp with their IR remote examples if the device supports a Sony 12 bit code.

    F. Having confirmed the remote is working like you desire, it is obviously that the next step would be to go into the IR_kit object and figure out how to remove the code that converts to a one-shot filter.

    ++++++++++++++
    The problems here are...
    A. I am not sure what you are using for a remote and which code format you are working with. (I do need to open your .zip to see if that will tell me.
    B. I may be working with an entirely different remote format and different remote control.



    So there is a gap that can muddle up any help that I try to prove... different remote control devices, different programing languages.



    I am attaching the KEYES remote code that filters out the auto-repeat. That might give you a clue how blocking auto-repeat can be done.

    It is in C/C++ Arduino. And it depends on an IR library in Arduino. This is a cheap and available simple remote that would be wonderful to use with the Propeller, so I am trying to sort out what code it requires.


    KEYES IR Remote code.txt
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-14 22:54
    Okay.. a bit of progress. I downloaded and opened your .zip

    1. You appear to be using Sony timing.

    2. The code includes a feature called 'repeatDelay'. That is likely what is blocking your auto-repeat. You may have to reduce it to zero or a very small number.

    3. There is another feature in the Spin code that appears to modify the repeated code. This may be handy with a zero 'repeatDelay' as some auto-repeat buttons can be used as one-shot by only recognizing the first trigger, and others can recognize both the first instance and the ones that are modified. .. you just have to write the code to do so.
  • CuriousOneCuriousOne Posts: 931
    edited 2014-06-15 02:28
    Can't say for all, but I have Sanyo LCD TV, and I was looking with scope, what it's remote "says" when various keys are pressed. On volume buttons, when you press the button and keep it pressed, it repeats the same command. But when you press channel button and keep it pressed, it will issue 1st the channel change statement, and shortly after it, shorter, "repeat" statement. Why it is done in such way - I have no idea.
  • lardomlardom Posts: 1,659
    edited 2014-06-15 09:04
    Loopy byteloose, Yes, it's SONY. Reducing the RepeatDelay to 0 had no effect. I think it's because there's a lock. I was able to see the pulse train on my Parallax USB scope. The number buttons repeat which is good. I'll have to spend a few days learning how to create a driver from scratch. I can't decipher Bob Belleville's object yet.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-15 09:21
    Well, it seems that the Spin code is written to accept a Sony code of all three bit lengths. With the shorter bit length devices, the output just has a lot of FF or 00 at the end.
    If you know how many bits your remote actually is, you might shorten that reading loop to fit the exact bit count.. so it doesn't miss the next repeat.

    I found with the BasicStamp method, the repeats were actually a lot of trouble with triggering activity when one didn't want it. So I get that is why delay methods were developed.

    In theory, they should be able to be removed. You might look at some other IR remote objects in OBEX.

    I am having trouble with compiles if the IR_Kit.zip in Brad's Spin Tool and SimpleIDE. I am not exactly sure where the problem is. But I need to get something working to be of any further help to you.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-15 09:38
    CuriousOne wrote: »
    Can't say for all, but I have Sanyo LCD TV, and I was looking with scope, what it's remote "says" when various keys are pressed. On volume buttons, when you press the button and keep it pressed, it repeats the same command. But when you press channel button and keep it pressed, it will issue 1st the channel change statement, and shortly after it, shorter, "repeat" statement. Why it is done in such way - I have no idea.

    Every manufacturer created a different scheme so their remotes would not work with other brands.. that is the why. It gets to be a rather big database of remote codes. But it seems that there are really only a few patents on the actual timing and roughly four, five, or six ones that are most popular and can be easy to identify.

    Take a look at the IR_Kit.zip in OBEX and read the documents in it. The Arduino library takes a similar approach to identifying the IR remote codes. And I suspect this is how the Universal Remotes that are able to learn from your TV search for the right solution. Once the timing pattern is recognized (usually by a start timing sequence), the software actually listens for the longest possible bit patterns as the decoder just fills in the shorter bit codes with FF code or 00 code. It is pretty simple.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-16 02:09
    Progress.........
    IR_KIT.zip has been very helpful. My KEYES remote is an NEC 32bit device.

    Historically I suspect that the BasicStamp and PIC users preferred the Sony 12bit code because the actual button codes were 7 bits which fit nicely inside a byte. Of course, 32bit codes are no problem for the Propeller.

    If you use IR_KIT.zip, you really cannot avoid reading and re-reading the README.pdf several times. It has all the answers, but a lot of useful background info as well. It lives up to its name by being a good kit of tools.. all the files are useful in different situations. You certainly do not have to use the Propeller TV video to use it, but it is an option. I just used the serial port options.

    I really like the simple keyboard layout of this, the cheap price, and the IR sensor works fine with 3.3v Propeller power... so you don't have to provide 5.0v and then worry about the logic pin needing a resistor to protect the Propeller i/o. And there is a nice little 'goodie' on the IR Sensor.. an LED that blinks with serial IR is being recieved, so you know your sensor is working.
  • lardomlardom Posts: 1,659
    edited 2014-06-16 09:36
    Loopy Byteloose, It works! :lol: Ha! I was able to follow the SIRC 12-bit object written by Tom Doyle. Thank you and everyone else for your help. I'll replace the LED's with two DC motors. I'll be able to 'press and hold' to accelerate and do incremental turns, I'll use the extra buttons to toggle forward/reverse and rotate left/right.
    There must be a few beginners who would find the code useful. I'll post it when I'm done if there's any interest.
  • ercoerco Posts: 20,256
    edited 2014-06-16 10:43
    Nice to hear the excitement in your post, Laary!

    FYI, Philips' RC-5 protocol auto-repeat works differently. From http://www.sbprojects.com/knowledge/ir/rc5.php:

    As long as a key remains down the message will be repeated every 114ms. The toggle bit will retain the same logical level during all of these repeated messages. It is up to the receiver software to interpret this auto repeat feature.
  • lardomlardom Posts: 1,659
    edited 2014-06-16 23:21
    erco, In my college days I 'assumed' programming was tedium. I eventually realized I could make something made of plastic, silicon and copper obey me simply by writing a set of instructions on a screen. That thought blows me away.
    Thanks for the link you provided. It was the best explanation I'd seen to date. I followed your advice to look at the pulse stream in my USB scope. That made things a lot clearer. It made sense because I could see what was going on.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2014-06-17 10:50
    erco wrote: »
    Nice to hear the excitement in your post, Laary!

    Oh, so he's the Sit-n-Sleep guy now? "You're killing me Laaaary!"

    (Erco and any other SoCal folks here gets the joke. You can't spit without hearing a Sit-n-Sleep "....Or your mattress is freeeeeee!" commercial on the radio.)

    Anyway, Larry, would you consider posting your solution to Obex, or if it's short, here? I'm sure others would be interested. Otherwise Laary might beat you to it.:smile:
  • lardomlardom Posts: 1,659
    edited 2014-06-18 06:25
    GordonMcComb, I thought "Laary" was a typo. :smile: Feedback is important. I'll post it here first. Last night I glued wheels from a toy car to a couple of DC motors. I taped the motors to a plastic enclosure and started modifying code.
    I heard the 1KHz PWM motor noise. I have an object that runs PWM @ 20KHz in Spin but I think I read that the L293D tops out at 5KHz. (Test and repeat.)
  • lardomlardom Posts: 1,659
    edited 2014-06-26 07:40
    Big disappointment! I have a pair of 1.5V - 3V motors that cannot move the chassis. The wheels spin very fast when I lift it up but my 'taped together' prototype won't budge when I place it on a surface even if I give it a slight nudge. Can anyone recommend max 7.2V geared DC motors? I thought to myself that differential steering with IR control would be useful. I have to road-test it to find the inevitable bugs before I even think about posting the code.

    These are the button assignments:
    872 x 486 - 58K
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-26 08:13
    What are you using for an H-Bridge? And how high a voltage input to the H-bridge?

    If you are using an L293 or L298, the technology is BJT and they have an internal voltage drop that can be as high as 2.0 volts. So powering from 5 volts is barely going to deliver 3 volts. If this is your problem, you could boost the 5volts to 7 volts with a boost regulator and the motors would then get 5 volt drive. It might work, or it might burn up the motor's brushes.

    Polou has a wide selection of motors with related wheels and motor mounts. They also have MOSfet H-bridges which have a much lower voltage drop. All good stuff to get the most power from the battery to the motor.
  • lardomlardom Posts: 1,659
    edited 2014-06-26 08:39
    Loopy Byteloose, I bought a pair of the cheapest motors I could find from RadioShack. My goal was 'proof of concept', originally. I'm using an L293DNE which gets hot so I've lowered the output a bit. I have a couple of L298 IC's but they don't fit into my breadboard. The motors themselves are ungeared which seems to be a problem.
    I'll order a pair of geared motors from Polulu and re-test. Thanks for the advice.:smile:
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2014-06-26 10:17
    I am completely done with L293 and L298 H-bridges.
    Though they work, they run so hot and waste so much power that people should be shouting "obsolete".

    Geared-motors really allow the motors to run at higher RPM and that means that they provide more torque. Direct drive is certainly part of your problem, but not all of it.

    Expecting to use BJT h-bridges makes the problem worse.
    Expecting to run DC motors at low voltages heaps on more trouble.

    If you have a 7.2VDC battery pack or lower, use a boost regulator to drive your motors at 12, 18, or 24 vdc. The vast majority of DC motors will have a maximum voltage of something like 36 or 48 volts.

    You will have less losses from inside your h-bridge (a 2 volt drop in the h-bridge at 24 volts is a much smaller percentage that 2 volts at 5 volts).

    And the higher the voltage, the less losses you have from small diameter wire.
  • ercoerco Posts: 20,256
    edited 2014-06-26 13:49
    Spot on Loopy, I'm in agreement with everything you said. For those exact reasons, my first big bot (~17 lbs IIRC) used simple relays to switch power from two SLA batteries (12 and 6V). The relays provided very efficient switching between 12V low speed and 18V high speed, to keep both 24V gearmotors in sync using simple encoders. No heat lost in L298 bridges, and the bot was very accurate in dead reckoning. https://www.youtube.com/watch?v=PX0IhUqnwrk and https://www.youtube.com/watch?v=VzbKlwc4GWs
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-06-26 14:10
    There have been a couple of direct drive failures on the forum. One was at my expense. jdolecki made the same mistake.

    My review of the motor/wheel combo I tried never showed up on the MPJA website. I'm still a bit miffed at the sites claiming these would be great for a small robot.

    What sort of motor/wheel combo were you using Larry? Never mind. I see you purchased the motor at Radio Shack. It can be hard to find a good application for a motor without a gearbox.
Sign In or Register to comment.