Show Posts
Pages: [1] 2 3 ... 30
1  Using Arduino / Networking, Protocols, and Devices / Re: How can I test this serial BlueTooth module? on: March 12, 2014, 09:39:46 pm
On the face of it, your 7805 power supply seems reasonable, but I am more interested in you running off the Uno's 5v pin, with the Uno properly fed, in the normal manner.

I did that first, and only went to the 7805 when I got the same results.

It seems to me that there would be a problem with the serial stuff on the BT module. I am finding that even if I disconnect bluetooth from the phone and the bluetooth module starts blinking as it normally does when it is not connected, it keeps doing the loop thing. Or even if I start it without connecting the BT to the phone. Something must be wrong with the serial board, I don't see any other way around it.

Aha! I found it!

This site shows the RX and TX of the BT module. Looking at those pins on mine, they are bridged with solder.



I soaked up the bride and now it works with the UNO! Now I can try again on the flight controller.

edit: and it works on the copter finally. Man am I relieved. Thanks for your help.
2  Using Arduino / Networking, Protocols, and Devices / Re: How can I test this serial BlueTooth module? on: March 12, 2014, 08:27:57 pm
Ok, just to be perfectly sure I am powering the BT module by itself with a 7805, a 10uF cap on the input and output and a 12v 2A wall adapter. The grounds of the BT/7805 and the arduino are connected. The 7805 is not getting more than warmish. (I also tried just plugging the wall adapter into the arduino DC jack and powering the BT from the 5v arduino line). I get the same issue: With resistors I can send text from the android terminal to the arduino but nothing from the arduino. Without the resistors it spits out the Setup() text over and over. I added this to the Setup()


Every time I restart it gives me a different number as expected. But this repeated text is the same number over and over. So I don't think the arduino is restarting, I think it is some kind of feedback.

I heard you say:
OK then, you first, say something.....
Go on, type something id hit Send,
or just hit the Enter key

I heard you say:
OK then, you first, say something.....
Go on, type something id hit Send,
or just hit the Enter key

I heard you say:
OK then, you first, say something.....
Go on, type something id hit Send,
or just hit the Enter key

This also appears on the android terminal.

What else is troubling is that if I reverse the RX and TX lines I get the EXACT same results. With and without resistors. Powering the BT module on its own.
3  Using Arduino / Networking, Protocols, and Devices / Re: How can I test this serial BlueTooth module? on: March 12, 2014, 03:41:57 pm
The resistors were in the PDF you linked, that's why I tried. It pulls down to ground actually, so I should have said pulldown resistors. Whatever the case, I tried with and without them. Without the the resistors it acts like there's feedback and it sends the text over and over.

I am using "Bluetooth Terminal" on a Galaxy S4, CM10.2. I am certain that I am connected to the module because I do get some communication, but it is erratic as I have explained.
4  Using Arduino / Networking, Protocols, and Devices / Re: How can I test this serial BlueTooth module? on: March 12, 2014, 01:51:44 am
Is it supposed to be sending that text in Setup() to my phone? Because it doesn't. It does receive text from the phone. The only way I get text on the phone from the arduino code is if I don't use the pullup resistor and just connect it directly. But then it goes nuts, like some kind of loop feedback and keeps printing those Setup() messages over and over.
5  Using Arduino / Networking, Protocols, and Devices / How can I test this serial BlueTooth module? on: March 11, 2014, 03:01:24 am
I got a bluetooth module for my HobbyKing MultiWii 328 quadcopter board but it simply doesn't work despite my trying everything I can imagine. My phone will connect to the module but I get no data, not even a raw stream.

I tried connecting it to my UNO to see if it was faulty and I am not sure about the results. I can only send data from the phone if I don't set up Serial in the arduino sketch, and just use the window to listen. If I set up Serial so that I can send to the phone, it works, but then I can't send from the phone anymore, even using the serial read example. Then in both situation, reversing RX and TX doesn't seem to change anything. If I try to use serial read and write in the same sketch they seem to interfere with each other. I have everything set to 115200.

