10 votes

How do you handle sensor drift?

ok, once I got the idea I would need to do it in code, it became simpler to solve. In looking around the terms of quantization, the term thresh-holding came up, and I realized how to solve the problem....
j0h's user avatar
  • 882
6 votes

How do you handle sensor drift?

Remove the analog component from your device. Use a rotary encoder. It will sense the knob rotation digitally. One huge advantage is that you can easily select the sensitivity of the input. One click ...
jsotola's user avatar
  • 1,444
5 votes
Accepted

How can I generate a sinewave with Arduino Uno?

As far as I know, there is no library for Uno to generate such a signal (correct me if I'm wrong) You are wrong, there is Mozzi, the sound synthesis library for Arduino. It works essentially along ...
Edgar Bonet's user avatar
  • 42.7k
5 votes
Accepted

How do I make a proper long string scanner to detect specific tags in a stream of characters?

Another option is to not save the characters in buffer but instead check each one as they arrive to see if the character is the next in the tag sequence. This has the advantage that you don't need a ...
Craig's user avatar
  • 2,120
5 votes

How do you handle sensor drift?

Some methods for "dealing" with the noise: Take multiple samples. Calculate the average ("mean"). Discard the decimal. This is "oversampling" along with resolution ...
Majenko's user avatar
  • 105k
4 votes

Sum values, store them and print the last value

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 ...
SoreDakeNoKoto's user avatar
4 votes

How can I generate a sinewave with Arduino Uno?

There are two parts to this: One is the creation/derivation/storage of the digital representation of a sine wave. The other is the conversion of the digital representation of a sine wave to an analog ...
uint128_t's user avatar
  • 819
4 votes
Accepted

Sniffing RF signals

I'm adding another answer, because I don't think the core thing to grasp is mentioned, and others might benefit :) The noise you are seeing, is actually the result of a feature of the RXB6, KSA6, and ...
bluemind's user avatar
  • 306
4 votes

Why does void loop() stop after some samples?

float sine[5000] ... sine[j]=s+190; A float takes 4 bytes. You are allocating 5000 of them which is 20000 bytes. The Uno has 2048 bytes of RAM. Thus you are running out of RAM and overwriting ...
Nick Gammon's user avatar
  • 38.1k
4 votes
Accepted

How to determine when a sensor's output signal changes significantly?

There is no simple and universal way of deciding what is to be considered a “significant” change. My recommendation would be to create an algorithm by playing with the data on your computer: Upload a ...
Edgar Bonet's user avatar
  • 42.7k
3 votes

Does Atmega-2560 support image processing capability?

No. Your question really is: Can an 8-bit processor, running at 16 MHz, with 8 KB of RAM, do image processing at an acceptable rate? Unless you are talking about 10 pixels by 10 pixels, at a frame ...
Nick Gammon's user avatar
  • 38.1k
3 votes

High pass filtering accelerometer data on Arduino

This filter library is sensitive to the timing of you calling FilterOnePole::input(). It assumes that the delays between consecutive calls are the same as the delays between the samples being measured....
Edgar Bonet's user avatar
  • 42.7k
3 votes
Accepted

Connect function generator to Arduino

Confirm with an oscilloscope When I connect my function generator I usually always make sure that the output is in the range 0 to 5V, with my oscilloscope. The default is probably more like ±2.5V - ...
Nick Gammon's user avatar
  • 38.1k
2 votes
Accepted

Producing a sine wave with the DAC?

First, I have to say I am not familiar with the Zero hardware, so I am answering in quite general terms. Hopefully you will also get some answers with hardware-specific information. That being said, ...
Edgar Bonet's user avatar
  • 42.7k
2 votes

How can I generate a sinewave with Arduino Uno?

You can get a very fast, accurate, and compact sin(theta) function using a simple table of values. Just pull the code you need from the cordic.c here: https://people.sc.fsu.edu/~jburkardt/c_src/...
Douglas Daseeco's user avatar
2 votes
Accepted

How to vary the frequency of a PWM sinewave with arduino uno?

