New answers tagged

0

That is operating as expected. Take a look at the data sheet. You can lose 1.8 volt on each output pin. Since you are in bridge configuration you now lose 3.6 Volts. Now assume your power is 6VDC with 1 volt ripple. That adds to the voltage drop through the driver so rounding it out you lose 4 volts from your supply (not counting wiring loses) before you ...


0

I expect you have a lot going on with your design. Dividing down is never a good voltage (power) supply regardless of what you measure unless you are using a good scope to measure and it is well bypassed. Consider a Buck regulator from one of the China suppliers they are just a few bucks and will stabilize your circuit. If the prox sensor draws just a few ...


0

no pinMode(firstMotorNegative, OUTPUT) Well, here's a start at least: pinMode(firstMotorPositive, OUTPUT); pinMode(secondMotorPositive, OUTPUT); // <------ pinMode(enableFirstMotor, OUTPUT); pinMode(secondMotorPositive, OUTPUT); pinMode(secondMotorNegative, OUTPUT); pinMode(enableSecondMotor, OUTPUT); You are never setting firstMotorNegative to OUTPUT ...


1

The number is as many as you want. There are switches that allow you to select different busses and each buss supports its full complement. From my point you are trying to use a solution before you have defined the problem fully. I have a feeling they will not be within a few inches of each other so consider an alternative designed for this type of use. CAN,...


1

I will add my little drop of experience here... So I am using a display tm1637, having CLK in 6 and DIO in 5. When connecting the Battery (12V 3s lipo 4000mA) to Vin, the arduino will freeze, even connected to the USB, will still freeze. Short version, Moving DIO from 5 to 7 corrected the problem, now i have my device running from USB and or battery with ...


1

