Forum Replies Created
-
AuthorPosts
-
Did you put a solder blob across the pads of P3 on the back of the board? You’re using INT0 in the code, so you need to close the pads that connect the RTC interrupt signal to pin D2, and according to the Stalker 3.0 wiki, that is accomplished by shorting out P3. I have not used a Stalker 3.0, but I know on the Stalker 2.3, the board would go to sleep after one reading and never wake up again if I forgot to short that RTC INT0-D2 solder jumper.
I’m not sure why your code didn’t post correctly. Maybe because you attached it as a .ino file. Try just pasting it into the “code snippet” box when you’re typing a reply. Just hit the “Add Code Snippet” button in the row of buttons right above the text box, past your code into the window that pops up and choose “Arduino” from the Language drop-down menu so it formats the code properly.
Here’s some code that I used a long time ago when using the Maxbotix sensors with a Seeeduino Stalker. In the example, I connected the data line of the sensor to pin D7, then just connect the sensor to ground and its power to 3v3. Communicating with the Maxbotix sensor only uses pin 5, 6, and 7 on the sensor. The sensor outputs a digital string every second when it’s powered continuously. If you only want to take readings periodically, you can power the sensor momentarily with any of the free digital pins on the Stalker since the sensor only uses a few milliamps so the Arduino digital pins can source that. In the following example, it’s powered all the time.
Arduino1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071/* test function to Parse data from MaxSonar serial data and return integer */#include <SoftwareSerial.h>SoftwareSerial sonarSerial(7, -1); //define serial port for recieving databoolean stringComplete = false;void setup(){Serial.begin(9600); //start serial port for displaysonarSerial.begin(9600); //start serial port for maxSonardelay(100);}void loop(){int range = EZread();if(stringComplete){stringComplete = false; //reset sringComplete ready for next readingSerial.print("Range: ");Serial.println(range);Serial.println(" mm");delay(1000); //delay 1 second}}int EZread(){int result;char inData[6]; //char array to read data intoint index = 0;sonarSerial.flush(); // Clear cache ready for next readingwhile (stringComplete == false) {//Serial.print("reading "); //debug lineif (sonarSerial.available()){char rByte = sonarSerial.read(); //read serial input for "R" to mark start of dataif(rByte == 'R'){//Serial.println("rByte set");while (index < 5) //read next three character for range from sensor{if (sonarSerial.available()){inData[index] = sonarSerial.read();//Serial.println(inData[index]); //Debug lineindex++; // Increment where to write next}}inData[index] = 0x00; //add a padding byte at end for atoi() function}rByte = 0; //reset the rByte ready for next readingindex = 0; // Reset index ready for next readingstringComplete = true; // Set completion of read to trueresult = atoi(inData); // Changes string data into an integer for use}}return result;}I’m glad it worked. We’re working on switching out all of the Amazon inventory with new boards and we’ll be testing each of them first for proper battery connections. It can sometimes be hard to solder to a battery which is why I suggested doing the board first. The next run of boards will have a different battery holder and board footprint so this issue can be avoided.
I’ve got some sketches about sleeping the Mayfly, I’ll try to post them soon. I’ve got a backlog of software examples to post, but also dealing with hardware and inventory stuff, so we’re rather busy here. It’s helpful to get requests from people so I know where to concentrate my efforts. Thanks for the heads up about the battery issue.
DaveE, did you have a similar problem with your board?
I just did some more testing with a dozen boards. Out of all of them, I found one that exhibited behavior similar to yours. It looks like the green solder mask paint is thick enough on some boards that it is preventing the battery’s negative side from sitting completely flush against the circular ground pad on the Mayfly board. You can easily remedy this by adding a very small layer of solder to the circular pad, if you have a fine enough point on your soldering iron to reach the pad without creating a solder bridge to the metal of the battery connector above it. Or you can solder a very small drop of solder in the center of the battery, like in the attached photo.
Attachments:
I just posted a helpful serial communication sketch. Try that and see if it works for you.
Some Bee modules might need additional signals or control lines to work properly. That’s why many of the Bee socket’s pins are connected to some digital pins. For example:
Bee CTS –> D19
Bee RTS –> D20
Bee DTR –> D23
Bee RI or Assoc –> A5 (via SJ7)Check the Bee section on the schematic to see how it’s connected.
That’s odd that you measure 3v on the battery alone but nothing when it’s installed in the holder on the board. Even a mostly-dead battery should read something besides 0.000v. You usually only see that if there’s a short circuit somewhere on the board (which it doesn’t look like there is, from looking at the photos), but the battery would have been drained pretty quickly, and getting quite hot in the process, and definitely wouldn’t measure at 3v separately.
With the battery installed, measure the voltage at the two points shown by the red arrows in the attached picture. That’s the closest 2 points to the battery, so you should see something. If you’re not getting anything, make sure there’s not some tape or plastic anywhere on the battery or inside the holder on the Mayfly. Another thing to check is the shape of the battery. Is it perfectly flat on the negative (bottom) side, and if you set it down on a flat, level surface, can you tell that the battery is resting on only the negative terminal and the edges of the positive outer casing aren’t contacting the surface? What brand of battery is it? Some batteries can become misshapen or were manufactured wrong so they don’t make good contact with board in holders like these. Do you have an extra battery that you can try, or do you have more than one Mayfly board?
Attachments:
Can you take a focused picture of just the back of the board and one of the front?
I haven’t had any problems with the Mayfly boards not retaining the time. I just tested 2 boards that have been on my bench for several months without any external batteries (other than the CR1220) and they both still knew the correct date and time. I then got out 5 new boards, inserted new CR1220 batteries, and then programmed them with the sketch you linked to, first uploading the code with the correct date and time in line 11, then commenting out line 19 and reprogramming it so the board only prints the current date/time on powerup. Leaving the boards for anywhere from 5 to 15 minutes without any external power, then connecting the USB cable, opening the serial terminal, and they all retained the correct time.
I’ve attached a photo showing the proper orientation for how to insert the battery. Double-check that you inserted it correctly. You should also check the voltage of the battery to make sure it is at 3v. The easiest way to do that is to put one voltmeter lead on the top of the CR1220 battery holder (the positive side), and use the metal housing of the main microSD card socket for the ground. You should see around 3v. If not, then remove the battery and check it outside of the Mayfly. Let me know what you find out.
Attachments:
Yes, I’ve done a variety of power measurements with the Mayfly board, so I can publish a table showing the different options. I’ll put a link to it here when the page is posted.
The Atlas Scientific sensors work fine with 3.3v VCC, so just connect the 3.3v pin on the Mayfly header (either the D22 switched or the constant 3.3v VCC pin) to the Atlas board along with a ground line. Then choose 2 free digital pins for the comms, like 6 & 7 or 10 & 11, and edit the first few lines of the sample code to change from the pins 2 & 3 that’s shown in the demo.
-
AuthorPosts