The forums are retiring and are now closed for new topics and comments. The existing content will remain online and accessible through 2020 to provide everyone the opportunity to save any relevant information. In the spring of 2021, these Community forums will be taken offline.

Search for uart in Topics

Arduino UART communication quandary

I'm trying to hook up a 5v Arduino to a 3.3v datalogger. I just realized that in all the time I have been messing around with micro controllers, I have never communicated serially to a device that wasn't 5V. I was about to just wire the two devices together when I thought better of it and figured I should look into the matter a little further. Can I just directly connect the RX pin on the 3.3V device to the TX pin on the Arduino? Or do I need to add a resistor in-between? Or a voltage divider? Actually, that wasn't all that many questions. Basically, I'm just wondering what is good form in communicating between devices of varying voltages?

Topic by randofo    |  last reply

UART programming for AVR Butterfly help

Hey everyone, I need help with programming the AVR Butterfly with an FM transmitter code that I found on the net. I have all the pieces soldered together (nothing exploded or smoked) and I am trying to upload a file, however, I cannot get it to connect to the BASIC Stamp adapter from serial-to-UART. What I have: Usb-To-Serial Basic Stamp Adapter AVR Butterfly (Butterfly is being programmed through the UART ports) I am using AVR Studio 4 to upload the code, but it will neither confirm that the serial cable is there nor after doing the holding-the-joystick process to tell the butterfly to go into programming mode for the program to see it. Am I doing something wrong? Or is there an easier program to upload the code? I also have Visual Studios '05 and the Basic Stamp program from the Parallax website. If its any good to say, I also have the USBTinyISP programmer that can connect to the ISP ports on the Butterfly. Any help would be appreciated!

Topic by KT Gadget    |  last reply

What V.Smile hacks have been done?

I would like to develop games for the V.Smile, but I don't know how I should do it. However, upon disassembling a V.Smile Plus controller (which had labeled communication pins), I found the V.Smile controller pinout: 1=VCC (3V) 2=RTR (to request a report from the controller) 3=RX 4=GND 5=TX 6=RTS (to prepare the controller to change the state of an LED) Also, if you want to make your own controller, make sure that it is polarity-protected, because the power-down voltage can be as much as -1V.

Question by VirtualBoxer    |  last reply

Can UART or FTDI serial work with communication in only one direction? Answered

Can UART or FTDI serial work with communication in only one direction? or no? Or is there no universal protocol (as in UART only defines the type of connection, not what data is sent though it)  I am building a quadcopter and was thinking of using one of the 2 audio channels to send serial data down one of the spare channels, and the other channel is just connected to a microphone to 'listen' to the noise of the props. I have 2 major concerns with this method: Will the frequency response and bandwidth of the audio channels be high enough to carry a 115200 bauds signal, or at the very least a 9200 baud signal? and the original question; do I need a 2-way connection for information from the UBLOX GPS or multiwii output? If yes, then i guess the only way to get telemetry is to get one of those 900MHz transmitters, yet another board that I will have to deal with.

Question by -max-    |  last reply

How to read uart data and write to i2c device.

// Port for the I2C #define I2C_DDR DDRD #define I2C_PIN PIND #define I2C_PORT PORTD // Pins to be used in the bit banging #define I2C_CLK 0 #define I2C_DAT 1 #define I2C_DATA_HI()\ I2C_DDR &= ~ (1 << I2C_DAT);\ I2C_PORT |= (1 << I2C_DAT); #define I2C_DATA_LO()\ I2C_DDR |= (1 << I2C_DAT);\ I2C_PORT &= ~ (1 << I2C_DAT); #define I2C_CLOCK_HI()\ I2C_DDR &= ~ (1 << I2C_CLK);\ I2C_PORT |= (1 << I2C_CLK); #define I2C_CLOCK_LO()\ I2C_DDR |= (1 << I2C_CLK);\ I2C_PORT &= ~ (1 << I2C_CLK); void I2C_WriteBit(unsigned char c) {     if (c > 0)     {         I2C_DATA_HI();     }     else     {         I2C_DATA_LO();     }     I2C_CLOCK_HI();     delay(1);     I2C_CLOCK_LO();     delay(1);     if (c > 0)     {         I2C_DATA_LO();     }     delay(1); } unsigned char I2C_ReadBit() {     I2C_DATA_HI();     I2C_CLOCK_HI();     delay(1);     unsigned char c = I2C_PIN;     I2C_CLOCK_LO();     delay(1);     return (c >> I2C_DAT) & 1; } // Inits bitbanging port, must be called before using the functions below // void I2C_Init() {     I2C_PORT &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));     I2C_CLOCK_HI();     I2C_DATA_HI();     delay(1); } // Send a START Condition // void I2C_Start() {     // set both to high at the same time     I2C_DDR &= ~ ((1 << I2C_DAT) | (1 << I2C_CLK));     delay(1);     I2C_DATA_LO();     delay(1);     I2C_CLOCK_LO();     delay(1); } // Send a STOP Condition // void I2C_Stop() {     I2C_CLOCK_HI();     delay(1);     I2C_DATA_HI();     delay(1); } // write a byte to the I2C slave device // unsigned char I2C_Write(unsigned char c) {     for (char i = 0; i < 8; i++)     {         I2C_WriteBit(c & 128);         c <<= 1;     }     //return I2C_ReadBit();     return 0; } // read a byte from the I2C slave device // unsigned char I2C_Read(unsigned char ack) {     unsigned char res = 0;     for (char i = 0; i < 8; i++)     {         res <<= 1;         res |= I2C_ReadBit();     }     if (ack > 0)     {         I2C_WriteBit(0);     }     else     {         I2C_WriteBit(1);     }     delay(1);     return res; }

Topic by Blixxer    |  last reply

Intel Galileo will not communicate with Uno?

Hello, I want to communicate with my arduino uno via serial on pins 0 and 1 of the Galieo and SoftwareSerial on Uno pins 10 and 11. I have checked the baud rate and all i get when i read the SoftwareSerial port is garbage. Does anybody know why this is happening? Thanks

Question by D5quar3    |  last reply

Serial/Console Interface for Video Brochure?

Hello All!  I recently acquired one of those cheap video brochures (the kind that loops a video on full volume until you want to dash it against a wall)... Anyways, I couldn't resist the urge to hack with it, so I pulled the enclosure apart to expose the electronics. Inside I found a magnetic switch, a USB mini connector with all pins wired (two power/two data), a motherboard with three ICs and a scattering of other components, and a rechargeable battery (seems to be LiPo) all wired up to a 5.5" display. I plugged the usb to my computer and it mounted as a drive labeled "MediaPlayer". Inside was the original video file that I replaced with one of my own videos in the same format. It now plays my video with sound. Where I am stumped is with the circuit board. I have not found any markings on the board itself, however it has some pins around the edge to which the switch and speaker were connected to (I'm guessing these may be GPIOs.....). There is also an unpopulated four pin header (to the right of the display connector) that looks like it may possibly be for another USB port. There are also four solderable connections (on the bottom of the left side of the board) that are labeled GND, HRP, HRL, and DET... I wasn't able to find any meaning for those, but is it possible to establish communication through that? Last but not least, the three ICs on the board seem to be a CPU, and two flash chips. The markings on the center one (which I'm assuming is the CPU) are: F1 E200 F8148DA 19H1  The second IC, to the right of the "CPU" is marked: hynix 812A HY5DU121622CTP-D43 KOR N7EAX553Q2 - also engraved with the letters JHY The final IC, left of the "CPU" is marked: hynix KOR HY27UF082G2M TPCB 604A M8SD53321 According to Google, the E200 refers to the all winner E200 SoC that supports UART, SPI and TWI... It also says that it runs OS Melis 2.0... I would like to hack into this system if possible and/or find a way to interface the LCD through SPI for my Pi Zero... Any help is greatly appreciated! Thanks! I included a couple of High Res photos to show the PCB (the display ribbon cable has been removed to show the third IC). 

