New answers tagged

0

After reading through various arguments for use of different transfer functions, this is my summary: In order to achieve the manufacturer-stated absolute accuracy of ±2 LSB, you should use the manufacturer's equations and published guidelines on usage to ensure that accuracy (e.g. ensuring appropriate ADC clock speed / sampling time and implementing noise ...


2

the Atmega328P's datasheet, it indicates the conversion factor is 5V/1024 [...] Indeed. And the datasheet is the only authoritative source. All the other sources are second-guessing. If Vin and Vref are 5V, then the ADC reading would need to be 1024 in order to have a true reading of 5V You can't get a true reading of 5 V. As per the datasheet (...


2

As others have said, the difference between 1023 and 1024 is quite small. However, the fact is that your input range for the ADC is 0 to 1023. (That's 1024 steps, but since it starts at 0, it won't go up to 1024) You'll get 0 at the minimum input, and 1023 at the maximum value. If you're using a 5.0V reference voltage and no voltage dividers, that means ...


2

3 different ways to power the Mega2560 besides connecting to a PC: 7.5V to 12V 'wallwart' supplying DC to the barrel jack. 5V wallwart connected to the USB port. 5V wallwart connected to the 5V/Gnd pins on the Power header.


0

I assume you are powering the Nano through VIN or USB, and you are then powering the LED strip from the Nano's 5V pin. From the 12V battery the current flows through an LM1117 linear voltage regulator. Draw too much current (>800mA) and it will overheat and either shut down (if it's a good one) or melt (if it's an inferior Chinese clone). From USB the ...


0

Communicating and Encryption are to completely separate things. How you communicate (with what device) has no relevance to encryption. True, there are devices that can themselves encrypt data, but they tend to be higher-end or geared towards a specific purpose (such as WiFi). What you send is just data. What that data consists of is entirely up to you. If ...


1

I tried to understand your program and found quite a few issues, which I am listing below. This is more a general review than a specific answer. I hope it nevertheless helps you fix the code. The major issue is the logic of loop() being quite convoluted and hard to follow. My guess is that the issue you face is a direct consequence of this single problem. I ...


0

Which protocol to use to transmit data from Arduinos to the Raspberry Pi? Do I have to write code for both Arduino and Raspberry Pi or are there existing solutions which I can use for this purpose? Does MQTT, Node-RED or Node.js have any role in the above? I have searched, explored, read and found that MQTT can be used to send and receive data from ...


2

int sensor = 900; //variabel sensor void setup() { Serial.begin(9600); while (!Serial); randomSeed(analogRead(A0)); } int number() { int a = random(0, 10); //range pengurang nilai sensor int d = random(500, 1500); //range delay perubahan nilai if (sensor < 670) { sensor = 900; } sensor -= a; delay(d); ...


0

Here is is a picture of how I have seen the sensors connected. Is this how your is?


0

I will skip the RFID part, that is unrelated to the menu. What you can do is creating two variables: int menuLevel1 = 0; int menuLevel2 = 0; Assuming you have 2 levels, if you have more levels consider an array. Now you can print the screen based on the values of these two variables (use a switch statement for menuLevel1 which calls new functions, each ...


0

Just modify your UBS cable to not provide power.


1

It depends actually on your requirements what is 'best'. If (transmission) speed is an issue, there are mainly some things you can do to improve this: Increase the transmission speed (this depends on the distance of the wires and the noise). Decrease the start/stop bits (this reduces the certainty the values will arrive ok) Pack your data (takes more ...


1

digitalWrite(LMR.LOW); and digitalWrite(LMR.HIGH); Replace the period with a comma.


0

HC-05 modules use Serial (UART) for communication with the Arduino. Thus you need 4 Serial interfaces for 4 HC-05 modules. The Arduino Mega has 4 hardware Serial interfaces, so just connect once HC-05 to each Serial interface. Then handle each module in your code the same just with a different Serial interface. If you already know, how to use one HC-05, then ...


0

If you've come upon this page because the ESP8266 on your (WeMos) Mega wifi won't connect to your router (etc), check the age/security of your router: Wifi stopped connecting (Wemos D1 Mini) This line of code that allowed connecting with my old router: WiFi.enableInsecureWEP(); which also highlights that I should upgrade it...


0

If you're using Nick Gammon's programmer, the RESET signal to the target board comes from the Arduino programmer - from Pin 10. Read his instructions: https://www.gammon.com.au/bootloader You modify the 6 pin cable as shown on his website.


0

Battery powered devices need a system where the device checks over Internet connection (WiFi, mobile) if a new firmware bin file is available on a specific location on a server. If the bin file is available the device can download it and apply. One option how to apply the new bin is to use SD card and SD bootloader (Zevero avr_boot) The sketch saves the ...


3

There is a solution with SD card and SD bootloader. You put a bin file on SD card, insert it into the SD adapter and power up the Arduino. The bootloader loads the bin file to flash memory. I use 'avr_boot' SD bootloader by Zevero. It reads a file named firmware.bin from SD card if present and loads it into flash. To generate a bin file for Arduino AVR ...


-1

First you have to establish communication between Arduino and your computer. This communication could be wire (ex. LAN) or wireless. Like Juraj said, you could use ArduinoOTA with an additional WiFi or Ethernet module on your Arduino, as long as arduino is connected to the network and you know its address. I haven't tried it yet, so I don't know its ...


1

There is no specific piece of hardware that does what you ask. There are various options though: Write a new bootloader that uses the USB Host Shield to load data from a USB MSD device then flash it to the internal flash of the MCU (hard to do if you don't know low-level programming) Use an embedded Linux computer (Raspberry Pi, etc) to run avrdude and ...


0

unsigned long currentMillis = micros(); digitalWrite(Trig, LOW); if (currentMillis - previousMillis > 4) { digitalWrite(Trig, HIGH); previousMillis = currentMillis; } if (currentMillis - previousMillis > 12) { digitalWrite(Trig, LOW); previousMillis = currentMillis; } impulseTime = pulseIn(Echo, HIGH); distance_sm = impulseTime / 58; // ...


0

I cannot say much about the example code, that you mentioned. The posted example code is not complete, also the second part with the for loop is plain wrong. A for loop looks like this for(<Variable initialization>; <Condition for running the loop>; <Action done for every loop iteration>) So the condition in the middle is the condition ...


2

In your code you are using the measurement_finished variable as a flag, that a new measurement was finished inside the ISRs, so that it can be handled inside the loop() function. This is very useful. As I understood, an open circuit means, that no measurement can happen, since no pulses are created. So you need to check, how much time passed since the last ...


0

The first issue I can see is the use of delay() in your code. delay() is blocking code, so nothing else can happen while your Arduino is waiting for the delay time to elapse. The code should be re-witten to avoid the use of the delay function. Next issue is the power supply for your project. What kind of 9V battery are you using? Nowhere in your code do I ...


1

Well after more tinkering I found that the one change that fixed everything was simply this (in the if/else statements).....changing MIDI.sendNoteOn(notes[scaleIndex][columnIndex], 127, 1); to MIDI.sendNoteOn(notes[scaleIndex][0], 127, 1); [columnIndex] needs to be a [0], [1] or [2] representing one of three scales in the assigned array. This is fine as I'm ...


1

Ok i found the issue and the solution. For some reason it seems that while the MCU is running Setup(); hardware or software serial don't work properly. In my case i have code that set the SIM module to SMS mode and to send those messages to the serial port. For some reason it doesn't send them (or probably the module is not ready to accept them). ...


1

I am just learning this program so I could be way off on this and I apologize if I am. Instead of the loop inside of void setup() initialize each pin individually. Also you are telling the system to start the MIDI and set the pinMode 3 times. Inside the Void checkSensor function you set all the sensorHits every time the function runs, you might save a ...


1

For AI use there is the K210 based sipeed maix board. Dual core 400MHz, plus an AI coprocessor.


1

I may handle this case like using pyserial library I just log the data to my laptop and then using python to do your Advance AI code part. Send the sensor data as a combined String via Arduino serial port. read it using pyserial library add a data logging mechanism if you need or parallel process the data you gathered serially by cast them to their own data ...


2

It sounds like you need a lot of compute power. You can either put the sensors and AI on one device (and @majenko's suggestion of a Raspberry Pi would be a direction to pursue) or you need two devices, one to manage the data collection - Arduino, perhaps - and one to do the AI. We don't know enough about your post-processing and AI to make a good ...


0

I suggest that you use a different family of processor than the 8-bit AVR chips that are supported by the Arduino IDE (and please fix your spelling errors, all the double-letter words are very distracting). A good example might the the Teensy 3.2 or Teensy 3.6 offered here https://www.pjrc.com/ "Version 3.6 features a 32 bit 180 MHz ARM Cortex-M4 ...


0

It might be due to the command giving the nearest cell tower location. And for sending SMS it might be shifting to a different cell tower depending on your network. This could maybe be easily checked using a different cell provider or as you said its working at your home so I believe I am correct in assuming this is the answer


0

Try to use char pointer notation (char *) instead of array notation (char[]) in structure declaration: struct commands { int cmd; char* descr; }; OR - use struct declaration as-is, but change the array initialization like below: commands cmds[] = { {16, {"Hammond Organ"}}, {17, {"Percussive Organ"}}, {18, {"Rock Organ"}}, { 0, {...


2

There must be something wrong with the simulator you're using, because your code works for me (Arduino IDE 1.8.9, OSX, Arduino Uno). struct commands { int cmd; char descr[25]; }; commands cmds[] = { {16, "Hammond Organ"}, {17, "Percussive Organ"}, {18, "Rock Organ"}, { 0, "" } // end of list marker }; void setup(){ ...


0

I've actually done a good chunk of what you are looking for here: GPS Coordinates & Velocity: For this you can use the following Adafruit hardware: - GPS Breakout - GPS Adapter - GPS Antenna This sensor will give you the coordinates and the velocity when you use the Adafruit library. I would connect it using the i2c port and start with the example ...


1

Define 'lot of code', the Arduino Uno has 32 KB Flash, the Mega 256 KB. Define 'fast', the Uno/Mega are 16 MHz, the Due 48 MHz Three switches use 3 GPIO's, shouldn't be a problem on neither of them; the Mega has more GPIOs than the Uno, but both have plenty for your needs. The Ethernet shield are available for all three I don't know the 'bill acceptor', add ...


1

The Due, being ARM, is a von Neumann architecture. That means that it has no concept of "progmem", "near" or "far" pointers, etc. There are no _P or _PF variant functions, but the Arduino core provides simple stubs as a convenience. Instead all "flash" memory access is just simple memory accesses using const. The best thing you can do is to use ...


0

So, it turns out that the problem was located squarely between the programmer's ears, as usual. As part of another experiment to use an I2C sniffer program to find out why the MPU6050 was failing intermittently, I had added the following line to my setup() function Wire.setClock(50000); To slow the I2C clock down enough so that a sniffer program could ...


0

I managed to find the bug and fix it. I was missing that after the reset pulse the master must be in RX mode for atleast 480us no matter what, even if the presence pulse did occur and even if it's rising Edge did appear already. This mistiming did lead to the missing bits that were corrected with sending more bits until now (which in turn lead to the ...


Top 50 recent answers are included