We’re rewarding the question askers & reputations are being recalculated! Read more.

Hot answers tagged

10

It is indeed possible to generate a 56 kHz signal with an Arduino timer. A timer actually can be seen as a special register, in the MCU, that holds a value (starting at 0) that gets incremented at a frequency that is the MCU clock frequency (16 MHz on Arduino Uno), possibility divided by a factor called prescaler. When that value reaches a limit, ...


7

Every time through your loop, the LED is being set to HIGH voltage. This may or may not be followed by setting it to LOW voltage, but since the loop runs again immediately, it's immediately set back to high voltage. This happens so fast that the LED essentially "feels" half voltage and it will dim. Your code needs to be more like this... void loop() { if(...


7

It means "Micro Controller" - you know it as "Arduino".


7

Isn't the space taken up by the local variable supposed to be freed up from the SRAM once the functions runs because I have declared the variable locally? This is correct. The local arrays you have take up RAM only while the corresponding function is executing. They do not consume any static RAM (i.e. .data and .bss, what the Arduino IDE improperly ...


6

This is what I have managed to achieve ... Library IRLib - GitHub Version 1.51 March 2015 Copyright 2013-2015 by Chris Young http://tech.cyborg5.com/irlib/ This library is a major rewrite of IRemote by Ken Shirriff which was covered by GNU LESSER GENERAL PUBLIC LICENSE ... Code Modified code (from the demo IRrecord example): /* Example ...


6

The voltage will be fine - as long as you plug it into the DC barrel jack, and don't try to wire directly to the 5V pins. The barrel jack has a voltage regulator on it that will convert 7-12V down to the required 5V. But there's a second reading that you need to look at, not just voltage. The 9V adapter will also have a current rating expressed in milliamps ...


6

You should put a current-limiting resistor in series with each LED. You could then try to drive all of those LEDs from a beefy transistor, like a power MOSFET or a Darlington. Alternatively, you can use a small transistor for each LED, and then drive all of them from a PNP transistor, like this: simulate this circuit – Schematic created using ...


5

uint32_t data = 0xFFFFFFFF; Serial.println(data, BIN); data = 0xFFFFFFFF; bitClear(data, 30); Serial.println(data, BIN); data = 0xFFFFFFFF; bitClear(data, 31); Serial.println(data, BIN); On my mega outputs: 11111111111111111111111111111111 10111111111111111111111111111111 1111111111111111111111111111111 Are you sure you aren't mistaking the fact that ...


5