Question by JoeW79    |  last reply

Help with AVR USART?

Hello... Im trying to make a set of RF remote switches using an atmega16.  I want to push a momentary button on the Tx board and effectively have a relay connected to one of the output pins TRIGGERED on the Rx board. I have attached the code I did for this, I send the entire data=PINC; through uart and catch it on the other end and do PORTC=data; but with this approach I would not be able to TRIGGER the output pin. Please help.....  TX side code.... #include #include #include "usart.h" void main() {  //Initialize the USART with Baud rate = 2400bps  USARTInit(416);  //Enable Internal Pullups on PORTC  PORTC=0xFF;  /* Keep transmitting the Value of Local PORTC to the Remote Station. On Remote RX station the Value of PORTC sent on AIR will be latched on its local PORTC */ uint8_t data; while(1) { data=PINC; /* Now send a Packet Packet Format is AAZ total Packet size if 5 bytes. */ //Stabilize the Tx Module By Sending JUNK data UWriteData('J'); //J for junk //Send 'A' UWriteData('A'); //Send Another 'A' UWriteData('A'); //Send the data; UWriteData(data); //Send inverse of data for error detection purpose UWriteData(~data); //End the packet by writing 'Z' UWriteData('Z'); //Wait for some time _delay_loop_2(0); _delay_loop_2(0); _delay_loop_2(0); _delay_loop_2(0); } } RX Side code #include #include "usart.h" void main() { uint8_t i; //Clasical loop varriable uint8_t packet[5],data=0; DDRC|=0xFF; //All Output //Initialize the USART with Baud rate = 2400bps USARTInit(416); /* Get data from the remote Tx Station The data is the value of PORTC on Remote Tx Board So we will copy it to the PORTC of this board. */ while(1) { //Wait for a packet while(!UDataAvailable()); if(UReadData()!='A') continue; while(!UDataAvailable()); if(UReadData()!='A') continue; while(UDataAvailable()!=3); //Get the packet for(i=2;i<5;i++) { packet[i]=UReadData(); } //Is it ok? if(packet[2]!=((uint8_t)~packet[3])) continue; if(packet[4]!='Z') continue; //The packet is ok data=packet[2]; //Now we have data put it to PORTC PORTC=data; } }  

Question by pro2xy  

what is the difference between elm327 and OBD-II UART? if we are using elm327 then do we need to use OBD-II UART also?

We are working on our final year project that is getting the current data from the vehicle and display it on an android phone using arduino and bluetooth  module nrf8001. currently we are working on obd II interfacing and our task is to get the data on arduino and only for  testing purpose  using lcd. we are confused of whether to use elm327 usb cable or obd-II UART for the intermediate circuit between arduino and car's obd-II.  kindly help and if anyone can provide us with the arduino coding so it would be very helpful. thankyou

Question by rubscis    |  last reply

GPS: STM32L010K4 Hardfault_Handler at STM32L0xx_it.c:0x800067a

Dear fellow human being,I am working on a project wich uses the STM32L010K4 microcontroller. We implemented the chip on a PCB and we can write pins high and low and we’re able to use SPI. This project revolves around a GPS application. We’re trying to use the UART protocol with the stm32CubeMx IDE. We’re also trying to make some large/complex computations, I read online that this could potentially lead to stack overflow. I also read the datasheet and the uart is and spi are part of two different alternate functions. This is the message we get when trying to implement uart.With kind regards, Reinier

Topic by raygz1    |  last reply

xmega event-based IRCOM?

The IRCOM module has a capability of connecting to the uart not through a standard pin, but through the event system. This should make it possible to get IrDA input data for the IRCOM module from a pin other than standard or alternate RX pin for that uart.  But I haven't had much luck getting this facility working.  Has anybody used it?  Google shows nothing. I am actually getting data, but it's not the data that is being sent via IrDA. I think my problem may be that I don't know which events to configure the event system for.  I've tried the following: low level high level (i.e., low level + invert pin) rising and falling edges rising and falling edges with inverted pin With each of these, the IRCOM system does get data to the uart, but the data is not correct (and it's not consistent, either--the same IrDA packet generates different outputs at different times). Is a clock needed? Any thoughts?

Topic by arpruss  


Hello guruz, recently i bought n bluetooth UART module (;_id=354) RKI 1545 I tried interfacing it with 8051 using the 10,11 pin UART pins, using SCON register(mode1) baud rate 9600. But there is no reception or transmission. However the bt module is working fine. Passed the loop feedback test(joined theRx to Tx pin of module established echo received on Putty on WIN7 and blueterm android app )   CODE: #include void ini()     // Initialize Timer 1 for serial communication { TMOD=0x20;  //Timer1, mode 2, baud rate 9600 bps TH1=0XFD; SCON=0x51; TR1=1; } void recieve()  //Function to receive serial data { unsigned char value; while(RI==0); value=SBUF; P1=value; RI=0; } void transmit()  // Funtion to transmit serial data { P2=0xF4; SBUF=P2; while(TI==0); TI=0; SBUF=P1; while(TI==0); TI=0; } void main() { while(1) {   ini();   recieve();   transmit(); } }

Topic by skumar112    |  last reply

Arduino Lilypad mp3 program using Arduino uno?

I have a arduino lilypad mp3 from sparkfun. I have bought a TTL UART USB programmer instead 5v FTDI breakout. It didn't work out. can we use Arduino uno as a bootloader ? 

Question by DaksithaW    |  last reply

Microcontroller Selection for Camera Project

I am doing a surveillance camera project. I need ARM7 TDMI based microcontroller that supports 1) UART, SPI, USB Interface 2) Ethernet, External Memory Interface – 16 MB SDRAM, 2MB Flash 3) Packaging option other than BGA type Please recommend a suitable microcontroller or a combination to implement this project in a cost effective manner.

Topic by GEORGE NEIL  

Camera Surveillance Design-Microcontroller Selection

I am doing a surveillance camera project. I need ARM7 TDMI based microcontroller that supports 1) UART, SPI, USB Interface 2) Ethernet, External Memory Interface – 16 MB SDRAM, 2MB Flash 3) Packaging option other than BGA type Please recommend a suitable microcontroller or a combination to implement this project in a cost effective manner.

Topic by GEORGE NEIL  

I need help for my electric imp/arduino project....

