11

OK. So, I tried the SDFat lib. This library is definitely better than the default SD library that comes with adruino. But that is not how I solved my problem of low data-rate. I followed the instruction of the author of SDFat library from this post. According to fat16lib, to increase the data rate we need to use flush() wisely. We would want to write() the ...


7

You are saving a String object in EEPROM, which is useless. A string object does not store the contents of your string. Instead, it just stores: the memory address where the actual contents (the characters) is stored the amount of memory allocated for this contents the number of characters that actually make the string This is what you are storing to, and ...


6

So, the first consideration goes to the radio propagation aspect. Every country does things a little different with their radio clocks. And you might only have good signal a few times a day. For a nice overview, check out a solution for the German DCF77. If you're totally set on using a radio clock, time-nuts has discussed in the past ripping open a $10ish ...


4

It's possible if you forget about the Arduino directly writing to the database. Simply put, the Arduino is restricted to a serial connection. To directly communicate with MySQL you would need a network connection, and then implement the MySQL protocol - a huuuge amount of work. The normal way is to have an adapter program running on the PC which receives ...


4

My question here is how can I simultaneously read out all the data from the different serial ports on the arduino mega sketch. As you are using several serial ports data can already be received simultaneously. Each serial software class (Serial1, Serial2, Serial3) has an internal buffer where data is stored until it is read. You only need to read the data ...


4

I'm somewhat confused by the flow of your program, so instead I will tell you how I would handle the data. You have a single-byte header, then 7 bytes of data, followed by a single byte checksum. PySerial's read is (I believe) blocking by default, so it's simple to read the next serial character - unlike an Arduino. It also has a "multi-byte" read version ...


4

Many factors would decide if you can reach this wanted speed. Only some of these. 1. Your Software The SdFat Library is faster than the standard SD Library of the Arduino IDE. It also has an easy to use compatibility function with the standard SD Library. Try it out. 2. Your Hardware You should use a high class SD Card. As you maybe know SD Cards are ...


4

Avoid the handshake getting a buffer! Use SD.write(buf,size); Hi every one, I'm working in a project with the same issue. I was following the same steps of yours and got exactly the same numbers. I've just fixed it out. The problem is the handshake when you call the SD.write(). Instead: //for each loop, it is going to make a handshake while(<...


4

What you want to do is integrate the flow rate vs time curve. You have to keep track of the current flow rate. You also need to choose some unit of time measurement; this depends on how often you're sampling the flow rate. For instance, if you sample it every second, then you should convert your L/hr flow rate to L/s. This means a flow rate of 10L/hr is ...


4

There are fairly inexpensive chips called "analog multiplexers" which let you choose one input out of a range (8 or 16 is typical). You could take the reading, then switch to a different input, and take another reading. I have a page about analog multiplexers. Example of it in operation: In this example you have 8 inputs, and by setting the A/B/C pins ...


4

Yes you can. This Arduino IDE add on lets you make calls to code store in the bootload of memory so you can make changes to the flash memory. https://majek.sh/en/writing-to-internal-flash-on-arduino/ The number of times you rewrite a cell are limited. I'd suggest you are better off with adding a FRAM memory chip. Get a 5V part with SPI interface. Fast reads,...


4

