Hi, I have an Arduino Uno rev4. This is my first project and I have managed to get further than I thought but have stumbled across my understanding of PULLUP.
I have a single line with around 6v coming from an external device that I need to pulse to 0v so that the external device can count how many pulses.
I thought the 6v was a little too much for the Arduino so I have used 2x10K resistors to bring this down to 3. I have attached this line to D2 and end of the loop to GND just after D13.
The issue I have is that I can't seem to pull the voltage low enough to get the external device to register the count.
Any help would be appreciated as I have spent the last 6 hours trying different ways
Read the posting at the top of the forum on "how to"....then...
post a drawing of your (complete) circuit (no fritzing)
Then post whatever code ( in code brackets)
Hi, I can't locate the "how to"! I have searched this forum and google for answers. I don't have a diagram and don't know what fritzing is. I think my post explains what I'm trying to achieve and that I just need some guidance on the possibility. Any code I have tried doesn't work so I have started again. I used this forum once before and had comments about using it correctly. I think I have selected the correct area and give most of the information I know.
Thanks for posting the link. I feel like I selected the right category and also give enough information to answer my question. I don't have a schematic but I did outline the board in use and what pins I was using as well as the resistors that were in play. I think I need to source a beginners forum. Thanks.
Use a bipolar NPN transistor switch to do this, with a 330 (for the R4, use 1K) Ohm resistor to the base, emitter to GND and collector to the line. A HIGH written to the pin turns on the transistor and connects the line to GND.
The PN2222 will work. Make sure you identify the E, B and C leads correctly.
The 1K base resistor (shown as 330 Ohms in the schematic) sets the transistor base current to a little over 4 mA, which is safe for the Uno R4 to provide.
Thank you. Just so I fully understand, the device pin will have 6v and will be going to the NPN and when the Arduino digital pin is set to high the NPN will switch and send the 6v to ground which then will be read by the device pin as 0v so I can then count how many times this happens?
If you have a multimeter, set it to current scale (100 mA?), connect the positive test lead to the device pin, the negative test lead to ground, and measure the current from the device pin to ground. Hopefully it will be around a few mA. Let us know if you find otherwise.
Connect the transistor collector directly to the pin. No resistor to ground.
If I understand the text and markings on your schematic, the transistor is connected backwards. Connect the emitter to ground.
On a schematic diagram, the transistor emitter lead has an arrow showing the direction of the current flow, and is identified as "E" on the data sheet pin diagram.
I think it is the right way round as I looked up a diagram to explain which pin was which. So I have the collector pin 1st which the device is going too, then the 2nd pin (Base) to the 1k resistor which then connects to D2 and then the emitter is to ground.