Hey, I have been working on a project centered around what chris nafis has already done with the grove dust sensor. So far, I have managed to get the dust sensor hooked up to an arduino and I have been getting it to display data, but that's about it. My next step was to get an elecrric im on sparkfun's imp shield to read serial data from the arduino in the form of numbers and then output it to COSM. However, for some reason, this does not seem to want to work on the leval of the imp. I followed most of jimb0's instructions on sparkfun for imps and arduino, but this does not seem to work. I have an arduino leonardo outputting serial data with serial1 at 19200 through pins 1 and 0 to the shield, which it then supposed to connect an imp running a program to patch this to a cosm node. I know nothing about squirrel, just using this code to do things: // Transmit data between UART and Input/OutputPorts on the impee // by: Jim Lindblom //     SparkFun Electronics // date: September 26, 2012 // license: BeerWare //          Please use, reuse, and modify this code as you need. //          We hope it saves you some time, or helps you learn something! //          If you find it handy, and we meet some day, you can buy me a beer or iced tea in return. local rxLEDToggle = 1;  // These variables keep track of rx/tx LED toggling status local txLEDToggle = 1; // impeeIn will override the InputPort class. // Whenever data is received to the impee, we'll jump into the set(c) function defined within class impeeIn extends InputPort {     name = "UART Out";     type = "number";         // This function takes whatever character was sent to the impee     // and sends it out over the UART5/7. We'll also toggle the txLed     function set(c)     {         hardware.uart57.write(c);         toggleRxLED();     } } local impeeInput = impeeIn();  // assign impeeIn class to the impeeInput local impeeOutput = OutputPort("UART In", "number");  // set impeeOutput as a string function initUart() {     hardware.configure(UART_57);    // Using UART on pins 5 and 7     hardware.uart57.configure(19200, 8, PARITY_NONE, 1, NO_CTSRTS); // 19200 baud worked well, no parity, 1 stop bit, 8 data bits } function initLEDs() {     // LEDs are on pins 8 and 9 on the imp Shield     // They're both active low, so writing the pin a 1 will turn the LED off     hardware.pin8.configure(DIGITAL_OUT_OD_PULLUP);     hardware.pin9.configure(DIGITAL_OUT_OD_PULLUP);     hardware.pin8.write(1);     hardware.pin9.write(1); } // This function turns an LED on/off quickly on pin 9. // It first turns the LED on, then calls itself again in 50ms to turn the LED off function toggleTxLED() {     txLEDToggle = txLEDToggle?0:1;    // toggle the txLEDtoggle variable     if (!txLEDToggle)     {         imp.wakeup(0.05, toggleTxLED.bindenv(this)); // if we're turning the LED on, set a timer to call this function again (to turn the LED off)     }     hardware.pin9.write(txLEDToggle);  // TX LED is on pin 8 (active-low) } // This function turns an LED on/off quickly on pin 8. // It first turns the LED on, then calls itself again in 50ms to turn the LED off function toggleRxLED() {     rxLEDToggle = rxLEDToggle?0:1;    // toggle the rxLEDtoggle variable     if (!rxLEDToggle)     {         imp.wakeup(0.05, toggleRxLED.bindenv(this)); // if we're turning the LED on, set a timer to call this function again (to turn the LED off)     }     hardware.pin8.write(rxLEDToggle);   // RX LED is on pin 8 (active-low) } // This is our UART polling function. We'll call it once at the beginning of the program, // then it calls itself every 10us. If there is data in the UART57 buffer, this will read // as much of it as it can, and send it out of the impee's outputPort. function pollUart() {     imp.wakeup(0.00001, pollUart.bindenv(this));    // schedule the next poll in 10us         local byte =;    // read the UART buffer     // This will return -1 if there is no data to be read.     while (byte != -1)  // otherwise, we keep reading until there is no data to be read.     {         //  server.log(format("%c", byte)); // send the character out to the server log. Optional, great for debugging         impeeOutput.set(byte);  // send the valid character out the impee's outputPort         byte =;  // read from the UART buffer again (not sure if it's a valid character yet)         toggleTxLED();  // Toggle the TX LED     } } // This is where our program actually starts! Previous stuff was all function and variable declaration. // This'll configure our impee. It's name is "UartCrossAir", and it has both an input and output to be connected: imp.configure("UartCrossAir", [impeeInput], [impeeOutput]); initUart(); // Initialize the UART, called just once initLEDs(); // Initialize the LEDs, called just once pollUart(); // start the UART polling, this function continues to call itself // From here, two main functions are at play: //      1. We'll be calling pollUart every 10us. If data is sent from the UART, we'll send out out of the impee. //      2. If data is sent into the impee, we'll jump into the set function in the InputPort. // // The end It's not mine, but I modified it slightly t work with numbers instead of strings. I an then using this arduino code on a leonardo: ;int pin = 10; unsigned long final; unsigned long duration; unsigned long starttime; unsigned long sampletime_ms = 30000; unsigned long lowpulseoccupancy = 0; float ratio = 0; float concentration = 0; void setup() {   Serial1.begin(19200);    while (!Serial) {     ;    }   pinMode(10,INPUT);   starttime = millis(); } void loop() {   duration = pulseIn(pin, LOW);   lowpulseoccupancy = lowpulseoccupancy+duration;   if ((millis()-starttime) > sampletime_ms)   {     ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0=>100     concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve     final = concentration*35     ;Serial.println(concentration);     lowpulseoccupancy = 0;     starttime = millis();   } };int pin = 10; unsigned long final; unsigned long duration; unsigned long starttime; unsigned long sampletime_ms = 30000; unsigned long lowpulseoccupancy = 0; float ratio = 0; float concentration = 0; void setup() {   Serial1.begin(19200);    while (!Serial) {     ;    }   pinMode(10,INPUT);   starttime = millis(); } void loop() {   duration = pulseIn(pin, LOW);   lowpulseoccupancy = lowpulseoccupancy+duration;   if ((millis()-starttime) > sampletime_ms)   {     ratio = lowpulseoccupancy/(sampletime_ms*10.0);  // Integer percentage 0=>100     concentration = 1.1*pow(ratio,3)-3.8*pow(ratio,2)+520*ratio+0.62; // using spec sheet curve     final = concentration*35     ;Serial.println(concentration);     lowpulseoccupancy = 0;     starttime = millis();   } } I would really like some help, as this is my science fair project and I am the only person that I know that knows about Imp, and sadly we don't have any hackerspaces around where I live in alaska.

Topic by qquuiinn    |  last reply

Interfacing the nxt and rfid via the ardiuno?

I am  having a problem here,I am to connect an rfid card reader to the arduino microcontroller and then the microcontroller to the nxt robot.From the researches that i have made i have learnt that the nxt communicates with the ardiuno microcontroller through I2C while the microcontroller itself reads data fom the rfid antenna using an UART bus.I am wondering if you could help on the code to make the arduino send a message to the nxt.

Question by roagile-2007    |  last reply

Can't find a library or manual for my rfid reader?

So I recently got one of these  and it mentions I should download the manual for insturction on the commands, but I can't find the manual or any libraries for the life of me! So i was wondering if the good people of instructables might be able to help me out on locating this manual/library so that i can pop it into my arduino projects :P

Question by JakeWhelchel    |  last reply


I am looking for a robust and reliable digital telemetry link between a solar car (which may be up to a mile away, on track) and not necessarily line-of-sight. Requirements listed below: * >1000 baud preferred (100 baud minimum) * Simple to implement (we don't have lots of development time left for the project) * 1 mile distance with obstructions * Legal (I don't want to piss off the FCC :P) * efficient (let's impose a... oh, IDK... 5W transmit power for the car? Ok? Ok.) What I have considered / am considering: * Other teams have used the popular 900MHz Xbee pro UART radio modules for this purpose, but the distance seems to be quite short / limited. The advantages include eese of use, as it acts as a nearly-transparent UART bridge, but it appears they may not be good enough for this application. * 433MHz? I know lower frequencies tend to propagate further for a given power, would 433MHz be preferable over 900MHz? I can't seem to find many devices beyond small keyfobs and stuff using this band. * 72MHz? I know this band was used for old-school RC transmitters, can I repurpose it for telemetry? Have not looked into it too much. Doesn't appear to do any sort of frequency hopping or other fancy stuff either. * amatuer HAM / CB / radio frequencies? I think this is the most robust solution but probably requires the most effort too. I and the rest of the team would need to get licenced (although honestly I want get licenced to mess around with this stuff anyway) and we would probably need to design a system around some form of digital encoding. There appear to be a lot of different methods, but are there any that meet the throughput requirements?

Question by -max-    |  last reply

Any "Cheap-Duinos" based on the ATMega1280/1281/2561 MCUs?

Hi there. I'm using a Arduino Mega-1280 in a project, and am wanting to "free it up" for other things. I see that there are a number of cheap-duino replacements here and other places (ie;, but I haven't found any that specifically incorporate the ATMega1280/1281/2561. Basically, I'm needing all four of the hardware UARTs this family of MCUs provide, without reverting to interrupt-driven, software-based serial I/O it's predicesors utilize, having the extra memory certainly doesn't hurt either. Thanks in advance for any suggestions, links, etc! Regards, Scott

Question by tennisaddict    |  last reply

Announcing the Roboduino - the ultimate Arduino-compatible Microcontroller

The Roboduino is finally on sale!!! $40 for a kit and $55 for an assembled version More info and sales information here: Features / Specs:100% Compatible with Arduino software.Power buses along side pwm and analog pins easily accept standard servo and sensor connectors.Powered can be supplied from USB, barrel plug or 3-pin male header. You'll need a suitable power supply when driving multiple servos.dedicated UART 3-pin male header6 PWM outputs with neighboring unregulated power pins6 analog pins14 digital pinsReverse polarity protection for board circuitry (not for unregulated power pins)Optional I2C pull-up resistor locations

Topic by Erobots  

FEETECH 17DOF DIY humanoid robot

Https:// Feetech 17 DOF humanoid robot ready to play for education DIY FEETECH New Humanoid Robot Profile The FT-17DOF-SC-RTP is a ready to play humanoid robot which comes fully assembled & completed from our team at FEETECH. This humanoid robot uses 17PCS FT-SCServo (SCS15). SCS15 is all metal gear and uses TTL level Half Duplex Asynchronous UART BUS Communication Protocol. It gives the feedback of the data relevant to position, voltage temperature, load and speed. This humanoid robot uses all aluminum alloy parts, anodized color (red, blue, white for optional) or an assortment.It is simple wiring and makes assembly and disassembly fast and convenient. It is easy to use "MOTION" editing software for Windows system. As long as you use a computer you will love playing with this humanoid robot, even if you do not have any programming knowledge, you can edit the humanoid robot actions within ‘MOTION’ editing software. Robot hobbyist can move the robot in a variety of different poses by hand, then read in and save data from robot joint SCServo via software, moving through the posture sequences from one by one will complete the program of series motion or dance. The data of dance or motion group can be saved into your local computer for use the next time, or download into the robot control board for offline operation. The 2.4G remote control system is based on Arduino open source, users can freely modify according to our Arduino source and combination with the Robot Control Board (SCM-1) to create more advanced functions. You will feel strong & excited when to play this robot dance and movement patterns. The Robot Control Board (SCM-1) can also accept UART instructions, allowing the user to send control instructions according to the packet data’s protocol complementing the robot scope of uses and research. Humanoid Robot Specifications Height:380mm; Weight: 1.7kg(Including battery); DOF:17 Degrees Of Freedom in total Head 1 PCS Hands 6 PCS Feet 10 PCS Connect with computer:USB-mini 2300mAH NI-MH rechargeable battery and AC charger Arduino open source 2.4 G remote control system Key feature -17DOF,UART BUS servo, simple wiring, easy to assemble and disassemble -It is easy to use "MOTION" editing software for Windows system, Programmed robot’s motion by hand. -Save the robot motion data on local and is easy to be use by other robots. -Motion automatic interpolations function; Make the movement more continuous and smooth, make sure the movement of posture to posture more perfect within specified speed time. -Can name the motion group by yourself if you need great for understanding and memory. It can repeat like function calls every motion group. Each motion can be imported and exported alone. -After a series of motion group orderly arrangement can coherent form a dance. Both played online and off-line available. -Each motion group can be remote controlled by Arduino open source 2.4G remote control system (especially good for use as a fighting robot) -With 39kb FLASH motion data storage unit, can be divided into 254 motion group. If storing one motion group, It can contain up to store 730 posture. -The “MOTION” software can show motion data. The robot will to move online when double-click any data of software. This is very easy to debug robot’s motion. -Can be controlled by Arduino UART with instructions. -NI-MH battery can recharge any time no needing worry about d damage. Battery can run about 30 minutes. -Accurate design of each part. Using a screwdriver can complete the assembly Packing list One assembly completed set of FT-17DOF-SC-RTP humanoid robot including: -All metal gear SCServo * 17pcs -Aluminum alloy machinery frame * 1set -Master control board (SCM-1) * 1pcs -Arduino open source 2.4 G remote control system * 1set -7.2V 3,000mAh NI-MH battery  * 1set -8.4 V AC charger * 1pcs -USB-mini cable 150cm -Programming software “Motion”  * 1set (download from Website) Related documents -Instruction manual -Robot debugging manual -Software debugging instruction -Remote controller instruction

Topic by Robotfans  

ADC conversion error in code ATMEGA328p?

I am trying to read values from ADC0 on the ATMEGA328p. The values expected are between 0-5v. This is due to ADC0 being connected to a potentiometer connected to the 5v output of a Xplained mini. I am getting either 0v or 5v usually. With no variation when the potentiometer is changed. Here is the date sheet of atmega328p I have looked at multiple ADC examples and tutorials online but cant find the error in my code. void adc_initialise (){     //set vref to AVcc, channel selection is initially ADC0 as wanted     ADMUX |= (1<<6);     //set ADC enable, Set adc clock prescalar 64     ADCSRA |= (1<<7)|(1<<2)|(1<<1); } uint16_t adc_read (){     ADCSRA |= (1<<6); // start conversion     while( ADCSRA & (1<     return ADCW; } float adc_calculation(uint16_t adcValue){     float stepSize = (5.0/1024.0);     float voltageIn = adcValue*stepSize;     return voltageIn;   } then in my main i have while(1){       adc_initialise();     uint16_t adcValue = adc_read();     float voltageIn = adc_calculation(adcValue);     adcConverterToUART(voltageIn);//I know that this part of the code is working as I have hardcoded many test values and all have transmitted correctly. } And as mentioned above I know the error is not in my UART code but somewhere in the above ADC code. Cheers in advance for any help.

Question by DELETED_MakiY2    |  last reply

Hardfault stm32L010k4t6

Dear fellow human being,I am working on a project wich uses the STM32L010K4 microcontroller. We implemented the chip on a PCB and we can write pins high and low and we’re able to use SPI. This project revolves around a GPS application. We’re trying to use the UART protocol with the stm32CubeMx IDE. We’re also trying to make some large/complex computations, I read online that this could potentially lead to stack overflow. I also read the datasheet and the uart is and spi are part of two different alternate functions. This is the message we get when trying to implement uart. With kind regards, Reinier/* USER CODE BEGIN Header *//** ************************** * @file : main.c * @brief : Main program body ************************** * @attention * * * * This software component is licensed by ST under BSD 3-Clause license, * the "License"; You may not use this file except in compliance with the * License. You may obtain a copy of the License at: * * ************************** */ /* USER CODE END Header ** Includes ------------------------------------------------------------------*/ #include "main.h"/* Private includes ----------------------------------------------------------*/ /* USER CODE BEGIN Includes ** USER CODE END Includes ** Private typedef -----------------------------------------------------------*/ /* USER CODE BEGIN PTD ** USER CODE END PTD ** Private define ------------------------------------------------------------*/ /* USER CODE BEGIN PD */ /* USER CODE END PD ** Private macro -------------------------------------------------------------*/ /* USER CODE BEGIN PM ** USER CODE END PM ** Private variables ---------------------------------------------------------*/ UART_HandleTypeDef hlpuart1;/* USER CODE BEGIN PV ** USER CODE END PV ** Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_LPUART1_UART_Init(void); /* USER CODE BEGIN PFP ** USER CODE END PFP ** Private user code ---------------------------------------------------------*/ /* USER CODE BEGIN 0 ** USER CODE END 0 *** * @brief The application entry point. * @retval int */ int main(void) { /* USER CODE BEGIN 1 */ /* USER CODE END 1 */ /* MCU Configuration--------------------------------------------------------*/ /* Reset of all peripherals, Initializes the Flash interface and the Systick. */ HAL_Init(); /* USER CODE BEGIN Init */ /* USER CODE END Init */ /* Configure the system clock */ SystemClock_Config(); /* USER CODE BEGIN SysInit */ /* USER CODE END SysInit */ /* Initialize all configured peripherals */ MX_GPIO_Init(); MX_LPUART1_UART_Init(); /* USER CODE BEGIN 2 */ /* USER CODE END 2 */ /* Infinite loop */ /* USER CODE BEGIN WHILE */ while (1) { /* USER CODE END WHILE */ /* USER CODE BEGIN 3 */ } /* USER CODE END 3 */ }/** * @brief System Clock Configuration * @retval None */ void SystemClock_Config(void) { RCC_OscInitTypeDef RCC_OscInitStruct = {0}; RCC_ClkInitTypeDef RCC_ClkInitStruct = {0}; RCC_PeriphCLKInitTypeDef PeriphClkInit = {0}; /** Configure the main internal regulator output voltage */ __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); /** Initializes the CPU, AHB and APB busses clocks */ RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI; RCC_OscInitStruct.MSIState = RCC_MSI_ON; RCC_OscInitStruct.MSICalibrationValue = 0; RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_5; RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; if (HAL_RCC_OscConfig(&RCC;_OscInitStruct) != HAL_OK) { Error_Handler(); } /** Initializes the CPU, AHB and APB busses clocks */ RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI; RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC;_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) { Error_Handler(); } PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_LPUART1; PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_PCLK1; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit;) != HAL_OK) { Error_Handler(); } }/** * @brief LPUART1 Initialization Function * @param None * @retval None */ static void MX_LPUART1_UART_Init(void) { /* USER CODE BEGIN LPUART1_Init 0 */ /* USER CODE END LPUART1_Init 0 */ /* USER CODE BEGIN LPUART1_Init 1 */ /* USER CODE END LPUART1_Init 1 */ hlpuart1.Instance = LPUART1; hlpuart1.Init.BaudRate = 209700; hlpuart1.Init.WordLength = UART_WORDLENGTH_7B; hlpuart1.Init.StopBits = UART_STOPBITS_1; hlpuart1.Init.Parity = UART_PARITY_NONE; hlpuart1.Init.Mode = UART_MODE_TX_RX; hlpuart1.Init.HwFlowCtl = UART_HWCONTROL_NONE; hlpuart1.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE; hlpuart1.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT; if (HAL_UART_Init(&hlpuart1;) != HAL_OK) { Error_Handler(); } /* USER CODE BEGIN LPUART1_Init 2 */ /* USER CODE END LPUART1_Init 2 */}/** * @brief GPIO Initialization Function * @param None * @retval None */ static void MX_GPIO_Init(void) { /* GPIO Ports Clock Enable */ __HAL_RCC_GPIOA_CLK_ENABLE();}/* USER CODE BEGIN 4 ** USER CODE END 4 *** * @brief This function is executed in case of error occurrence. * @retval None */ void Error_Handler(void) { /* USER CODE BEGIN Error_Handler_Debug */ /* User can add his own implementation to report the HAL error return state */ /* USER CODE END Error_Handler_Debug */ }#ifdef USE_FULL_ASSERT /** * @brief Reports the name of the source file and the source line number * where the assert_param error has occurred. * @param file: pointer to the source file name * @param line: assert_param error line source number * @retval None */ void assert_failed(uint8_t *file, uint32_t line) { /* USER CODE BEGIN 6 */ /* User can add his own implementation to report the file name and line number, tex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */ /* USER CODE END 6 */ } #endif /* USE_FULL_ASSERT ********* (C) COPYRIGHT STMicroelectronics **END OF FILE*/

Topic by raygz1  

MCP2210 Questions?

"Don't believe everything you read on the internet" - Abraham Lincoln Such wise words I should have heeded.  Anyhow I have my MCP2210 wired up correctly now, the computer recognizes it, configured using the MCP2210 Utility and the GPIO pins have been tested and work through the SPI Terminal that I downloaded for another product related to this from Microchip. The question I have now is how much farther can I take this?  I started with this IC because I know (some) Arduinos use an FT232 USB to UART chip to connect USB to the Atmel chip they use.  I recall most Atmel MCUs can be programmed using SPI, so I figured I would try this out.  I also hoped this would delve into software so I could teach myself a bit about that as I am more familiar with hardware and building circuits.  If everything worked out I wanted to use these with an MCU so I could make myself custom small USB programmable boards for projects.  So would it be possible to program an ATTiny or ATMega through this using Atmel Studio 7.0?  What am I missing if it can be done?  What should I be researching next?  Anything to point me in the right direction is appreciated.  If this is not feasible, alright, what other applications would these chips as I have a few more of them?

Question by Electric Spectre1  

ESP8266 has red led but not active after flashing

Hi Guys.I've been tinkering with ESP8266 for a couple of weeks now. It worked before the weekend, and now with only some code changes it stopped (but it does not seem to crash).My project: Tabletop clock with weather. For now I'm trying to get weather from openweather API via ESP8266. I actually managed to do the request, and now was trying to parse JSON, and at this point it stopped working.My setup: USB CP2104 CP2102 - UART TTL flashing stick Arduino Uno - only provides power to ESP (see below), RX/TX not connected.ESP8266 CH_PD and VCC powered from Arduino Uno 3.3V pin GPIO2 is connected to GND. The rest of pins are connected to the flashing stick.Problem: 1. I run flashing from Arduino IDE. 2. Compilation is ok, uploading is ok on 115200 baud, serial monitor is also 115200. 3. Sketch uploading progress is visible in IDE terminal, blue LED on ESP is rapidly blinking while uploading. 4. After upload is finished, I see something like "tail 8, checksum ... " in the serial monitor.Then I do not see anything in serial monitor. The red LED on ESP is very weak after flashing - the last time I tried to flash it - it is not visible with the lights on. The ESP does not connect to router (according to router info).Also one strange sideeffect - after flashing, wi-fi drops on my laptop.What may be the issue? Thanks.

Question by beshur  

Arduino as an ISP Programmer???? No luck so far :(

Hi, I've owned an Arduino Duemilanove for a while, and I love its functionality and all that it can do. I also like to program chips(PIC, and AVR) as it is pretty much an Arduino in super miniature form. But theres one problem, I dont own a working PIC or AVR Programmer! I looked around online and the only low-priced ones I could find(<$20USD) were Serial(I only have 1 serial port, but It's being used by my monitor, which I kind of need to see what I'm programming...). I have plenty of USB ports, but the USB programmers are over my budget. I would love to make one(I'm more of a DIY person) but I've heard from a few sources that the FT232RL and MAX232(UART<->RS232 converters)  wont work for the application of programming(but theres one on the Arduino?!?!?), so I'm out of luck there. But then I put 2 and 2 together: Why not just use my Arduino as an AVR programmer? So I went online hoping to find a shield I could buy for cheap, or at least a schematic. And I got nothing. The only thing I found close is how to program an Arduino with another Arduino, but I only want to use an Attiny13, or Attiny2313; Not the big Atmegaxxx. So now my question I present to you: How can I program an Attiny13/2313 with an Arduino, preferably(but not requiredly, anything really) with the ArduinoISP sketch included with the arduino IDE?

Topic by metrogdor22    |  last reply

Brainlink: atxmega, Bluetooth, rechargeable battery, accelerometer and more

It looks to me like I'm the only person on Instructables who uses a Brainlink in projects, so I wanted to share my experience with it.   The Brainlink is an atxmega with a cute case, Bluetooth module, a USB-rechargeable battery, accelerometer, multicolor LED, photo diode, IR transmitter, IR receiver, TTL serial uart, a bunch of pwm and digital and analog i/o lines and a regulated 3.3V output.   Full specs and official website are here.  It was produced by a Carnegie Mellon University spinoff. It originally sold for an overpriced $129 but unsurprisingly the product couldn't succeed at that price and it was discontinued.  SurplusShed has them for $39, which is more reasonable, and they periodically have 30-50% off everything sales if you sign up for their emails (for instance, they have a 48% off through the end of today with coupon code SS81420).  When on sale for $20 it's a lot of goodies economically put in one package (and you can pick up some lenses for Google Cardboard from SurplusShed while you're at it). The Brainlink seems to be primarily designed to interface computers or Android devices with all sorts of robotic devices.  There is an open source Java framework for talking to the Brainlink (though the serial protocol is simple enough to just roll your own).   I've used the Brainlink to decode IR signals (the official website has software for analyzing IR signals) and to control a Roomba via the serial uart.  Lately I've been using the Brainlink as a serial-to-Bluetooth bridge to talk to the Mindflex toy EEG (works better with my modded Brainlink firmware--the mods make it fast enough to capture raw data from the Mindflex: I will probably eventually write an Instructable)--see the photo. If you want to use it standalone, Arduino-style, you can upload your own firmware, either writing it from scratch or starting with the original firmware (source code is available).  I haven't actually worked with a real Arduino, but I was pleased to see how smooth the process of building and uploading the firmware was.  I just used WinAVR and it all worked just fine.  They have instructions and a link to the firmware source here. My own firmware mod was to add a full serial bridge mode.  Just send a 'Z' command to the Brainlink and until it's next turned off it bridges between Bluetooth and serial (at whatever baud rate you set with the regular Brainlink 'C' command).  The regular serial communication code may be OK for sending occasional commands to a robot, but it doesn't seem to work for sustained data receiving, at least not at the 57.6K baud that the toy EEG I was using works at.  With the bridge mode and an S-video cable, you basically get the functionality of a Rootooth for Roomba connection at a much smaller price. Presumably, with appropriate firmware you can make autonomous things, but I've been using it with a phone or a PC. For connecting stuff to the Brainlink, you use what look like 1.25mm spacing JST-style connectors (there is one 8-pin port and one 10-pin port;  for serial only connections, you only need three pins near one end of the connector, so a 3-pin connector works for serial).  They include one connector for each port.  I've ordered a bunch of 1.255mm JST connectors from a Chinese ebay seller--hopefully they will fit.   I have no affiliation either with SurplusShed or the makers of the Brainlink.

Topic by arpruss    |  last reply

USB, AVR, and PICs! Oh my!

Heya! I come from a pretty solid CS background, so I'm trying to wrap my head around the concept of EE projects.  I've got the basics of circuit design down, but I'm getting a little bogged down researching how to interface USB<-->ICs.  While I know efforts like Arduino provide a significant amount of pre-built software and hardware that can accomplish most DIY projects, I would really prefer to learn/have control over the whole software stack (and as much of the hardware stack as possible) from App to Userspace Driver to Kernel Driver (I've written a few, but never actually built my own circuitry to talk to).  I'm looking to learn for some resources on how to interface at a low level.  I wouldn't shy away from writing my own PIC/AVR/??? bootloader if it means I have more control over the communication stack.  I'm sure I'd be re-writing a lot of the Arduino/AVR software that's out there, but hey, I see it as a learning opportunity... right? :) It seems that FTDI makes some USB/UART(Serial) chips that many of the sparkfun-esque USB->Breadboard adapters are based on.  From what I can tell though, most of the chips do literal USB Full/Low speed->115200 bit/s Serial connection.  This seems like an awfully large downsample of the possible communication bandwidth... Is this how things like printers, external hard drives, and webcams work? So, in short, if I was going to write my own USB stack/drive/kernel module to go along with a custom IC bootloader, how would I go about it? Are there any resources out there describing how one would go about this? Thanks for your time! 

Topic by skyfire360    |  last reply

Anyone with experience with CAN bus + Teensy 3.6?

I have been recently messing around with the Teensy 3.6, of which the MK66FX1M0VMD18 it's rocking is probably one of the most powerful microcontroller I have ever messed with. (180MHz ARM Cortex M4, 256K RAM, hardware FPU, far more than enough GPIO, and an insane amount of serial interfaces!) I am particularly interested in the 2 CAN bus interfaces that it's sporting. However when loading the example code (which explicitly states it is only compatible with the Teensy 3.6! as only it has 2 CAN busses) I have not had much luck getting it to work. I don't really understand what CAN_TX and CAN_RX are suppose to be. I would assume it is simalar to UART where TX is connected to RX and RX is connected to TX. However at least with the MCP2551's I also ordered, the RX (on this chip) is actually an output while the TX appears to be an input. As it turned out, I was not able to use this chip due to it being a strictly 5V logic component. So after having discovered that, I decided to just connect the TX of CAN1 directly to RX on CAN0, and vice versa. Using the Object Oriented CAN example, I get absolutely nothing. If I swap the connections, connecting the low-impedance TX to the other low-impedance TX, and RX to RX, I also get nothing, but if I bring my hand close to the wires, or touch and feel around some of the pins, I will get some packets through and to appear on the serial monitor, almost as if one of the pins is acting as an input and of course it's floating because I don't know which pin that would be, as there is no code or comments to indicate such a button. I honestly have no idea what the hell is going on, and don't have access to a proper scope to see what is going on.

Question by -max-    |  last reply

24 x 24 LED Matrix Project

I would like to share with you all an awesome project and some doubts and questions related to the same. This is a 24 x 24 LED Matrix project taken from here. All the data is taken from the same link. 24×24 LED dot matrix -->   This is pretty old circuit but I found it interesting to describe here. 24×24 LED display is formed by using 9 8×8 Dot LED matrix displays, that are connected to AT90S2313 MCU. MCU scans an indicator lines in series. Special PC program is written which allows drawing images on screen and transfer them via COM port to device. You can send images in series what gives an animation effect.   Circuit is was built using obsolete AT90S2313 MCU which can be replaced by Attiny2313 MCU with minor modifications of firmware. To make program work you event don’t need to connect device to computer COM port. You can store images in other master MCU EEPROM memory Each received byte from UART is immediately sent to 8 LEDs, second byte to next 8 LEDs and so on. Bytes has to be sent one by one without delay. USART is working at 115200 baud, 8bits, no parity. ---------------------------------------------------------------------------------------------------------------------------------- THE PROBLEMS >1>I really dont know if the circuit is good or not tell me if it is going to work. >2>I cant get 8x8 dot matrix displays so i am going to normal leds to a 24x24 one. >3>I have never worked with bus before (the bold red lines in the circuit) so i dont know how to connect it. >4>The schems are segmented i am finding it hard to figure out how to connect some of the segments. >5>Also i need to know how to hook it up to my pc. >6>I have never done programming so i need to know how to program the ic. THANK YOU I couldnt get the images uploaded nicely so i linked them. 1 2  

Topic by science_freak    |  last reply

need help writing Arduino sketch for Nano to Adafruit FX mini soundboard communications?

Hello everyone.  I am new here, and fairly new to arduino. Im an electrician/ communications tech by trade, but have only been working with code as a hobby for a few weeks (have wanted to learn this for a long time).  I am working on a project that would require an Motion sensor input to play an audio track at random, whilst illuminating a corresponding PWM LED. said LED should fade in sync with the audio file. ITs a robot of sorts that will detect movement and speak a random audio track.  Some nice (0-5) and some not so nice (6-12).  it will have a a diffused glow when on, blue when speaking nice, and red when speaking not so nice.  hence the audio input to act as an anologRead and output to the PWM's I know, a lot to take on for a noob.  but go big or go home.  I have put together what I thought was a good start sketch, but it doesnt even illuminate an LED, communicate with the soundboard, or serial link on the monitor. I think I am on the right track in regards to the parts and overall Idea.  And im pretty sure my sketch needs a lot of work, but i am trying. so here are the parts I had intended to use. (if im going down the wrong path, or you see another way, feel free to say so.  I expect some criticism, I can handle it) Arduino elegoo Nano V3.0, CH340/ATmega328p Adafruit Audio FX Mini soundboard w/o amp Adafruit Mono 2.5W Class D amplifier (PAM8302) Sodial mini IR motion sensor module, 3-pin LED's are undecided for finished product, but i was thinking RGB 6302's (5-7) speaker is an 8 ohm 2W power will be supplied by a small 3.7v lipo (thats the plan) My wiring idea should be easily discernible from the sketch, but i can draw my idea, and add it if need be. I did install the soundboard _library. but thats the only one (didnt think i needed others) Any and ALL help is greatly appreciated. the sketch... [code] /*   Menu driven control of a sound board over UART.   Connect UG to ground to have the sound board boot into UART mode */ #include #include #define SFX_TX 9      // Defines pin D9 as TX to FX Mini #define SFX_RX 10     // Defines pin 10 as RX to FX Mini #define PLAYING 11    // Connect to the ACT pin on the FX Mini #define SFX_RST 13   // Connect to the RST pin on the FX Mini SoftwareSerial ss = SoftwareSerial(SFX_TX, SFX_RX);  // Passes Software Serial to FX Mini SoftwareSerial mySerial(SFX_RX, SFX_TX); Adafruit_Soundboard sfx = Adafruit_Soundboard(&ss;, NULL, SFX_RST); // can also try hardware serial with // Adafruit_Soundboard sfx = Adafruit_Soundboard(&Serial1;, NULL, SFX_RST); int incomingAudio;            // Audio input assigned from FX Mini Right audio output int RedLED = 5;         // the PWM pin the Red LED is attached to int BlueLED = 3;        // the PWM pin the Blue LED is attached to int LED = 4;            // the output the normal state LED is attached to int Button = 12;        // pushbutton test play track pin int Track = random(0,13);     int inputPin = 2;       // choose the input pin (for PIR sensor) int pirState = LOW;           // we start, assuming no motion detected int val = 0;                  // variable for reading the pin status void setup() {   Serial.begin(115200);         // softwareserial at 115200 baud   Serial.println("Adafruit Sound Board!");   ss.begin(115200);      pinMode(LED, OUTPUT);           // assigning LED as an output   pinMode(RedLED, OUTPUT);        // assigning RedLED as an output   pinMode(BlueLED, OUTPUT);       // assigning BlueLED as an output   pinMode(incomingAudio, INPUT);  // assigning incomingAudion as an input   pinMode(Button, INPUT);         // assigning Button as an input   pinMode(inputPin, INPUT);       // declare sensor as input   if (!sfx.reset()) {     Serial.println("Not found");     while (1);   }   Serial.println("SFX board found"); } void loop(){   digitalWrite(LED, HIGH);        // assigning LED to start with +5V   incomingAudio = analogRead(A0);               //read voltage at A0   incomingAudio = (incomingAudio+1)/4 - 1;      //scale from 10 bit (0-1023) to 8 bit (0-255)   if (incomingAudio<0){                         //deal with negative numbers     incomingAudio = 0;   }   PORTD = incomingAudio;   Serial.println(PORTD);   val = digitalRead(inputPin);                 // read input value    if (val == HIGH) {                          // check if the input is HIGH       sfx.playTrack(Track);       Serial.println(Track);       if (pirState == LOW) {                   // we have just turned on       Serial.println("Motion detected!");      // We only want to print on the output change, not state       pirState = HIGH;       }     }    else {       if (pirState == HIGH){                   // we have just turned of       Serial.println("Motion ended!");         // We only want to print on the output change, not state       pirState = LOW;     }   }     if (Button=HIGH){                             // pin D12 to button, ground thru 10K res, and +5v       sfx.playTrack(Track);       Serial.println(Track);       }   if (incomingAudio>=128 &&Track;>=0 &&Track;<=6){      digitalWrite(RedLED, incomingAudio-128);      digitalWrite(LED, LOW);      }   else if (incomingAudio>=128 &&Track;>=7 &&Track;<=12){      digitalWrite(BlueLED, incomingAudio-128);      digitalWrite(LED, LOW);      }   else{      digitalWrite(LED, HIGH);      digitalWrite(RedLED, LOW);      digitalWrite(BlueLED, LOW);      delay(15000);   } } [/code]

Question by supramp  

Momentary switch to Bluetooth

I'd like to make a number of smallish (say 0.75x1x2 inches) battery-powered Bluetooth boxes each of which connects to a momentary switch, and sends an RFCOMM or HID signal via Bluetooth on depression and another on release, and which will to communicate with an Android device. Because I want to make several of these, I want something super cheap and super simple to make.  (The purpose is to make a simple wireless touch detection system for foil and epee fencing. Without on-target detection, it's not going to be great, but it will be an improvement over refereeing fully dry bouts, since at least one will have proper impact and lockout timing.) Here are options I've been thinking about: 1. One thing that would *almost* do the job is to buy one of those $3-5 ebay Bluetooth phone camera remotes, and just wire my switch to it. The only problem is that according to the ads I've seen, these Bluetooth phone camera remotes go to sleep in 2-10 minutes when paired (exact timing seems to depend on the model), and I would really rather avoid this (the 10 minutes is almost acceptable). If anybody knows of a way of keeping them paired and awake for a longer period of time (say, 15 minutes or permanently), I would love to hear. This would be the cheapest and simplest solution, and it comes with a case and battery (some units are even USB chargeable).  2. On the other extreme of the price range, I happen to have some extra Brainlink modules with an atxmega and an RN-42 module inside, and it wouldn't take long to customize the firmware to do the job. But the modules sell for $39 (though sometimes on sale for $20), and that seems overkill for something so simple. And they are a touch larger than I like (about 3 inches diameter, and an awkward shape). 3. Another option might be to use a cheap serial Bluetooth module without additional hardware, and wire the switch directly to CTS. Unfortunately, I don't think the cheap HC-06 modules support CTS, though I think the HC-07 does support it (but I don't know if I can access it as it's probably not one of the pins on the header). Moreover, there are two unanswered questions on Stackexchange on how to access CTS/RTS status from Android, so this might require using a laptop as the base station (which isn't ideal). 4. A very cheap microcontroller with a UART (or just bit-banging) plus a cheap Bluetooth module. This increases the complexity of the project, but might be the way to go. More specific recommendations are welcome, as I have no experience with the hardware side of dealing with a microcontroller (on the software side, I've spent a fair amount of time tweaking the firmware of the Brainlink unit).

