-
Assembly and first tests
03/06/2020 at 20:41 • 0 commentsCurrent consumption
- Sleep mode : 0.7µA
- Active mode (while pushing a button) : 43.3mA
First assembly
The cutouts in the front panel have been made by "mouse-byte" drilling and filing. Milling would have yielded a cleaner result, but this is acceptable to me.
-
Front panel
01/13/2020 at 19:52 • 0 commentsSelf adhesive print
This can easily ordered by online photo print services. Probably such a label will start to loosen by the edges. It might get dirty. It would still require for the housing to be milled.
PCB Front panel
Front panel can be drilled, filed until the PCB fits. It doesn't have to be a perfect job. It will be covered anyway by the PCB front panel. The labeling can be done in silkscreen. Silkscreen is a high quality print, it will not wear or tear off.
First job, convert the dwg design files to dxf using cloudconvert. Then clean up and scale the front panel in Librecad. Then it can be imported in EasyEDA.
Front panel design The final front panel will be ordered in yellow soldermask. It will be ordered after Chinese New Year because now they charge me $43 if I don't want green soldermask.
-
Schematics
05/06/2019 at 19:46 • 0 commentsFirst draft version
Issues:
- No switch for reprogramming
No LED to show user that programming succeeded.The laser diode can be used to that purpose.- Risk of latchup through switches. They immediately pull up the GPIO, while the boost converter has yet to start.
- SPI lines should remain free for maybe future addons.
First prototype
Issues:
- R18 must be increased, because the unpowered GPIOs have a too high impedance. 33K as a replacement for R18 seems to work fine.
- R9 is needed to enable Q4 on startup. The problem is that it prevents the circuitry from powering down.
Measurements
- Total current consumption in power down mode (EN=low) : 700nA
Revision 1 : as patched on R0 PCB
The previous designs had problems with reliable startup. Either the unit didn't boot or it couldn't be turned off. This R1.0 design fixes those issues.
To startup, R10 must be pulled down. This happens when a user presses one of the switches. The schottky diodes conduct and R10 gets pulled down through R11.
Once booted, the firmware will pull up R3. Q4 starts to conduct and the button could be released.The firmware still needs to read what button has been pressed. On the side of the MCU, internal pullups will be used. The low impedance path from the switches to GND (through R11) must be disabled. So D4 will be pulled up. From then on, the MCU can read the state of each switch.
Once the switches are released, the device will be turned off by pulling R3 low. The device will not immediately turn on again, because there's no low impedance path from R10 to GND. R3 has no pullup to 3V3, so there's no way it would be pulled up after the MCU switched off.
-
IR measurements
02/17/2019 at 11:29 • 0 commentsThe remote control combines functionality for the set top box and for the TV.
Set Top Box : 36kHz
- Numerical buttons (for selecting channels) : 1, 3, 7
- 1 button : green : subtitles on/off
Reverse engineering CISCO IR Protocol
The output of the TSOP1736 receiver had quite some jitter on it, so I measured the pulses directly on the IR-diode of the remote control.
Later I compared the output of the IR-diode to the output of the TSOP1736 receiver. The receiver simply acts too slow. It needs at least 10 pulses per burst, while RCMM only sends six.
Capture showing why the TSOP1736 is useless for decoding RCMM. The TSOP94336 does a better job in decoding RCMM. Data pulses are sent out at a rate of 36kHz. That corresponds to a pulse period of 27.5µs.
Capturing the signals has been done using a Saleae Logic Analyzer.
The CISCO ISB6030 set top box uses pulse distance coding. The protocol is very similar to the Philips RCMM protocol. The 32-bit version is also called Nokia32.
Header
- 16 pulses : 16 x 27.5µs = 441µs
- 10 pulses pause : 10 x 27.5µs = 275µs
Data pulses
Always 6 pulses, followed by a predefined pause length. The data is encoded in the pause lengths. We notice that there are four different pause lengths used. So we can assume that each length encodes two bits. The bit encoding found on SB-projects is added here as a reference.
- 10 pulses pause : 10 x 27.5µs = 275µs --> 00
- 16 pulses pause : 16 x 27.5µs = 440µs --> 01
- 22 pulses pause : 22 x 27.5µs = 605µs --> 10
- 28 pulses pause : 28 x 27.5µs = 770µs --> 11
Packet
A packet is comprised of a header, followed by 17 pulse trains. So 32 bits are being encoded. The 17th pulse train is only there to show the pause length after the 16th pulse train.
Capture of a single packet showing the header followed by 17 pulse trains Following keys have been decoded:
- key subtitles on/off : 0x22C0263C
- key 1 : 0x22C02601
- key 3 : 0x22C02603
- key 7 : 0x22C02607
The last 20 bits of the measured codes of the numerical keys correspond to data published here.
Generating RCMM
[Rafi Khan's] IR-remote library served as a starting point. The RCMM protocol has been added. This library implements timings using delays. For a slow 8MHz controller, this leads to noticeable jitter on the timing of data bursts. The receiver doesn't always react to the packets.
The solution is to use the Timer2 COMPB interrupt instead. It required some rework of the IR library, but the work pays off. The generated pulse timing shows less error than the original one.
Using Arduino Pro Mini 3V3 to generate the sequence. Remark the active high signal polarity. When pin 3 of the Arduino is high, the IR LED must be on.
Double key press avoidance
The packet lasts about 10ms. Every 100ms, the packet is repeated. On the standard remote the packet is repeated as long as the button is pressed.
If more than 4 packets are sent, which equates to holding the button down longer than 0.3s, the receiver will interpret this as a double button press.
Older people don't tend to be that fast, so on our remote only 4 packets will be sent out when a key is pressed. If you keep holding the button down, after 2.5s the four packet sequence will be repeated. The 2.5s delay is needed to avoid that the receiver interprets this prolonged button press as a double button press.
When you intentionally want a double button press, lift your finger and press again. Lifting your finger from the button will disable the 2.5s delay.Samsung TV : 38kHz
- TV on/off (decoder remains always on)
- 2 buttons : volume up/down
Samsung IR protocol
As expected, the TSOP94336 also performs well in decoding the Samsung protocol. The packet lasts about 60ms. Every 100ms, the packet is repeated as long as the button is pressed.More info about this protocol can be found here.
Decoding needed buttons
Connecting TSOP1736 to Arduino Pro Mini. Loading "IRrecvDumpV2" from the examples directory.
- key TV on/off : 0xE0E040BF
- key volume up : 0xE0E0E01F
- key volume down : 0xE0E0D02F
Double key press avoidance
This is not much of an issue for controlling the on/off of a TV-set. It takes several seconds for the TV to turn on. Turning the TV off also takes a while. Sending a sequence of four packets seems to do well.
Sending a sequence of 10 packets (pushing the button for more than a second) equally works well. There are no false turn on/off sequences.
Controlling the volume buttons causes no unwanted "double press" issue. These button controls are designed to control the volume of the TV-set in a more or less continuous way. Sending 9 packets at a 10Hz rate causes the volume to drop 5 steps. Sending 9 packets at a 5Hz rate causes the volume to drop 9 steps. It might seem counter intuitive, but decreasing packet rate increases the volume change rate.
Let's stick to the 10Hz packet rate for volume control. The 5Hz rate will adjust the sound volume too fast for older people.
-
Infrared hardware
12/07/2018 at 11:29 • 0 commentsIR Transmitter
Requirements
- powerful
- wide opening angle
- common package
- good availability
IrDA modules look interesting at first sight because they also include a receiver. They're expensive however. At least €4/pce. They also transmit on a shorter wavelength.
Selected part : Lumex OED-EL-1L2
- Viewing angle : +/- 30°
- Radiant intensity : 60mW/sr @ 50mA
- Wavelength : 940nm
- Max continuous current : 100mA
- Max peak current (1% duty cycle, <100µs) : 1A
- Max forward voltage : 1.6V
- Alternative part number : Everlight IR7393C
- Digikey 67-1001-ND
IR Receiver
The remote of the set top box uses the RCMM protocol. This protocol uses very short data bursts, many receivers can't cope with that. Vishay, which has the most extensive range of IR receivers allows to filter your search by IR-protocol.
- TSOP94336 : advised IR receiver by Vishay for RCMM.
- Supply voltage: 2.0 V to 3.6 V
-
Firmware
12/02/2018 at 16:31 • 0 commentsBoot loader
In most cases a serial boot loader is used to upload code to the Arduino. Using a boot loader has the disadvantage that it takes about a second after power up before the application starts. In case of the remote, it means you would have to push at least one second for the button to be recognized. This is undesirable.
The solution is simple: upload code to the Arduino using a programmer, such as the AVRISPmkII. That's it. In PlatformIO, this means you have to select "Upload using programmer" instead of the common "Upload" button.
Once you've done that, you've broken the boot loader. So you'll no longer be able to upload code using the USB-UART cable. If you want to restore the boot loader, connect the AVRISPmkII, open Arduino, select the correct board and do "burn bootloader".
Similar projects
Self-learning TV Remote for the elderly
There's something interesting in every project, no matter how amateurish it may look.
IR library
- IRMP : support for STM32
- Arduino-IRremote : most popular
-
Button selection
12/01/2018 at 15:32 • 0 commentsRequirement
- Durable
- Big enough but not too big that there's no more room for button caption.
- Withstand excessive force
Selection
30mm arcade buttons- Drawing
- Switches are too big to fit at least 7 of them on a panel.
Cherry MX keyboard switches
- Designed to last, >50 million operations.
Cheap & multi sourced :
- Official sources:
- E-switch KS1100OA1AF060
- Cherry MX1A-11NW
- AliExpress: you never know what you'll get. Probably all of these switches will be very noisy. The advantage is the translucent top of the switch. It allows to use SMD LEDs, but these should actually be avoided due to excessive stray light.
- Digikey: only for T-1 3mm LEDs. Be sure to order LEDs with a height lower than 4.7mm and an LED flange with a diameter of 3.2mm or less:
- 4 High Efficiency red 3mm through hole LEDs
- OVLBR4C7 too long
- WP710A10SEC/J3
- 151033RS03000 too long and too big
- XLM2ACR11W
- Official sources:
- Requires key caps
- 104 Keys Transparent ABS Blank Keycaps : €6.43 + €3.71 shipping (might be useful for other projects)
- 104 Keys Printed variety of options <€10
- MaxKeyboard & WASD Keyboards offers keys in different colors. This might be the cheapest if different colors are desired.
-
Housing selection
12/01/2018 at 14:45 • 0 commentsRequirements
- Easily found when misplaced
- Big enough to hold easily but not too big that it's cumbersome
- Should have a battery compartment so that unskilled personnel can replace batteries without having to open up the housing
- Room enough for the necessary buttons
- Nice looking housing, attractive appearance
Selection
Hammon Manufacturing offers a wide range of suitable housings in their 1553 series. Chinese copies are available from SZOMK: AK-H-30 series.
Selecting color
- Gray/black : dull, hard to find when misplaced
- Red : red color relates to danger or things that are hot. Preserve this color for objects that are dangerous/hot.
- Translucent blue : useful for white or blue LEDs on the PCB. No need to drill extra holes in the housing.
- Yellow : perfect color
Selecting size
There are two options for a yellow case with a battery compartment:
- 1553BYLBKBAT: 117 x 79 x 24 mm : €7.72
- 1553DYLBKBAT: 147 x 89 x 25 mm : €8.24 : will leave more room for buttons
Accessoires
ABS blocks NIR. Hammond Mfg. provides a PC (polycarbonate) window : 1553DIR-BULK. This part can't be bought from the usual online resellers. It might be better to find a piece of PC with the correct thickness and laser it. Another option is to keep the current ABS panel and drill a hole for the LED in it.
Battery compartment
Room for two AA-cells, or one PP3 9V battery. Two AA-cells will be used here because they offer the highest energy per dollar.
Conclusion
1553DYLBKBAT : IP54 Handheld Enclosure, ABS, Yellow, 147 x 89 x 24mm
- Easily found when misplaced