The L2978D is a terrible motor driver (I really wish people wouldn't use it!). It is "bipolar" which means that both the high and low side switches of the H-bridge are Bipolar Junction Transistors. This means that you get about 1.4V voltage drop in total between the inputs and outputs. To counter that you must provide at least 1.4V more than your ...


0

This is NOT an answer to the question, but I did some (major) refactoring which make it much more clear what is happening. I think you made some mistake within the (refactored) method Sensor::UpdateState. File <.ino>: #include "Sensors.h" Sensors _sensors; void setup() { Serial.begin (9600); _sensors.Init(); } void loop() { ...


3

The limiting factor is the bus capacitance. This is the limit of the total capacitance of the bus from all devices connected to it plus the capacitance of the wires used. It is also affected by the value of the pullup resistors. The limit, according to the specifications, is 400pF. An Arduino has an input capacitance of 10pF. So ignoring the wires that's ...


0

Welcome to this site, next time use ctrl-k to align your code. The problem is in: Serial.print(mfrc522.uid.uidByte{i} < 0x10 ? " 0" : " "); To get the value of an array, use [i], not {i}, thus Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "); (similar to other lines). To give some additional hints: Try ...


1

change the MCU, that arduino is a chinese version. Use a original or other original board. I had the same problem with two diferents projects, and it happend the same to me. One with ultrasonic and other with RF24 module. In both projects, some really extrange things happens. But when i change for one original arduino, everything works perfect.


1

Consider backing away from Arduino hardware for just a moment I want to call them “words”, but I’m uncertain ... For most computers and processors a word is comprised of bytes and bytes are comprised of bits. A bit is an individual 0 or 1. That's always true. A byte is almost always made up of 8 bits. Why? Because it is always convenient to do things ...


1

when you try to change the signature there are 2 areas where the code 1E 95 0F is displayed. If you try changing the signature in the wrong position, then will it show the error message 'microcontroller not found'. I did the same mistake once. I would suggest you rely on the find option in the Edit menu and search for the code. Edit > Find > Search 1E ...


2

Here is a simplistic diagram. Larger than 8 bits is usually referred to as WORD.


5

Voltage Drop Well, if you put 5V into your barrel jack, your UNO's onboard 5V regulator is going to drop that down to 3.5V or so. You must have more than 5V into the regulator to get 5V out of it. This is referred to as the regulator's "drop out" voltage. The specs for an UNO say to power it from at least 7V for that reason. As an experiment you ...


1

Your code is rather hard to follow. Your code to read a button press doesn't make much sense: buttonPoll = digitalRead(button); //Detect the state of the button if (buttonPoll == 1) { //Check if the button pressed delay (50); //Delay 50ms buttonPoll = digitalRead (button); //Poll button again if (buttonPoll =...


0

for a polling serial read I use this method : bool tSim8_sendCommand(uint8_t sim_cmd[]) { uint8_t simOK[2] = {0}, i=20; tSoftSerial1_write(sim_cmd); tSoftSerial1_write("\r\n"); while (i--) { simOK[0] = simOK[1]; simOK[1] = tSoftSerial1_readChar(); if(simOK[0] == 'O' || simOK[1] =='K') { ...


0

Assuming the - of the power supply is connected to ground your circuit becomes an emitter follower utilizing a Darlington transistor. In that case the emitter will have the same voltage as the base - the VBE which is about 5 Volts. If you reverse it, you will need about 5 volts VBE to turn it on. Note since it is a transistor there is no protection diode. ...


5

You seemed to have solved it. For the reason, take a look at the compiler errors: sketch_nov22a:31: error: jump to case label [-fpermissive] case 'M': ^ sketch_nov22a:25: error: crosses initialization of 'int reading' int reading = moist_sensor.readd(); //THE PROBLEMATIC LINE ^ sketch_nov22a:38: error: jump to ...


4

As soon as I posted this, I looked at the variable declaration inside the case and thought I'd fix this ugly code, and turns out that is what breaks the entire thing, I had no idea... case 'E': int reading = moist_sensor.readd(); //THE PROBLEMATIC LINE //Serial.println(reading); // send the received data back to raspberry pi ...


2

Writing Junk From Memory Serial.write(analogRead(A0) + "\r\n"); This is advancing a pointer to "\r\n" by whatever number is being returned by analogRead. In other words, you are not sending the measurement but junk from memory after (or sometimes at) "\r\n"'s memory location. Serial.println(analogRead(A0)); appears to be what ...


1

These random values could be nothing but noise as your receiver may be sensing other source of ultra sound. In your case, the circuit is especially sensitive as the output powers a relay and any noise in the input side will cause the relay to "chatter". There are many approaches to filtering and smoothing out the signal. One method would be to ...


1

An easy-enough fix would be to replace your delay calls with something that regularly checks if data is available from the server. Something like: /* returns true if the sleep was interrupted by incoming data */ /* warning: does not wait at all if data is available */ bool interruptible_delay(unsigned long ms) { unsigned long end = millis() + ms; while (...


1

You include the Tone library and you use the tone() function from core. They are in conflict. Use tone1.tone() or remove the Tone library and use the tone() function.


1

The above comments are spot on. It sounds to me like you are new to the Arduino, so the very first thing to do is go to the Arduino Reference page https://www.arduino.cc/reference/en/. That shows you the basic tools you will need to work with. It's not obvious from that page, but analogWrite() is what you use for the PWM, as explained if you click on that ...


2

I have figured it out. The problem was I had not properly set up the project with the proper libraries. I thought I was doing it right manually but I was not. PlatformIO has a really convenient Library manager that helps with set up. You just select a library and it will automatically add it to the project you choose and make sure the correct dependencies ...


1

I obtained the values ​​I wanted and performed the separation. I am sending a list of joystick positions via the serial connection to the arduino in the following format 515;520 Which would be parsed as: x=515 y=520 MyCoordinator: #include <SoftwareSerial.h> #define xBeeRxPin 10 #define xBeeTxPin 9 int deger3; int deger4; SoftwareSerial xBeeSerial(...


1

Use a 220 ohm resistor for the backlight. Treat it just as an LED. That's what it is, just a normal LED.


2

I think it's because you are using a pullup resistor, so it's constantly HIGH instead of constantly LOW. Try changing HIGH and LOW to the opposite.


1

I don't know why the three of them don't work together. I already answered that question in my answer to your previous question. why I'm using this calculation in my code and why if I removed it the lidar will not give me any measurement? That code part is reading the data from the first SoftwareSerial interface. If you don't read this data (by removing ...


0

I can't answer the first part of your question as I don't understand what you're asking. However: I don't know why the three of them don't work together. That doesn't work for 2 reasons: Your receiving routine specifically references only one TFMini serial port, and It is impossible to receive from more than one SoftwareSerial port at a time. If you ...


1

Ternary operator maybe helpful. [Reference]


2

Yes, and it's not too hard, but do you do need to do string parsing in C to achieve it. In your code you read the header of the HTTP request byte by byte and send it to serial, essentially discarding it. Instead you need to read the header line by line (at least the first line) and parse the URL parameters. The format of the first line should be something ...


1

For a complete answer, we would need the datasheet of the LCD screen, but in general, LCD screens have a pin for the backlight, or two, one for plus and one for ground. In the datasheet you can find what voltage the backlight wants, and what the maximum voltage is, and then set it to what you want. For extra points, you can feed the backlight with PWM and ...


1

There is a fundamental problem with your communication strategy, and that is you have nothing to tell the receiver "This is the end of a message". You are sending a constant stream of 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510..... and the receiver really doesn't ...


1

The UNO only has one serial port, named Serial. You can create another one using SoftwareSerial (which you have included but not used) and you can, if you choose, name this Serial1. #include <SoftwareSerial.h> SoftwareSerial Serial1(4, 5); // RX, TX


0

Your problem is most likely this line: irrecv.blink13(true); That is intended to flash an LED on pin 13 when you use your IR remote. However pin 13 is also used by the motor shield as part of the serial protocol to communicate with the control chips. By using that you are confusing the motor shield. Just remove that line should allow the motors to work ...


0

There does not appear to be a complete description of how ThingSpeak throttling works. However there is this text on the Thing Speak License FAQ web page: As a reference, one unit provides the ability for a device sending data to ThingSpeak at once per second to send data to ThingSpeak for one year. Assuming your code is working as expected and the ...


3

Your current signal will also show PWM, so you will need to filter that before measuring. It would be much simpler if you could rearrange your circuit to put the sense resistor on the ground side of the MOSFET, since then you can use a simple RC filter and a single A0 measurement. Also, you wouldn't have to worry about the no-load voltage from the solar ...


2

The "metal screw" is a "trim potentiometer" that is used to set the current used to drive the motor. It sounds like you may be altering the current when you push against it. Try turning it to different angles to see what effect that has on the motor. Alternatively if it only ever works when you push on it then it could be that you have a ...


0

sizeof(controls) returns the size, in bytes, of the entire object which is not what you want. You want the number of elements. I'll point out that since you're statically allocating this as: SwitchControl controls[2] The size you are looking for is always going to be 2. So just use 2 in your for loop like: for(int i=0; i<2; i++)


0

You need to place the decleration outside of your setup() function. In other words, you need to move the following 3 lines and place then above your setup() function: #include <Servo.h> Servo Servo_Pointer; int servo_pos = 0; Your code should look like this: #include <Servo.h> const int photo_left = A0; // select the input pins for the ...


3

You can save the previous received value, and only print if it is different from what you just received. Something like this: // near the top const int rightLED = 4; const int leftLED = 7; const unsigned long goRight = 5592323; const unsigned long goLeft = 5592332; // to hold the state unsigned long previousValue = 0; // ... // loop code void loop() { ...


3

Solved using https://arduino.stackexchange.com/a/17093/37827 By removing the custom shiftOut function and changing my shiftOut(dataPin, clockPin, 0); shiftOut(dataPin, clockPin, col); with shiftOut(dataPin, clockPin, MSBFIRST, highByte(col)); shiftOut(dataPin, clockPin, MSBFIRST, lowByte(col)); Works like a charm PS: Feel free to suggest something else,...


2

Yes, that shield will handle the level shifting for you. If you look closely at the images of the shield, you see the MAX232 chip, which is a commonly used chip for getting UART (which is the Serial interface of the Arduino) to speak over RS232. And yes, RS232 uses different voltage levels. The UART on a microcontroller usually uses the voltages 0V and 5V (...


2

This is a poor product, look at this: that describes exactly the problems you (and me) are experiencing. Correct me if you've found any solutions so far. edit Try looking at description of regster 0x2f in datasheet and to this question. I think that the first problem you describe can be solved this way, the second behaviour sounds like you fried the device.


0

Good to have you here. Try this link, it should answer most of your questions in one or two settings. https://www.electronics-tutorials.ws/ This one will help as well: https: //www.electronics-tutorials.ws/category/dccircuits I used this as my search term: "tutorial on basic DC electronics" This project will take a lot of time but you can have a ...


3

There are two distinct problems here. The first problem is to convert the analog reading into a binary value. You measure a value between 314 and 856, and you want to know whether the LED is ON or OFF. The simplest solution is to compare the reading to a threshold that is roughly in the middle of the range you measure. You could say, for example, that the ...


0

This may be too simple, but for completeness: You can read back the state of the output bit, in case your code doesn't save its current state. That will tell you if the motor is literally "on" or "off". Not rotating despite being "on" is another matter; an error. If you need error detection then you need additional hardware ...


1

To expand on JRobert's answer, think of the energy as coming from the +5 pin (assuming an UNO, etc), which is like a water tower as source of pressure. If you open a valve from the water tower, the water will flow under pressure and fall to the ground. If you put a water wheel (electrical component) in the path, the flowing water will make it turn. A good ...


0

The energy comes from the chemistry of the battery (Wikipedia link), or from burning fuel (in an engine) to drive a generator that uses magnets to induce a voltage in a coil of wire. This creates the flow of electrons that does work within the circuit. 'Ground' is the zero-voltage reference point. All other voltages in the system are measured against it, and ...


Top 50 recent answers are included