Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.
7

Not only can you share the grounds - sharing the grounds is required for there to be any form of meaningful circuit for signals to get around the place. To copy-and-paste a blog post I wrote some time back: A lot of the time on the Arduino forums we get questions regarding wiring things together. One common format is: I want to connect my 12V powered ...


5

It cannot draw enough current I suppose. When wheels are free-spinning, the load on motor is very small. When you put it on ground, the load increases, and it is slow because there is not enough current to drive the load


3

While it may be possible to bend one of those to your proposed usage, it's far from ideal, for a number of reasons: It's far more expensive than the single P-FET that you need to get the job done It's risky: you can easily reverse the current through your components and blow them up It imposes a ground offset which can cause you communication problems. All ...


2

Although I am still figuring things out, but i hope the following things help: http://www.solar4rschools.org/sites/default/files/robotic-sunflower-lesson4-handout4.pdf The problem, as far as I think is that the enable pins are the ones which are supposed to help you control the speed. Please connect them to the PWM ports on your Arduino/any other device ...


2

You can connect a single output to as many input loads as you like, provided the current is sufficient to hold the output voltage within the input thresholds. See the datasheet for the H bridge to find out what the input load and thresholds are, and compare them with the output from the Arduino.


2

While the motor is being powered the current flows from Vcc to GND as in this circuit: When the power is disconnected (such as the transistor in the ground connection in your circuit is switched off) amongst other things (including the collapsing of magnetic fields) the spinning of the motor turns it into a generator. The power generated is the opposite of ...


2

When connecting together several circuits that have different supply voltages, common practice is to make them all have a common negative supply rail. This is called “common ground”. As explained in Majenko’s answer, you would need an NPN transistor for that. If you want to use a PNP instead, then you could forget the common practice and do everything “...


2

There is a few possible scenarios to create a H-bridge: with NPN transistors only or PNP mix of PNP and NPN You have to be careful to not mix the types and inputs. See pictures below:


2

what exactly is it that makes a simple function like digitalWrite() so damn slow??! Why isn't it just a wrapper function for direct port manipulation? Well, it can take a variable as an argument. And the contents of the variable have to be looked up in a table to see which port and which bit. If you use the DigitalWriteFast library then that turns your ...


2

You wrote: Using [...] the atmega's hardware pwm is not very suitable because I need two 50/50 square waves with a phase difference of pi I believe hardware PWM is the best solution to your problem. The PWM outputs can be set to either “inverting” or “non-inverting” mode. Set the two channels of a single timer to the same duty cycle, with one in non-...


1

Creating a few boolian variables could help with this. bool opening = 0 bool closing = 0 const int Switch = 2; const int hbridge1 = 13; const int hbridge2 = 12; const int threshold = 400; int buttonState = 0; void setup() { pinMode(hbridge1, OUTPUT); pinMode(hbridge2, OUTPUT); pinMode(Switch, INPUT_PULLUP); Serial.begin(9600); } void loop() ...


1

Your problem is to do with the way you are driving the circuit. That is - your circuit is a 9V circuit, but you are trying to control it with 5V. Both your PNP transistors will be allowing current through, since you can never turn them off properly. That means the current through your motor will be massively reduced, and your transistors will just get hot. ...


1