Using just the phone, with the BT module powered, but RX and TX not connected, it acts like it's looped back, even though I haven't looped RX and TX.

So rather than guessing, how can I determine for sure if this thing is faulty?
6  Using Arduino / Programming Questions / How to drive 433MHz transmitter without library on: February 24, 2014, 12:42:23 am
I have no trouble with my 433MHz transmitter, but I would like to know how to drive it without a library. Basically I want to know how it actually works and not just rely on the library. But of course whenever I google it, I just find people talking about how to use the libraries.
7  Using Arduino / Displays / Re: Touch LCD clone looks weird unless resetting on: February 11, 2014, 12:08:50 am
Here is the exact code, I've only modified it to load one image at startup:
#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_TFTLCD.h> // Hardware-specific library
#include <SD.h>

// The control pins for the LCD can be assigned to any digital or
// analog pins...but we'll use the analog pins as this allows us to
// double up the pins with the touch screen (see the TFT paint example).
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0

// When using the BREAKOUT BOARD only, use these 8 data lines to the LCD:
// For the Arduino Uno, Duemilanove, Diecimila, etc.:
//   D0 connects to digital pin 8  (Notice these are
//   D1 connects to digital pin 9   NOT in order!)
//   D2 connects to digital pin 2
//   D3 connects to digital pin 3
//   D4 connects to digital pin 4
//   D5 connects to digital pin 5
//   D6 connects to digital pin 6
//   D7 connects to digital pin 7
// For the Arduino Mega, use digital pins 22 through 29
// (on the 2-row header at the end of the board).

// For Arduino Uno/Duemilanove, etc
//  connect the SD card with DI going to pin 11, DO going to pin 12 and SCK going to pin 13 (standard)
//  Then pin 10 goes to CS (or whatever you have set up)
#define SD_CS 10     // Set the chip select line to whatever you use (10 doesnt conflict with the library)

// In the SD card, place 24 bit color BMP files (be sure they are 24-bit!)
// There are examples in the sketch folder

// our TFT wiring
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, A4);