Topic by arpruss  

Rgb matrix, looking for some advice/guidance.?

Hi, its been quite some time since Ive been here. And I still have the same two projects in mind. However, the project im more focused on, is a 32x16 RGB led matrix. Made up of four sections. Im following the project by the two guys over at They arent very active and speak a different language so their english explanations arent as thorough as Im looking for so I figure id ask the people here :) So, the main questions I have: 1. What kind of material can I use to put the leds on? its like they use thick cardboard or wood. they drill all four holes per led so the legs go through. I want one big board instead of two.  2. What spacing would be good to make it look uniform, yet give enough space to solder?  3. How can I make the 4 controller boards to run it? - They sell them, but they arent cheap. And they dont deliver or sell to the US. So Ill have to make them somehow. I can provide images/part list of what they used.  4. What type of solder/soldering iron would I need? Obviously various temp. But what temps would be safe?  5. What power supply can I use? Ok so, any other info: -They used common anode LED's  -They connect the boards together via ethernet cable.  -They connect the led's together in four sections of 8x16, The anode is connected on each of the 8 rows. And the anodes on all the led's are connected on the 16 rows. If that doesnt make sense, the anodes are connected vertically, and all the cathodes are connected horizontally. -They connect the 48 cathode wires to ribbon cable, that goes to the controller board, same with the anode wires.   -They connect the boards to a Usb to UART connector -Lastly, Part list of one controller board:  HEXFET IRF7314 x4 TLC5940NT x 3 28 Pin IC-Socket 300mil x 4 Resistor SMD 0,25W 1% 10K x 10 Resistor SMD 0,25W 1% 2K2 x 8 Resistor SMD 0,25W 1% 2K x 3 Resistor SMD 0,25W 1% 220R x 2 Resisitor SMD 0,25W 1% 1K x 3 AtMega 328P x 1 74HC138 SMD x 1 Ceramic Capacitor 22pF, 20% x 2 Oscillator 16,0 MHz x 1 Pinheader 2x8 Pitch 2.54mm x 4 Jumper x 3 Pinheader 1x2 Pitch 2,54mm x 7 Modular Jack x 2 Ceramic Capacitor 100N, 20% x 5 Electrolytic Capacitor 680uF x 1 LED 5mm blue x 1 LED 5mm green x 1 Screw terminal 5.08mm x 1 If theres ANY more info required please ask. It said to be as detailed as possible.

