In our previous post we showed how to generate stable IR carrier signals using the ESP8266 NodeMCU module. A feature of the original approach was that the output IR signal was inverted and required some additional circuitry to invert it again before transmission. Since the original post we have figured out a method to output a non-inverted or standard IR signal thus removing the need for the additional circuitry. This is achieved by using what turned out to be a very simple setting hidden deep in the ESP8266 UART registers which is covered below. Like all simple solutions it also threw up some other quirks of the ESP8266 NodeMCU, which were eventually overcome with the addition of a simple resistor. The Updated ESP8266 NodeMCU Backdoor uPWM Hack for IR signals is detailed below – including updated source firmware, new circuit diagram and explanation of the ‘quirk’. Read on….
We received our ESP8266 NodeMCU several months ago it has been difficult to find a working example of Hardware PWM to generate crisp Infrared carrier signals. Most posts we have read suggest that there is no PWM readily available on any of the supported platforms. As we have already shown with Arduinos and the Particle Photon we figured it would be possible to use a spare UART pin on the ESP8266 NodeMCU to achieve our goal. After some initial success we encountered some watchdog timeouts/resets and it seemed like the uPWM hack would not be possible on the ESP8266 Node MCU platform. For a few weeks we ‘parked’ the effort and today we decided to try again with all of the latest and updated firmware available from the ESP8266 community via the Arduino IDE. This time we were successful and the ESP8266 NodeMCU Backdoor uPWM Hack for IR signals using works!
Since we received our Photon several months ago it has been difficult to find a working example of Hardware PWM on the Photon. Initially, we ported our softPWM approach to the Photon, which is excellent. However, we figured it must be possible to use at least one of the spare UARTs on the Photon to achieve our goal. So first we started prototyping on the Arduino and quickly got a working example with some limitations – only 40 kHz and 33 kHz carrier frequencies were possible with the UART without delving into the registers a bit more. Then we moved the code over to the Photon, leveraging our previous softPWM examples, upgraded with the Arduino code – EUREKA! The Backdoor uPWM Hack on Photon for Infrared signals.
In Part 1 of this series, we demonstrated how to send signals using soft or Simple Infrared PWM on Arduino. In our Part 2 post we looked at sending RAW IR signals – specifically a RAW NEC signal and a longer RAW Mitsubishi Air Conditioner signal using soft PWM. We have since improved the PWM method shown in Part 1 Part 2 to provide better performance and improve portability. In this Part 3, we will take the signals from Part 2 and show how to send them using their binary (or Hex) representation, which can save lots of SRAM in many projects, particularly when dealing with longer AC signals.
In Part 1 of this series, we demonstrated how to send signals using simple Infrared PWM on Arduino. In this Part 2 post we look at sending RAW IR signals – specifically a RAW NEC signal and a longer RAW Mitsubishi Air Conditioner signal. We have also improved the method shown in Part 1 due to some issues we identified when sending ‘real’ signals versus the ‘test’ signal we used before. (More on that later). In Part 3, we will take the signals from this post and show how to send them using their binary (or Hex) representation, which saves lots of SRAM.
Over the last few months we have been regular contributors to the Arduino and other forums, answering questions about Infrared remote control projects. It became apparent that beginners typically trip up on many common ‘pitfalls’. So we decided to list off our ‘Top 10’.
Dublin, Ireland – 31st January 2014. We are happy to announce the latest ‘New Year’ release of AnalysIR to all our backers & supporters. Since the completion of the crowd-funding campaign on Indiegogo we have added over 125 updates and enhancements to AnalysIR, with more to come.
A major highlight of this release is full AnalysIR support for USB IR Toy from Dangerous Prototypes (V1 & V2 hardware) for decoding and resending IR signals at all common modulation frequencies. In our opinion, AnalysIR is now the premier GUI supporting DP’s IR toy, not to mention the Arduino, RPi, MSP430 F5529 LaunchPad (beta) and more. A selection of enhancements in this latest release, include: Continue reading Latest ‘New Year’ release of AnalysIR with full support for USB IR Toy and more.
For anyone following the progress of our ‘Custom TV Infrared remote control’ for the SKY+ box, we received it back for some upgrading over the last week and tomorrow (weather permitting – there are lots of high winds in Europe today, with many flights being cancelled) it will be flown back to its owner, with several upgrades on board.
We have now reached 100 unique backers for AnalysIR and we would like to thank you all for your generous support & welcome our latest backers. In particular, we would like to give a special thanks to those who made donations without perks.
And now for the News:
- The components for the Starter Kits have arrived as expected; the envelopes are already printed with addresses taken from IGG & we plan to drop them off at the Post Office sometime on Monday. Hopefully, most people will have received them before AnalysIR is released to backers (circa: 9th September, which allows1 week after the campaign ends to eliminate as many glitches as possible). Remember, to get the full use of AnalysIR you will need the components in Kit A, as a minimum. However, just having an IR receiver is sufficient.(+ of course an Arduino).
So far, everyone has chosen ‘Kit F’, which is probably a good idea.
- Regarding the Raspberry Pi ‘stretch goal’, it looks like we may not reach this goal, based on the current trajectory. However, we decided to purchase a Pi with the IGG (aka your) funds released to date & it arrived yesterday. After a lot of ‘wasted’ time trying to get it set up without a display we eventually succeeded. So today we had a go at porting our Arduino code over to the RPi. For the initial attempt, we have decided to use the WiringPi library & we have good success so far. So here is an exported trace image of the first successful NEC IR signal decoded by AnalysIR from a Raspberry Pi.
On the top you can see the same IR signal recorded directly by AnalysIR at the same time (via 2 different IR receivers – one connected to an Arduino & the other connected to an RPi pin)
- We haven’t fully finished with the RPi coding yet & there are some minor glitches, but we are happy with it as a first attempt. At the moment we are using interrupts & are only dumping the information to a terminal screen via a network connection & then manually pasting the output into AnalysIR’s import facility. We have to do some further study to see how we can best get ‘serial’ data from the RPi to the Windows PC. The simple solution is to use a USB serial adapter connected to the Rx/Tx pins of the RPi, but given it already has an Ethernet port we are going to investigate if a more elegant solution is feasible.
That’s all for now……… Next week = Documentation update
Today we tested out the new export feature with one of our backers who had lost a remote control for a cool RGB light, but had previously recorded the NEC (extended) codes using IRremote. As a first test of the new export facility, we were able to read the NEC codes into AnalysIR & then export them into Pronto format because our backer had a smart-phone app & IR blaster that only takes Pronto codes as input.
Getting the codes into AnalysIR was easy, because we happened to have a similar remote in our collection, which had many of the same codes. Otherwise we would have used an Arduino IR library to generate the IR signal for AnalysIR.
What was really impressive is that this all worked first time. Happy us & happy Backers.
We hope to do similar tests with all the other export formats this week, including Global- Cache commands.
Finally, a big welcome & thanks to all our new backers!