Search the Community

Showing results for tags 'IR'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Found 10 results

  1. This project is an offshoot of an earlier investigation of wireless wearables using the MSP430G2553: http://forum.43oh.com/topic/10060-msp430-wearable-with-radio/. The concept has been successfully tested and is described below. I plan regular updates as the project progresses. The objective is to develop a wearable powered by a coin cell that can be controlled remotely. It could be used, as an example, in the tiara below or on a costume worn by dancers in a performance and controlled from offstage. In the photo an earlier MSP430G2553 coin cell powered wearable is attached to the tiara and driving 3 WS2812 LEDs. The constraints are: cost - unit cost for the receiver of $10 or less technology - common off the shelf components, MSP430G2553 construction - standard double sided PCB spec, keep SMD parts large enough to be hand soldered power - CR2032 (rated 3V and 225 mAH) life - needs to run at least half an hour on fresh batteries reception - 10m with clear line of sight, update at least every 100 ms transmission - desirable but not required size - 40mm/1.6" diameter for receiver programming - Energia desirable schedule - 6 month completion The transmitter will probably be placed on a "Booster Pack" for a LaunchPad running Energia. Multiple LEDs will be driven to gain extra distance, and if required multiple transmitters could be set up from different angles to assure good reception. A display would be helpful as on the FR6989 shown below with an IR LED. The initial Energia transmission sketch to test the concept is located here: https://github.com/fmilburn3/Infrared/blob/master/IR_sendByte.ino. The sketch was developed in Energia V17 using a MSP430G2553 LaunchPad and a 940 nm infrared LED. It loops from 0 to 255 and sends a single byte with the count via infrared to the receiver when a button is pushed. The packets for sending bytes do not follow an existing protocol. It is specific to this application and developed with the goal of getting a byte transmitted at least every 100 ms. The receiver will be a custom MSP430G2553 board powered by a coin cell with a TSOP38238 IR receiver. There will LEDs on the PCB and it will also have the capability to drive LEDs off board. The preliminary receiver code was written in C using CCS and direct register access: https://github.com/fmilburn3/Infrared/blob/master/IR_Receiver/main.c . The framework for the code is based on a post by RobG here on 43oh. The receiver takes transmissions from the Energia sketch linked above and outputs the current byte on eight LEDs in binary form. When the last byte is received it clears the LEDs and outputs the number of bytes received in error out of the expected 255. This allows analysis of reception at different distances and conditions. Shown below is the preliminary testing setup. In the foreground is the G2553 receiver with a TSOP38238 and output LEDs on a breadboard. Middle ground is a G2553 with the infrared LED sending bytes. Background is output from the receiver being monitored on an oscilloscope. The output of the TSOP38238 is quite clean and no errors were seen with the transmitter and receiver this close together. Transmission is at approximately 1000 bytes per minute or 16+ bytes/sec which is within the desired range. I subsequently modified the test setup to run off batteries so I could do some preliminary distance testing. With clear line of sight reception I saw no errors up to 5 meters with one transmission LED aimed directly at the receiver. Errors crept in after that, especially if the transmission is off to one side, not pointed directly at the receiver, or at a greater distance. Near term activities: increase the number of transmission LEDs evaluate the impact of off-center transmission further test in an environment that doesn't have reflective surfaces add WS2812 driver capability and investigating the impact of TSOP38238 interrupts on the WS2812 driver evaluate 2032 battery life further
  2. Hi, I'm trying to read analog values from a SHARP IR sensor GP2Y0A41SK0F using the MSP430F5529 launchpad. There was not any error when I verified and uploaded the codes in Energia. However, when I clicked on the Serial Monitor, nothing showed up. But when I chose the MSP430G2452 from the "Tools" menu, the monitor successfully showed the analog values. I connect Vcc (red wire) to 5 V pin, the ground (black wire) to GND pin, and the analog output (white wire) to P6.4 pin/A4 pin. The same thing also happened to the MSP430G2553 launchpad. It only works when MSP430G2452 is selected. I looked at the codes very thoroughly but I couldn't see any mistakes: const int IR = A4; void setup() { Serial.begin(9600); } void loop() { int maxVal = 0, minVal = 1024, n=200; float x_i, total=0, mean; for (int i=1; i <= n; i++) { x_i = analogRead(IR); total += x_i; Serial.println(x_i); if (x_i < minVal) { minVal = x_i; } if (x_i > maxVal) { maxVal = x_i; } } mean = total / n; Serial.print("minimum = "); Serial.print(minVal); Serial.print(", maximum = "); Serial.print(maxVal); Serial.print(", total = "); Serial.print(total); Serial.print(", mean = "); Serial.println(mean); delay(100); }
  3. Hello, I needed a large 3 digit display with remote control. All available didn't fit my needs, were quite expensive or not flexible enough. So I decided to create my own inspired by products I found. IR remote control looked simple and cheap enough, Seeedstudio sells some nice large 7 segment LED displays and prototype PCB manufacture in China doesn't cost much. First I LaunchPad prototyped the design with 8 channel serial LED driver, like SCT2168, and generic 3 pin IR receiver. I implemented NEC IR protocol with TimerA and bit banged serial display data output. All worked nicely so I ordered 5" 7 segment LED digits from Seedstudio. I highly recommend to order one extra digit. From my batch 2 horizontal segments had visibly couple LEDs busted. Also provided datasheet doesn't match what I received. Instead of 2x6 mine are 3x7 LEDs per segment. I tore one apart to see what's inside. Dot segment doesn't even have a polarity mark and only one seemed to work, but I didn't plan to use them anyway. I designed 2 boards, one large for individual segments of 5" digit, MCU and voltage regulator and small one for various sizes of common anode LED displays. I can extend the display by daisy chaining digits or run multiple displays in parallel depending on which side I connect next digit. MCU and power supply part is placed only on 1st digit. Currently I have ordered 2.3" digits from ebay for secondary display. Boards were made by Elecrow, I fit 1 large and 2 small designs on one 10x10 PCB. Code runs on small MSP430G2 MCU and only 4 pins are needed, board is designed for MSP430G2210 SO-8 package but with little leg bending and pin reassignment TSSOP-14 may be used. I use small remote I got with DVB-T tuner I use for SDR. It has just few buttons and fairly large labels. Current code implements 4 memory slots to switch between numbers. Everything is placed in plastic box covered by gray acrylic. Code: main.ctools.htools.c Eagle files: large.schlarge.brdsmall.schsmall.brd
  4. Hello, I am very frustrated am i'm still on the project to decode the IR remote of my toy Heli. Unfortunately I'm stuck and I need your help in the conversion of the code below. Thanks for this great article! http://trandi.wordpress.com/2010/06/19/ir-remote-syma-s026-dedicated-board-v2/ Sending the Data through serial is a secondary problem, it 's more important for me how to decode the IR Signals //#define F_CPU 8000000UL #include <avr/io.h> #include <avr/interrupt.h> #define LED_PIN PB0 2 #define SERIAL_PIN PB3 4 #define IR_PIN PB4 11 //tsop31238 DataPin #define PORT PORTB #define DDRD DRB #define PIN PINB #define TIMER_COUNT TCNT0 // How does it work with the MSP? // SERIAL SIGNALS #define BYTE_SIZE = 8 const unsigned long T0 = 500; // in microseconds const unsigned long T1 = T0 * 3; const unsigned long START = T0 * 8; const unsigned long BETWEEN_BITS = T0; // IR SIGNALS #define SIGNAL_SIZE 26 // MAX is 29 #define SIGNAL_SPEED 7//from 0 to here #define SIGNAL_DIR 13//from end of SignalSpeed to here #define SIGNAL_BUTTONS 17//from end of SignalDir to here #define SIGNAL_VERTICAL 21//from end of SignalButtons to here #define SIGNAL_TRIMMER 26//from end of SignalVertical to here #define PULSE_START_MIN 1500 // in Micro Seconds #define PULSE_START_MAX 2000 #define PULSE_0_MIN 300 #define PULSE_0_MAX 750 #define PULSE_1_MIN 750 #define PULSE_1_MAX 1200 #define VALUE_LEFT_BUTTON 22 #define VALUE_RIGHT_BUTTON 26 void ledON(){ PORT |= _BV(LED_PIN); // turn on the LED } void ledOFF(){ PORT &= ~_BV(LED_PIN); // turn off the LED } /* TIMING STUFF */ // How do i set up the correct TimerA0/A1 for MSP430G2533? void timerConf(){ TCCR0A = 0x00; TCCR0B = 1 << CS01; // prescaler 8. IF F_CPU is 8MHz then counting directly in uSecs TIMSK = 1 << TOIE0; //Overflow Interrupt Enabled //Enable Global Interrupts sei(); } // don't forget the VOLATILE, otherwise it will be seen as 0 from the outside !!! volatile unsigned long _timerOverflow; ISR(TIMER0_OVF_vect){ _timerOverflow++; } void resetTimer(){ TIMER_COUNT = 0; // How to reset Timer on MSP430?? _timerOverflow = 0; } unsigned long getTimer(){ return _timerOverflow * 256 + TIMER_COUNT; } void delay_us(unsigned long microSecs){ resetTimer(); while(getTimer() < microSecs) {}; } /* TIMING STUFF - END */ void serialSendStart(){ PORT |= _BV(SERIAL_PIN); // high delay_us(START); PORT &= ~_BV(SERIAL_PIN); // low delay_us(BETWEEN_BITS); } void serialSendBits(unsigned char data){ for(unsigned char i = 0; i < 8; i++){ PORT |= _BV(SERIAL_PIN); // high // _BV(xxx) same as: (1 << SERIAL_PIN)) if(data & 0x01) delay_us(T1); else delay_us(T0); PORT &= ~_BV(SERIAL_PIN); // low delay_us(BETWEEN_BITS); data >>= 1; // get the next most significant bit } } unsigned char irState(){ return PIN & _BV(IR_PIN); // get the value of the IR PIN, 0 or 1 } static unsigned char getBit(int pulse){ if(pulse > PULSE_0_MIN && pulse < PULSE_0_MAX) return 0; if(pulse > PULSE_1_MIN && pulse < PULSE_1_MAX) return 1; return 111; // BAAAD } unsigned long _currTimer; int getIRLowPulse(unsigned int timeoutMicroSecs){ resetTimer(); // wait until it gets LOW or timesout _currTimer = getTimer(); while(irState() && _currTimer < timeoutMicroSecs) { _currTimer = getTimer(); } // time out if(_currTimer >= timeoutMicroSecs) return -1; // start conting the pulse resetTimer(); _currTimer = getTimer(); while(! irState() && _currTimer < timeoutMicroSecs) { _currTimer = getTimer(); } // pulse too long if(_currTimer >= timeoutMicroSecs) return -2; return _currTimer; } int _pulseCount = -1; unsigned char _bit = 0; unsigned char _bits[SIGNAL_SIZE]; int _pulse; unsigned char i = 0; unsigned char _speed, _dir, _buttons, _vertical, _trimmer; unsigned char _speedPrev, _dirPrev, _buttonsPrev, _verticalPrev, _trimmerPrev; void send(){ ledON(); _speed = 0; _dir = 0; _buttons = 0; _vertical = 0; _trimmer = 0; for(i=0; i<SIGNAL_SIZE; i++){ if (_bits[i] == 1){ if (i < SIGNAL_SPEED) _speed += (1 << (SIGNAL_SPEED - i)); else if (i < SIGNAL_DIR) _dir += (1 << (SIGNAL_DIR - i)); else if (i < SIGNAL_BUTTONS) _buttons += (1 << (SIGNAL_BUTTONS - i)); else if (i < SIGNAL_VERTICAL) _vertical += (1 << (SIGNAL_VERTICAL - i)); else if (i < SIGNAL_TRIMMER) _trimmer += (1 << (SIGNAL_TRIMMER - i)); } } if(_buttons == VALUE_LEFT_BUTTON) _buttons = 1; else if (_buttons == VALUE_RIGHT_BUTTON) _buttons = 2; else _buttons = 0; if(_speed != _speedPrev || _dir != _dirPrev || _buttons != _buttonsPrev || _vertical != _verticalPrev || _trimmer != _trimmerPrev){ _speedPrev = _speed; _dirPrev = _dir; _buttonsPrev = _buttons; _verticalPrev = _vertical; _trimmerPrev = _trimmer; serialSendStart(); serialSendBits(_speed); serialSendBits(_dir); serialSendBits(_vertical); serialSendBits(_trimmer); serialSendBits(_buttons); } ledOFF(); } void init(){ timerConf(); // make both LED and SERIAL pins outputs DDR |= _BV(LED_PIN) | _BV(SERIAL_PIN); // IR_LED is an input DDR &= ~_BV(IR_PIN); // SERIAL PORT start LOW PORT &= ~_BV(SERIAL_PIN); } int main(void){ init(); while(1){ _pulse = getIRLowPulse(10000); if (_pulse > PULSE_START_MIN && _pulse < PULSE_START_MAX){ //start counting pulses _pulseCount = 0; }else if (_pulseCount >= 0){ //continue counting pulses _bit = getBit(_pulse); // if invalid bit, stop here if(_bit > 1){ _pulseCount = -1; }else{ _bits[_pulseCount] = _bit; // good, wait for next bit _pulseCount++; // FINAL, we've read what we wanted let our caller know ! if (_pulseCount == SIGNAL_SIZE) { send(); // end of this command, so reInit so that we wait for another start _pulseCount = -1; } } } } return 0; }
  5. G’day, Looking for Energia IR code for the stellaris. Got the following 430 code http://www.jerrypommer.com/msp430_ir_command_decoder/ to Energia complie but not proficient in C to convert it to run on Stellaris Did a bit of searching and found the following http://forum.stellarisiti.com/topic/515-ir-remote-control-demo-project-for-the-stellaris-launchpad/ but it uses CSS So does anyone have some Energia code that will let me turn on/off a few Stellaris driven leds with a IR TV controller. Grant
  6. I follow your forum for a while now. I’m starting digital artist working on IR project at the moment. I was hoping you could advice me a bit as you are expert for Beagle Bone. I have design music application in Unity 3D. It reacts to 24 different keyboard inputs. Now I was hoping to be able to control it remotely. I was trying to make I arts installation that would use remote controllers sending signals to receivers connected to different GPIOS on the Beagle Bone. Receiver would get binary IR signal and send it to Beagle Bone GPIO. Beagle Bone would change it to key input and send it to main Computer as key input. I’m really confused where to start. I have basic understanding in Java, C Sharp or Java Script but I’m hitting the wall here with programming it. I’m using: - high sensitivity recivers: http://dx.com/p/high-sensitivity-ir-receiver-photosensitive-diode-light-sensor-for-arduino-152264 - beagle bone - Linux Ubuntu I was also planning to use 8 chanel GPIO adaptor if Beagle bone would be to difficult(http://numato.com/8-channel-usb-gpio-module) But I just don’t know how to get binary to the string so I can make computer to react. I will highly appreciate your advice Best Stan
  7. MSP430g2553 ALL DOCUMENTATION BELOW Playing with IR receiver (IR Library from Energia) and RGB led. I cant write analog values to my RGB led without breaking the program. I connected the three outputs to analogWrite capable pins. All works great when writing 0 or 255 but the library stop working well when i try to write other value to make the color less bright. Then i read about timers and PWM. I notice my library use Timer1_A so i need to connect leds to pins capable of analog writing but using Timer0_A. These pins were three, but one is RXD of Serial and messed things up. So I changed the library to use Timer0_A and connect leds to pins capable of analog writing but using Timer1_A. The program at the moment works nice, but again only with 0 or 255 values. BUT i noticed i can write other values to ONE of these pins, it dont breaks things. I wonder what could be the difference, with datasheet. The pins were: #define RED P2_1 #define GREEN P2_2 #define BLUE P2_4 ---> this works with values between 0 and 255 With datasheet i noticed pin P2_4 has "Out2 output", thats all difference i have found. BUT i put RED to P2_5 wich is "Out2 output" too and again it breaks things, while BLUE doesnt. All of these without knowing what can be out2 output. I miss something. Can you help me? I can give you more details if needed. EDITED: Individually, it works. Pins that are analogWrite capable and use T0_A are {2_1 - 2_2 - 2_4 - 2_5} DOCUMENTATION ABOUT: Problems with timers and IR library http://forum.43oh.com/topic/3550-ir-library-and-pwm/ Datasheet(page 6) http://www.ti.com/lit/ds/symlink/msp430g2553.pdf PinOUT https://www.dropbox.com/s/mcvbnkdpzsn1wna/LaunchPad%20MSP430G2553-V1.4.jpg
  8. Ok, I am out of ideas on this. I am going to start by saying, this works on an arduino uno, no problems. Then follow that up by saying this works perfectly on a launchpad with a 2553 in it IF I DO NOT USE THE IR LIBRARY. So this is what happens: Simple motor control for a two motor robot. Using the IR Library to receive commands from a remote control. I upload the code, and I can make both motors go full throttle, forward, or backward. The moment that I try to spin right or left, I get a quick "jerk" from both motors, in opposite directions (as I would expect) and then nothing...I can not even make it go forward and backward anymore until I reset the launchpad. Again, if I hook the launchpad up, and give it a routine for the robot (forward, spin, backward, spin, left, right, etc) it works just perfectly fine. It is the addition of the IR Library and whatever it is either doing with timers, or interrupts...but I just can't seem to figure it out. I have tried every combination of PWM capable pins that I can think of, and can not get it to work. Here is the code. I would sincerely appreciate any help you can give me. //======================================================================= // IR Remote Control Robot // Remixed by Jerod W. //======================================================================= #include <IRremote.h> #include <IRremoteInt.h> //motor control pin const int E1=4; //motor 1 (right) enable pin const int M1A=2; //motor 1 (right) Output pin 1 const int M1B=3; //motor 1 (right) Output pin 2 const int E2=13; //motor 2 (left) enable pin const int M2A=5; //motor 2 (left) Output pin 1 const int M2B=7; //motor 2 (left) Output pin 2 //IR Receiver Module Pin and variable int RECV_PIN = 10; IRrecv irrecv(RECV_PIN); decode_results results; // setup function //======================================================================= void setup() { //configure all motor control pin as output pinMode(E1,OUTPUT); pinMode(M1A,OUTPUT); pinMode(M1B,OUTPUT); pinMode(E2,OUTPUT); pinMode(M2A,OUTPUT); pinMode(M2B,OUTPUT); //disable both motor by default analogWrite(E1,0); analogWrite(E2,0); //start IR receiver irrecv.enableIRIn(); } // loop function //======================================================================= void loop() { //IR signal received if(irrecv.decode(&results)) { //forward (Up arrow) if(results.value==0x820 || results.value == 0x20) { motor(255,255); } //reverse (VOL-) else if(results.value==0x821 || results.value == 0x21) { motor(-255,-255); } //rotate left (PREVIOUS) else if(results.value==0x811 || results.value==0x11) { motor(240,-240); } //rotate right (NEXT) else if(results.value==0x810 || results.value==0x10) { motor(-240,240); } //forward left (POWER) else if(results.value==0x80F || results.value==0xF) { motor(230,160); } //forward right (FUNC/STOP) else if(results.value==0x80C || results.value==0xC) { motor(180,220); } //reverse left (DOWN) else if(results.value==0x80D || results.value==0xD) { motor(-230,-160); } //reverse right (UP) else if(results.value==0x822 || results.value==0x22) { motor(-180,-220); } //receive the next value irrecv.resume(); //short delay waiting for repeating IR signal // (prevent it to stop if no signal received) delay(50); } //no IR signal received else { //right wheel stop analogWrite(E1,0); //left wheel stop analogWrite(E2,0); } } // extra function //======================================================================= //function to control the motor void motor(int left, int right) { //limit the max speed //if(left>255)left=255; //else if(left<-255)left=-255; //if(right>255)right=255; //else if(right<-255)right=-255; //left wheel forward if(left>0) { //left wheel direction forward digitalWrite(M2A,LOW); digitalWrite(M2B,HIGH); //left wheel speed analogWrite(E2,left); } //left wheel reverse else if(left<0) { //left wheel direction reverse digitalWrite(M2A,HIGH); digitalWrite(M2B,LOW); //left wheel speed analogWrite(E2,-(left)); } //left wheel stop else { //left wheel stop analogWrite(E2,0); } //right wheel forward if(right>0) { //right wheel direction forward digitalWrite(M1A,LOW); digitalWrite(M1B,HIGH); analogWrite(E1,right); } //right wheel reverse else if(right<0) { //right wheel direction reverse digitalWrite(M1A,HIGH); digitalWrite(M1B,LOW); analogWrite(E1,-(right)); } //right wheel stop else { //right wheel stop analogWrite(E1,0); } }
  9. IR Remote Control Demo Project for the Stellaris LaunchPad Evaluation Board A demo to read Sony IR remote control commands using TIMER1A and PORTA PA2 Requires an IR Receiver device( TSOP1738 or similar ) connected to PA2 and a TV remote control. What you will need: First you will need a reciever/detector device like the TSOP1738 from vishay. That particular device is tuned for a 38khz carrier (most common) but if you happen to have a 36khz or 40khz device it will probablay work too. The one I used worked fine at 3.6v and can be powered right off the board. It's a 3 pin device, GND, VCC and Output. Next thing you'll need is of course, a remote control. I found a universal remote at a "dollar store" but you probably have a programmable remote lying about. ============================================================================= I've attempted to set this demo project up for those just starting out with The Stellaris LaunchPad Evaluation Kit. I tried to keep things simple. There are plenty of comments in the code to help. ============================================================================= Comment & Questions are welcome Eric IR_Demo.zip
  10. I'm trying to build a distance sensor using an IR Led, and a TSOP receiver that is run by my stellaris launchpad. However, I am not sure how to produce the 38KHz that is needed to drive the transmitter, and I'm unsure about how to run the transmitter, and read the receiver at the same time. Any help is appreciated!