The 9 V battery is likely to be the problem, since it will not supply much power. Try lithium batteries, e.g. two Li-ion or Li-polymer cells in series, to make ~8.4 V. Is there really a need to make your own H bridge? There are plenty of very cheap and compact modules available. The one I use for a lot of projects is TB6612FNG (15 V, 2 A maximum, 2 ...


1

Looks like you are controlling two motor outputs via the H-bridge, where the logic inputs are in1,in2 and in3,in4. First of all, you need pinMode(in1,OUTPUT); pinmode(in2,OUTPUT); One reason why the motors may not spin for analogWrite value less than 130 is that, coincidentally, the voltage output is too low and motor stalls. Test this two ways: does (1) ...


1

It looks like the code in the ISR is slow and it may compute incorrect results. It is slow because of using floating point arithmetic in throttle_pwm and aileron_pwm calculations. It may be so slow that the trailing edge of a PWM pulse occurs while the leading edge still is being processed. This will delay trailing edge processing, and mis-measurement of ...


1

I am not an electronics guru yet either so others might give you a better answer, but this is one circuit I have messed with a lot because I keep trying to build robots, so I will take a shot at an answer. Normally you need both NPN and PNP transistors for an H-bridge: The 2N222 is NPN so you'd want to pair two of them with two equivalent PNPs such as the ...


1

According to the datasheet on the L298 IC the connections you described should be right. First I would recommend to connect 10v to the + and - rails and measure the voltage on the logical inputs if it is 0 or lower than 3v than that should be ok to connect an arduino. Also now you can connect an additional 5v power supply with an the -5v connected to the - ...


1

SPI writes in 8-bit bytes. So the writes need to look like this: SPI.transfer(0b00000100); // first byte SPI.transfer(0b00000000); // second byte Possibly in the other order depending on which byte the device expects first.


1

You have discovered the standard problem when building an H-bridge. If you want to drive it with a voltage lower than its output voltage, then you cannot directly control the high-side transistors. There are several solutions to this problem. The simplest and most reliable is to buy an already built H-bridge. If you really want to build it yourself, then ...


1

You are trying to use a mix of delay and millis Instead you will want a proper state machine: void loop(){ switch (state){ case GOING: go(); state = WAIT_FOR_COAST; transition = millis();break; case WAIT_FOR_COAST: if(millis()-transition > 1000){ allStop(false); state = WAIT_FOR_STOP; transition = ...


1

Despite the fact that the circuit you have is completely wrong, there is one fundamental thing that is stopping you using a PNP transistor. With an NPN transistor you have to raise the voltage on the base above the ground voltage (this voltage is called V_BE, the Voltage between Base and Emitter). Typically that voltage is around 0.7V. With an PNP, ...


1

You need an NPN transistor to run a motor like that off of an arduino. Take a look at this article: https://learn.sparkfun.com/tutorials/transistors Similar to the NPN circuit, the base is our input, and the emitter is tied to a constant voltage. This time however, the emitter is tied high, and the load is connected to the transistor on the ground side. ...


1

If you want to reverse the movement you sould remember where you are going. This, along with the brackets correction suggested by @MikaelPatel and @NickGammon, leads to this code: boolean moving_up = true; void loop() { if (moving_up) tilt_up(); else tilt_down(); } void tilt_up() { digitalWrite(ic1_1, LOW); digitalWrite(...


1

void loop() { tilt_up(); } void tilt_up() { ... if (digitalRead(sw2State == LOW)) { tilt_down(); ... } } ... void tilt_down() { ... if (digitalRead(sw3State == LOW)) { tilt_up(); ... } } You are recursing here. loop calls tilt_up which eventually calls tilt_down which calls tilt_up and so on until you - rather quickly - run out of RAM. ...


1

I don't really se anything wrong with the wiring, atleast your diagram seems to be in order. only thing I would ad is give the pin 8 a ceramic capacitor to ground but There is a few possible issues you can check. 1 -the sparks make me think that you had a Loose connection at the spark site on the breadboard, maybe the IC was not properly pushed Down in the ...


1

There a some mistakes with the wiring of the supply voltage (Vss) according to the datasheet (http://www.ti.com/lit/ds/symlink/l293.pdf) of the L293D a those on pin 8 (Vss2) and 16 (Vss1). I think those are not connected because each Vss is for one motor of the driver. So you have to connect 9V (or 12V) to both pins. There is also something wrong with the ...


1

In theory, this particular device should work on its own. However you should search for and read the datasheet for it. (I'll leave you to do that yourself, just to make sure you really do read it.) You should consider a heatsink too by the way, and provision for things like a fuse on the power, and whether you will be using a separate 5V for the logic (...


1

I guess you're not using the designated PWM pins provided on the Arduino Board, anyhow I suggest you read this instructible: http://www.instructables.com/id/Arduino-DC-motor-speed-and-direction-L293D/step2/L293D-Pin-Layout/ ,Perhaps this can help you in making proper connections and also help you with the code :)


1

It works! The changes to the uhttpd must have done the trick to listen for http traffic on a given IP/port (other than 0.0.0.0:80). Instead of supplying a port number for the server in the code, I would surmise that the change to the config takes care of it so this, so the port number in code is no longer needed: YunServer server(XXXXX); should be ...


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