First thing, you must find a way to output the samples at a steady rate. Your best bet is to use a timer. Ideally, you want to use the same timer used for the PWM output, in order to have them ...
Edgar Bonet's user avatar
  • 42.7k
2 votes

The code fails to generate the values I want, when both trigger pins 2, 3 are high or low. Why?

To send anything to serial you need to initialize it first with: void setup() { Serial.begin(115200); //other code } And you are using wrong quotes for the string. They should be double ...
gre_gor's user avatar
  • 1,680
2 votes

Send big amouts of data to PHP script via gsm module SIM800L

Do you have any idea how I can send bigger amounts of data all at once? For energy saving purposes I would prefer if it would be possible in only a single request. Do a POST request. You can send ...
Majenko's user avatar
  • 105k
2 votes

Code exceeds Uno board memory

Probably you use too much SRAM memory: float arr[] seems to take 4 bytes (for float) * 128 = 512 bytes. Then you have vReal and `vImage which takes 4 (double, float/doubles are the same in Arduino) * ...
Michel Keijzers's user avatar
2 votes

Input Capture Mode PPM signal

Do I really have to set these during that part of the code? No, you don't. I would, however, change the order of the last initializations: Update TIFR1 right before TIMSK1 in order to avoid an ...
Edgar Bonet's user avatar
  • 42.7k
2 votes

How do you handle sensor drift?

I think you should handle the trailing comma within the Arduino by using leading commas instead, but omit the first leading comma using a flag to indicate the first coordinate: bool firstCoordinate; ...
tim's user avatar
  • 699
2 votes

Creating an AC pulse with arduino and perhaps components

Yes, you want a H-bridge. That is the simplest way to make that "negative*" voltage. But you can't just create a square wave and throw it blindly at a H-bridge, you have to be much more ...
Majenko's user avatar
  • 105k
1 vote

Reading Ground/Open signal wire combonations to power specific LED's - Can it be done?

First of all, Arduino is a 5V device, as such to drive the 9-12V LED you will need to use one or more transistors (depending on the LEDs type, number and connection, in series or in parallel). Also, ...
Roberto Lo Giacco's user avatar
1 vote
Accepted

Get pin input status without using the arduino library

For reading, e.g., PB2, you would test PINB & _BV(PB2) where PINB is the port input register and _BV(x) is a macro defined as (1 << (x)). C.f. the datasheet for the relevant port names. ...
Edgar Bonet's user avatar
  • 42.7k
1 vote

Sum values, store them and print the last value

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 ...
Edgar Bonet's user avatar
  • 42.7k
1 vote
Accepted

How the output of a bicycle dynamo can be displayed using Arduino?

The first thing to look at before you connect the bicycle dynamo to an Arduino is what type of signal / voltage it generates. The link you've provided: http://www.lanzo.se/experiments/dynamo/dynamo....
VE7JRO's user avatar
  • 2,557
1 vote

How the output of a bicycle dynamo can be displayed using Arduino?

It al depends on what is the maximum output of the dynamo. less than 5V (not likely): great just connect it directly with the Analog measuring pin of the Arduino (A1- A7) more than 5V: we got ...
RubenDefour's user avatar
1 vote
Accepted

How to send signal ONCE when within constant range of sensor?

You have to add a (global) variable that stores the last send command (to open/close). When you send a command, you save it in the global variable. And you only send a command when it is different ...
Michel Keijzers's user avatar
1 vote

Smooth out digital signal from SW-420 vibration sensor in order to record duration?

Should I approach this as an interrupt that uses a callback while loop, or would it be better to look at it as a typical debounce sub? No. If you want to use interrupts then just record the start ...
Majenko's user avatar
  • 105k
1 vote

Turning an LED on when an error occurs, then turn it off after 2 seconds

I have made it work now. The working code is as following, if anyone else gets the same issue. case microUSB: if ((Vcc_Ext_val > 50) && (USB_DP_VAL > 10) && (USB_DM_VAL > ...
Michael Falk Vedel's user avatar

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