Some tips: Do not open the open and close the file in every loop sequence (I think you can use the flush command to save/update the file. Do not save strings, but save the raw data and pulse string. This will take 16 * 2 (raw data + 3 bytes for the pulse data = 35 bytes per 16 samples, meaning 35 bytes/samples * 20 samples/s = 700 bytes (I think your ...


3

When I store it in the EEPROM, the extra time required to find it in EEPROM, pull it through the sketch, and then push it through to the db corrupts the data sourced from EEPROM and posts a jumbled mess of characters...if it even makes it to the db at all. Are you certain of that? It is incredibly unlikely that mere time will corrupt characters and data as ...


3

Open-source is just great. Lets have a look at the source code for SD. Here is what happens on write of a block. /** * Write data to an open file. * * \note Data is moved to the cache but may not be written to the * storage device until sync() is called. * * \param[in] buf Pointer to the location of the data to be written. * * \param[in] nbyte ...


3

You can do that using an Arduino Yun: the Yun has a linux cpu paired with the ATMega32U4, so you can delegate things like accessing a mysql database, either local or remote. Take a look at this instructable. There are different ways for delegating logging sensors readings to the linux side and have them stored on a mysql: the easiest is to code a short ...


3

I don't think you need a file system: that is usually needed when you want to manage many files. Your weather data log sounds like a single file. What you seem to need is to access EEPROM as a stream, exactly like you would for an open file. There are stream wrappers around some EEPROM libraries, e.g. this one for ESP. I suggest you check it out and see if ...


3

We've been maintaining a network of loggers (60+ currently deployed) using SD card connected directly to the SPI pins (see: http://www.mdpi.com/1424-8220/18/2/530 for details) and our experience is that the SD cards are really reliable provided you don't have a brown-out when they are writing, even when we abuse them with hot surface deployments in the ...


3

the ADC is LTC1859 and triggers on the slave select falling edge. No, it doesn't. Here is a link to its datasheet. It has a pin labeled CONVST, for “conversion start”. According to the section Pin functions, “This active high signal starts a conversion on its rising edge.” If you want your sampling to be at 2 kHz with cycle-accurate timings, you have ...


3

The answer is "yes, you can use extra AVR Flash memory as non-volatile EEPROM-like Flash memory storage, very similar to an STM32 microcontroller." One of these days I'm going to write an Arduino library to make this really easy for the beginner. For now, however, I'm going to simply post links to valuable references that contain the full answers and that I ...


3

The key is that the menu code must never wait as the operateMainMenu() function does. Instead, it has to test the buttons, do a required task, if any, quickly, and return. This means it depends on being called very frequently so it can respond to the buttons quickly, but also must return quickly when there is nothing to do. You make those calls from your ...


3

Just to have the full working code, I ended up with this: #include <EEPROM.h> char serial_characters[] = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"}; // 7 chars for serial and one for string end '\0' char serial_number[8]; void setup() { Serial.begin(115200); EEPROM.get(0, serial_number); // check found format if (serial_number[0] == 'S' &...


2

There are two basic things wrong with your code. First is the formatting of your headers - you have mistakenly used client.println for sending the first part of the Host: header, so it becomes split onto two lines: client.println( "Host:" ); client.println(server); Secondly you are using the server's IP address instead of the actual host name in the Host: ...


2

Where are you brining the power onto the Arduino board? If you bring it in through the external power connector you need to account for the voltage needed to run the regulator. You might be running into problems with low voltage and some part of your system that is sensitive to it. You could try bring the power in on the 5 V pin, but then you are taking ...


2

In the function ISR(ADC_vect) { the variable d contains the current sample: // Read ADC data. #if RECORD_EIGHT_BITS uint8_t d = ADCH; #else // RECORD_EIGHT_BITS // This will access ADCL first. uint16_t d = ADC; #endif // RECORD_EIGHT_BITS So you can just "do something" depending on what is in d. Of course, since this is a timer interrupt you ...


2

The problem was indeed a question of voltage. I was using the battery to supply 5 volts to the DC power port, which as suggested by the comments needs 7 volts or more. The problem is fixed by using the battery, which supplies a stable 5V, to give power to the USB port (or, presumably the 5V pin, though that is not available in my application).


2

The solution turned out to be a couple of things, some of which mentioned by others in the comments. Problems that needed to be fixed: My level-shifter was a huge part of the problem. I switched to a MAX232-based chip and then I was a least able to get responses shorted lines 2 and 3 (Tx and Rx). I needed a cross-over cable. I had tried this while ...


2

In a recent comment, you posted a link to a forum thread with the code for reading the sensor. You should have provided this information up front, because it completely changes the problem. It appears that the flow meter sends pulses at a frequency proportional to the volume flow, and the code uses an interrupt to count the pulses over a specified time. ...


2

Here is a program I wrote that follows an approach somewhat similar to Michael Stachowsky's answer: The ADC is configured with the prescaler set to 128 (just like the Arduino core does), which gives a 104 µs conversion time, significantly shorter than the 250 µs sampling period you want. The first conversion takes longer, and it is discarded. It ...


2

Are you referring to this? That is a shield that has an SD card interface (with appropriate level-shifting for the SD card) plus a real-time clock. The rest is "prototyping" area for you to install your own devices. In order to play an audio file, I was suggested to get an Adafruit data logger I don't see how this helps play audio files, however you ...


2

As suggested in the comments, you have two options: As suggested by Majenko, you can use the Arduino USB Host Shield: Alternatively you could use a PS2 keyboard instead (as suggested by Gerben). Arduino already has a library to handle PS2 keyboards, so the implementation of it would be easy. For reference (and example program) playground.arduino.cc/Main/...


Only top voted, non community-wiki answers of a minimum length are eligible