void setup()


  uint16_t identifier = tft.readID();

  if(identifier == 0x9325) {
    Serial.println(F("Found ILI9325 LCD driver"));
  } else if(identifier == 0x9328) {
    Serial.println(F("Found ILI9328 LCD driver"));
  } else if(identifier == 0x7575) {
    Serial.println(F("Found HX8347G LCD driver"));
  } else {
    Serial.print(F("Unknown LCD driver chip: "));
    Serial.println(identifier, HEX);
    Serial.println(F("If using the Adafruit 2.8\" TFT Arduino shield, the line:"));
    Serial.println(F("  #define USE_ADAFRUIT_SHIELD_PINOUT"));
    Serial.println(F("should appear in the library header (Adafruit_TFT.h)."));
    Serial.println(F("If using the breakout board, it should NOT be #defined!"));
    Serial.println(F("Also if using the breakout, double-check that all wiring"));
    Serial.println(F("matches the tutorial."));


  Serial.print(F("Initializing SD card..."));
  if (!SD.begin(SD_CS)) {
  bmpDraw("woof.bmp", 0, 0);

void loop()


// This function opens a Windows Bitmap (BMP) file and
// displays it at the given coordinates.  It's sped up
// by reading many pixels worth of data at a time
// (rather than pixel by pixel).  Increasing the buffer
// size takes more of the Arduino's precious RAM but
// makes loading a little faster.  20 pixels seems a
// good balance.

#define BUFFPIXEL 20

void bmpDraw(char *filename, int x, int y) {

  File     bmpFile;
  int      bmpWidth, bmpHeight;   // W+H in pixels
  uint8_t  bmpDepth;              // Bit depth (currently must be 24)
  uint32_t bmpImageoffset;        // Start of image data in file
  uint32_t rowSize;               // Not always = bmpWidth; may have padding
  uint8_t  sdbuffer[3*BUFFPIXEL]; // pixel in buffer (R+G+B per pixel)
  uint16_t lcdbuffer[BUFFPIXEL];  // pixel out buffer (16-bit per pixel)
  uint8_t  buffidx = sizeof(sdbuffer); // Current position in sdbuffer
  boolean  goodBmp = false;       // Set to true on valid header parse
  boolean  flip    = true;        // BMP is stored bottom-to-top
  int      w, h, row, col;
  uint8_t  r, g, b;
  uint32_t pos = 0, startTime = millis();
  uint8_t  lcdidx = 0;
  boolean  first = true;

  if((x >= tft.width()) || (y >= tft.height())) return;

  Serial.print(F("Loading image '"));
  // Open requested file on SD card
  if ((bmpFile = == NULL) {
    Serial.println(F("File not found"));

  // Parse BMP header
  if(read16(bmpFile) == 0x4D42) { // BMP signature
    Serial.println(F("File size: ")); Serial.println(read32(bmpFile));
    (void)read32(bmpFile); // Read & ignore creator bytes
    bmpImageoffset = read32(bmpFile); // Start of image data
    Serial.print(F("Image Offset: ")); Serial.println(bmpImageoffset, DEC);
    // Read DIB header
    Serial.print(F("Header size: ")); Serial.println(read32(bmpFile));
    bmpWidth  = read32(bmpFile);
    bmpHeight = read32(bmpFile);
    if(read16(bmpFile) == 1) { // # planes -- must be '1'
      bmpDepth = read16(bmpFile); // bits per pixel
      Serial.print(F("Bit Depth: ")); Serial.println(bmpDepth);
      if((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed

        goodBmp = true; // Supported BMP format -- proceed!
        Serial.print(F("Image size: "));

        // BMP rows are padded (if needed) to 4-byte boundary
        rowSize = (bmpWidth * 3 + 3) & ~3;

        // If bmpHeight is negative, image is in top-down order.
        // This is not canon but has been observed in the wild.
        if(bmpHeight < 0) {
          bmpHeight = -bmpHeight;
          flip      = false;

        // Crop area to be loaded
        w = bmpWidth;
        h = bmpHeight;
        if((x+w-1) >= tft.width())  w = tft.width()  - x;
        if((y+h-1) >= tft.height()) h = tft.height() - y;

        // Set TFT address window to clipped image bounds
        tft.setAddrWindow(x, y, x+w-1, y+h-1);

        for (row=0; row<h; row++) { // For each scanline...
          // Seek to start of scan line.  It might seem labor-
          // intensive to be doing this on every line, but this
          // method covers a lot of gritty details like cropping
          // and scanline padding.  Also, the seek only takes
          // place if the file position actually needs to change
          // (avoids a lot of cluster math in SD library).
          if(flip) // Bitmap is stored bottom-to-top order (normal BMP)
            pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
          else     // Bitmap is stored top-to-bottom
            pos = bmpImageoffset + row * rowSize;
          if(bmpFile.position() != pos) { // Need seek?
            buffidx = sizeof(sdbuffer); // Force buffer reload

          for (col=0; col<w; col++) { // For each column...
            // Time to read more pixel data?
            if (buffidx >= sizeof(sdbuffer)) { // Indeed
              // Push LCD buffer to the display first
              if(lcdidx > 0) {
                tft.pushColors(lcdbuffer, lcdidx, first);
                lcdidx = 0;
                first  = false;
    , sizeof(sdbuffer));
              buffidx = 0; // Set index to beginning

            // Convert pixel from BMP to TFT format
            b = sdbuffer[buffidx++];
            g = sdbuffer[buffidx++];
            r = sdbuffer[buffidx++];
            lcdbuffer[lcdidx++] = tft.color565(r,g,b);
          } // end pixel
        } // end scanline
        // Write any remaining data to LCD
        if(lcdidx > 0) {
          tft.pushColors(lcdbuffer, lcdidx, first);
        Serial.print(F("Loaded in "));
        Serial.print(millis() - startTime);
        Serial.println(" ms");
      } // end goodBmp

  if(!goodBmp) Serial.println(F("BMP format not recognized."));

// These read 16- and 32-bit types from the SD card file.
// BMP data is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.

uint16_t read16(File f) {
  uint16_t result;
  ((uint8_t *)&result)[0] =; // LSB
  ((uint8_t *)&result)[1] =; // MSB
  return result;

uint32_t read32(File f) {
  uint32_t result;
  ((uint8_t *)&result)[0] =; // LSB
  ((uint8_t *)&result)[1] =;
  ((uint8_t *)&result)[2] =;
  ((uint8_t *)&result)[3] =; // MSB
  return result;
8  Using Arduino / Displays / Touch LCD clone looks weird unless resetting on: February 11, 2014, 12:08:31 am
I got this touch LCD clone and I am using the Adafruit TFTLCD tftbmp library/example. The tftbmp_shield example does not work, I assume something to do with pin locations.

Anyway, the screen has weird contrast and seems sort of dim until I hit the reset button. Then it looks great until it restarts and it goes back to looking weird.

Notice how there's the bright blotch in the sky and the pelican is very dark, that is really exaggerated in person. When I hit reset it looks a little washed out in the video but it looks perfect in person.

The same thing happens even if I power it externally with a good quality power adapter. I realize that it being a clone there's a million things that could be wrong but I am hoping that since it is fixed while resetting there is some way to narrow down the problem. What is different while the arduino is about to reset that could be causing thing?
9  Community / Website and Forum / Re: Change email on: June 17, 2013, 02:36:33 am
Sorry, figured it out. It seems odd that you have to do it through the main site and can't through the forum.
10  Community / Website and Forum / Change email on: June 17, 2013, 02:23:39 am
I cannot seem to find where to change my email address for this forum. I need to abandon my yahoo address due to tons of security issues lately.
11  Using Arduino / Project Guidance / Re: ARDUINO POOL ALARM... on: June 12, 2013, 05:34:29 pm
Hate to be another nay sayer but I don't even trust my fish with my electronic competence. Make sure that you keep in mind that anything you make will be a trivial project for fun and should never be considered an actual safety tool.
12  Using Arduino / Project Guidance / Re: Automobile blinker lights on: June 07, 2013, 07:43:48 pm
Why can you not just wire the front blinkers to the back blinkers?
13  Using Arduino / Project Guidance / Re: Lots of cheap solenoids or something similar on: May 31, 2013, 02:22:16 pm
It would have to go down to less than a dollar before I could consider buying what I need. Even making them myself I have to be really cautious with what I pick.

 Found a few different sizes nails, even some really big ones for pretty cheap and some new thread spools that are longer and should allow larger nails to pass through. If the nails are too heavy I might make the solenoids the moving part.
14  Using Arduino / Project Guidance / Re: Lots of cheap solenoids or something similar on: May 30, 2013, 04:08:23 pm
Yeah I considered that but I want sure how big I could find them and how magnetic they would be. I got good pull on a screw driver, I don't know how well a nail might do. I'll go see whati can find.
15  Using Arduino / Project Guidance / Re: Lots of cheap solenoids or something similar on: May 30, 2013, 02:56:04 am
I think we are talking about two completely different things. It sounds like you are talking about the shape of the solenoid. The shape I'm using is simply because of what I found that I can test with. That's all I have to work with right now.

I'm talking about the actuating rod. I'm wanting to know if I should just use a ferrous rod as is normally in a solenoid or if a small neodymium magnet could be used instead. Getting a bunch of ferrous metal rods would be difficult and I don't really have a way to cut them.

It would be ideal to just use small magnets and have wood actuating rods. It would also seem to me that even though the magnet would be much much smaller, since it has its own magnetic field it should align with the solenoid with a great deal of force but I have none that fit into my solenoid so I can't test it.

I don't know if that is true though. That is my question. Will a just a small neodymium magnet attract the solenoid as well as a large temporarily magnetized rod?
Pages: [1] 2 3 ... 30