You must declare the array in global space or static, and make sure the function you pass the buffer pointer to knows it is in PROGMEM. void send22() { static unsigned int irSignal[] PROGMEM= {8988, 4548, 572, 1688, 572, 1688, 600, 532, 572, 568, 572, 572, 576, 572, 572, 580, 572, 1724, 544, 556, 576, 1684, 600, 1660, 608, 532, 604, 540, 608, 540, 600, ...


4

Typically, rational control of an LED sets the amount of current that goes through the LED, rather than setting its voltage. You could add series resistors so that when the desired current is flowing through the LED, about 1.2 volts is across the LED and the rest (say 3.6–3.8V) is across the resistor. (See Google images for typical circuits, and see ...


4

There are two major components to an infra-red signal. One is the high frequency carrier wave signal that pulses the LED on and off. This frequency has to match that of the receiver and is used with either a high-pass or band-pass filter to filter out ambient IR light and allow it to only react to a real signal. The second component, and it sounds like ...


4

See page 5 of your datasheet - that 'fancy' sensor suppresses "• Continuous signals at any frequency". So you'll need to pulse your 38.4kHz signal for the sensor to produce an output.


4

Increasing the power to the LED isn't the best way of increasing the distance. In fact it's the worst way. The 100mA is only for a small duty cycle. You can power it with 100mA but only for a fraction of the time. The overall average light output won't be any more than at 30mA. The problem you are actually suffering from is the fact that your receiver can'...


4

The errors are self-explanatory. You just have to read them carefully. ‘B54A3AC5’ was not declared in this scope The compiler doesn't know what "B54A3AC5" means. Nor do I, but I gess you may mean an hexadecimal 32-bit value. If that's the case, write it with the prefix "0x", as in 0xb54a3ac5. ‘redpin’ was not declared in this scope Same thing, it ...


4

The VIN pin goes to a 5V voltage regulator on the Arduino and needs at least about 7V minimum to work properly. If you want to supply 5V to an Arduino do it either on the 5V pin or via the USB connector. The VIN pin should receive 7V to 12V.


4

irsend.sendNEC(strtoul(irrequest.c_str(), NULL, 10)); did the trick with the help of Juraj. Much thanks! I only had the set 10 to 16 to get it to work. Working code: // Configuration const char* CONFIG_SSID = "mywifi"; const char* CONFIG_PSK = "wifipassword"; const int CONFIG_SERIAL = 115200; const int CONFIG_PORT = 80; const int ...


3

Using an IR library as mentioned in a previous answer is likely to be about the best approach. However, if you decide to use electronic switches to jumper across the remote's switch contacts, consider using CMOS analog switch chips for the purpose. If each button on the remote connects one contact to a common net, inexpensive chips like 74HC4051 and ...


3

If you're just running lines to the buttons, you won't need to power the remote from the arduino. You could just let it keep the internal batteries. But it would be possible to wire it up for power as well. As a learning project, you could just take it apart and see if you can access the button contacts. See if the contacts are split. If so, shorting ...


3

I've found tone() useful for generating high frequency pulses on any pin. It should be able to handle 56 KHz. (Edit: As noted by jfpoilpret, the closest you could actually get on a 16 MHz Arduino is about 55.944 KHz) The difficulty will obviously be combining it with your data signal. I don't think you could do that in software without resorting to low ...


3

Responding to TV remotes is surprisingly simple, because they typically all work on exactly the same principle, with no concept of channels or encryption. What you need is an IR receiver module, which you can buy fairly cheaply from many electronics suppliers. Anything intended to work with remote controls should be suitable. The important part is that it ...


3

The most common (not sure what others are used) carrier frequency is 38khz. You need an IR receiver tuned to that frequency to get the signal from the remove. See this page for way more information. There is no encryption or special receivers needed as long as the carrier frequencies match. That's really all the hardware you need. On the software side of ...


3

Looking further here http://forum.arduino.cc/index.php/topic,188236.0.h... I found the following "Removing the files - libraries\RobotIRremote\IRremoteTools.cpp and libraries\RobotIRremote\IRremoteTools.h solved the problem. They are example files which somehow are getting included. You can move those two files to some other location as backup." I ...


3

The exact duration of the pulses don't matter much. In your example, you see that in all three recorded samples that's about 14000 (about 9400); about 1200 (about 600); about 1200 (about 600) etc. What matters is that nowhere you have pulses of about 900 : in other words if the receiver detects a 672 pulse it will know that it's definitely a 600, not a ...


3

While you are doing a delay() you can't be doing anything else - that includes looking to see if the beam has been broken by the ball. You must not use delay() in your sketch, instead use millis() as in the BlinkWithoutDelay example sketch in the IDE's File -> Examples menu. Also how you are dealing with your IR system is incorrect. You are first ...


3

So according to your comments this should be the code if no mistake was made #include <IRremote.h> #define irPin 8 IRrecv irrecv(irPin); decode_results results; const int buttonPin = 2; const int relay1 = 13; const int relay2 = 12; int relay1State = 0; int relay2State = 0; int masterState = 0; int buttonState; int lastButtonState; long ...


3

Apparently you should be calling irrecv.enableIRIn() after sending, not irrecv.resume(). Sorry for suggesting the wrong thing on IRC before :-)


3

The answer I've accepted is the correct answer, but I wanted to add this extra bit for completeness. I reworked my code to use non-blocking delays for the IR LED so the sensor actually gets a chance to see it before it stops transmitting and it works! Range is quite a bit shorter than the 'lucky dip' sensor (~ 2cm). #define IR_LED 8 #define LED 13 #define ...


3

I'm unable to provide a complete answer yet but my research so far into a similar quest to use a similar remote can at least answer why you are getting two values for the same button on the remote. This is by design: the Nokia-32 RCMM protocol of this remote uses toggling codes that flip between one value and another on alternating presses of the same button....


3

Yes, it is possible. That is already supported by the IR library. Please see this tutorial for further details. The outline of the sender is: uint16_t sample = analogRead(A0); irsend.sendSony(sample, 16); And the receiver: if (irrecv.decode(&decodedSignal)) { uint16_t sample = decodedSignal.value; ... } Cheers!


3

Not sure why commenting out those two lines makes a difference. I think we need to see a schematic to resolve this. However... You do not use "pinMode" to setup an analog input! Look at the examples on the "analogRead" page. Notice there is no setup needed for the analog pin. Just call "analogRead" like you are doing and everything should be fine.


Only top voted, non community-wiki answers of a minimum length are eligible