Question by 'earl    |  last reply

MediaTek LinkIt ONE Giveaway

Update 12/21/15: REMINDER: The deadline for this promotion is midnight tonight (Pacific Standard Time). Once the form is turned off you cannot submit your project. You have to get your form in before midnight. Please make sure you are submitting completed projects will full directions, codes and schematics (when relevant), and pictures showing your MediaTek board being used to make your project (pictures of your MediaTek board are REQUIRED and entries will not get gift cards if there are no pictures showing the board being used). We have had A LOT of entries come in this weekend and today. We will be awarding gift cards for all outstanding entries tomorrow or letting you know if you do not qualify for a gift card. Questions can be directed to --------------------------------------------- The Instructables Community is really one of the most inspiring communities on the web. We are an international network of do-ers and educators. We share our knowledge about making the things we love, and have the opportunity to tell our unique stories of why and how along the way. Here at Instructables HQ, we have been having a lot of fun seeding the community with innovative hardware and tools to keep you, our authors, publishing amazing stories about what you love to make.  We are excited to announce that we have partnered with MediaTek to send the community 250 LinkIt ONE boards. We want to see what the Instructables authors are capable of making with these boards. But wait! There is more! Once you’ve received your board, and developed a project with it, publish it to Instructables to receive a $50 gift card to Amazon. Key features of the MediaTek LinkitONE: All-in-one features Includes ARM7 EJ-S™, GSM, GPRS, Wi-Fi, Bluetooth BR/EDR/BLE, GPS, Audio codec, and SD card connector on a single development board Rich-Compatibility Pin-out similar to Arduino boards, including Digital I/O, Analog I/O, PWM, I2C, SPI, UART and power supply, compatible with Grove 4-pin interface Strong Extensibility Provides various interfaces for connecting to most sensors, peripherals, Groves, and other widgets Easy Prototyping Using LinkIt ONE together with MediaTek LinkIt SDK (for Arduino) you will be able to easily turn your ideas into practical prototypes. Looking for creative examples of what has been made with the LinkIt ONE? Check out their hub over on How do you apply for a LinkIt ONE board? This product offering is limited, and we will be awarding boards to those who state their case as to why we should send them one. USE THIS FORM TO APPLY TO THIS OFFERING This application will close 9/14/15. **This giveaway is limited to one board per address. What happens once you have a LinkIt ONE board? Simply publish your Instructable using your LinkIt ONE to the site, and send us a link to your Instructable by 12/21/15 and we will add it to the MediaTek Collection on Instructables Homepage and email you your $50 gift card, what’s to lose? Instructables Authors CAN SUBMIT MORE THAN ONE PROJECT using the  LinkIt ONE Kit, and receive a $50 gift card for each project SUBMITTED! We believe in your awesome creative potential, and your devotion to share what you make with other makers and tinkerers. Can’t wait to see what you make! If you have any questions, please feel free to email us at

Topic by Penolopy Bulnick    |  last reply