Show Posts
Pages: [1] 2 3 ... 6
1  Using Arduino / Displays / Re: Can't refresh Arduino TFT after first write. on: June 23, 2014, 10:49:15 pm
I just downloaded the latest version of the Arduino IDE.  Drivers are included with it.
2  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: December 31, 2013, 08:11:36 pm
Thanks buddy.  I made some modifications tonight.  I put a 0.1uF across the power pins of the op amp and it made no difference.  I then added a 0.1uF across the feed back resistor (between pins 1 & 2 in my diagram above) and that fixed it.  Smooth steady voltage now.  Thank you for that help.

Now that the voltage is stable I can see it's a little off though.  So typically when I feed it the Arduino typically has a very small margin of error.  I build lots of these testing modules if you will and on average I have to feed 0.94 volts for the Arduino to read 0.90 volts.  Some Arduinos require 0.94, some 0.95 and the highest I've had is 0.96 volts.  However going through the op amp I see I have to feed it 1.04 volts to for the Arduino to register 0.90 volts.   I know op amps can do scaling and its got me thinking am I inadvertently scaling the voltage without meaning to?  How do I correct this difference?  I need the Arduino to correctly read the voltage for my projects.

Thanks again for the input so far.
3  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: December 31, 2013, 10:46:10 am
1. Make sure you have a decoupling capacitor across the power pins of the op amp. 0.1uF ceramic should be fine.

Ahh didn't even know about that capacitor.  Will see what I can get added in there.  It's using the 5 volt power source from the Arduino.  I take it that's a noise supply?

2. Try connecting a capacitor (0.1uF of 0.01uF) in parallel with the 47K feedback resistor.

Will try that too.

3. Check your wiring.

That's all correct.  I ordered new circuit boards from a board house to include the op amps.  They take about a month to arrive, hence the delay. 
4  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: December 31, 2013, 12:00:34 am
OK update.

So I went and redesigned my circuit boards to house the LMC6482 op amps as it was suggested.  Essentially now I have the boards setup like this.

The problem is now the inputs are so noisy.  Don't mind Eagle labeling that op amp, it's just the closest I could find for circuit board design.  It is indeed the LMC6482.  I can put a clean steady 0.9 volts on one of my inputs and the Arduino is bouncing like crazy from 0.47 volts to around 1.17 volts.  It's fluctuating so fast you can't even read the numbers, I had to take a screen shot.  Where as with my old design that simply used a 47K resistor to the input without any op amp the Arduino read the voltage as clean and stead as I supplied it.  What gives?
5  Using Arduino / Displays / Re: Can't refresh Arduino TFT after first write. on: December 14, 2013, 11:55:06 am
After following tutorial after tutorial last night I realized there's nothing wrong I'm doing.  It got to the point where I know all the pins layout by heart and could look at online diagrams and spot differences or similarities instantly.  Terrible lol.  After trying many persons demo code online I figured I must have bad hardware.

Then on one of the Arduino forums in Italian I believe it was it said the displays had been updated and new drivers were needed.  At least that's the rough translation I got from google.  I was already using IDE 1.0.5 so I went and downloaded their latest nighty build which would be 1.5.x something and put all the wires back the way they should be per the tutorials and wow loan behold everything works.  So clearly there's been a hardware updates of sorts needing a new version of either SPI or TFT libraries.  I wish there was some sort of communication of this.  I spent so many hours bashing in my head yesterday trying to figure this out.

Hopefully this helps someone else.
6  Using Arduino / Displays / Can't refresh Arduino TFT after first write. on: December 13, 2013, 09:40:21 pm
Hey Guys,

I've been struggling for a while to get my Arduino TFT display to work.  It's this exact one

Purchased it here if you need to confirm item

I wired up per this page (has an error I think)

Ran the sample sketch TFTDisplayText.  All I'd get are black and lighter black bars across the screen.  I found I could change the color of every other bar by adjusting the values in TFTscreen.background(0, 0, 0); so I had it partially working.

Eventually out of sheer frustration I started swapping wires around and after a long time I found if I swapped pin 9 & 10 around (D/C and LCD/CS) the screen would light up normal and display my text.  This is rather odd because the code defines
#define cs   10
#define dc   9
yet I'm wiring what is marked as CS on the circuit board to pin 9 and what's marked as DC on the circuit board to pin 10.  Yet the display works (sort of).  I don't see how there could be a miss print on the circuit board and the Arduino website show it wrong too.  There has to be more to it that I'm missing.

Now the strange problem.  I upload the sketch and it displays my text.  That's it.  If I change the display text in the sketch and re-upload it, the screen blanks and comes back as the Arduino resets but the old text displays.  It's like the screen never gets the new instruction.  If I power the whole thing off and back on the screen is just a weird fuzz like a TV with no antenna.  I can keep reloading my sketch and nothing.
However.  I found if I swap pins 9 & 10 again and upload my sketch I get the black bars again but this also resets something.  I swap the pins back and now my new sketch with new text will upload and display.  Once again stuck with only that text till I flip 9 & 10, upload, get the bars, flip them back reupload etc.

I'm sure I'm missing something simple but just not seeing it.  Any ideas guys?

7  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: November 24, 2013, 11:12:38 am
I was looking to do something similar but decided to go a different route that I believe is much safer.
Take a look at this:

You would use the OBDII adapter to read the car's sensors without any additional wiring.
For my project I have purchased an OBDII splitter so that the adapter can remain behind the dash.
I am going to use the Throttle Position, MAP, and Speed data from the adapter (OBDII) as well as a temp sensor (wired to the arduino) to activate an intercooler sprayer.

He has kits as well.


I've seen those.  I actually have a blue tooth version (not from that site but similar) that I use for other projects.  This particular project I'm working on isn't going that route though.  Not all sensors I need to tie into are available on the ODB2 port so it'd be a half an half type thing.  Also I don't like to tie up the ODB2 port on something I'm installing more permanently as I often put other sensors and gauges on there.  Good info though and always an option for certain projects.
8  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: November 13, 2013, 06:53:51 pm
My requirements are to have as minimal impact on the source I'm monitoring and also read it as accurately as possible.

What is the voltage range of the source, what is the source resistance, and how fast will the voltage be changing? You may be better off using just the series resistor, and no op amp.

The source is 0-5 volts.  How fast does the voltage change?  humm I'm not sure how to answer that.  I watch it change on a gauge or DVM before, fairly rapid?  I know that's not much of an answer.

As for the op amp I'm not really seeing the benifit either.  The original reason for using the op amp is more of a physical hardware barrier in case there was ever a bug in my code which made the arduino pin (A0) go high instead of doing an analogread() and sending 5 volts to the source it was monitoring.  Although that seems unlikely.  Wouldn't I have to declare that pin as output first?  Like
pinMode (A0, OUTPUT);
and then set it to high
digitalWrite(A0, HIGH);

The more I look into it, to me it seems that pin could not be "accidentally" set high.  It would have to be intentional with at least two statements referencing A0 instead of say pin 13 or another numeric usually used on the digital pins.
9  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: November 13, 2013, 04:07:41 pm
Ah thanks Paul.  That's great news.  So this is all I need and I am golden smiley

10  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: November 13, 2013, 03:32:47 pm
SirNickity thank you for the response.   I thought the 47K input resistor would protect the op amp from over voltages the way the arduino does but you bring up a good point there.
Here is the data sheet for the op amp

It does say it can handle up to 15 volts but that's supply.  I'm not really sure what happens though if the supply has 5 volts (coming from the +5V out of the arduino) and the input goes to 12 volts?

I would like to avoid a voltage divider if at all possible.  My requirements are to have as minimal impact on the source I'm monitoring and also read it as accurately as possible.  I'm aware of floating input when nothing is connected and in this project that's completely acceptable as I will always have something connected.  I do wonder if I need a 5.1 volt zener diode after that 47K resistor connected to ground so if I accidentally put 12 volts on that input instead of the 0-5 volts it doesn't blow the op amp.  Assuming that op amp will blow.  I still need to decipher that data sheet.
11  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: November 13, 2013, 12:22:25 pm
If you do not need scaling, then you just connect your input voltage through a 47k resistor to the "+" or non-inverting input of one op-amp and the output - which of course goes to the Arduino - through another 47k resistor to the "-" or inverting input.  As the LM324 is running from the same 5V as the Arduino, its output cannot exceed that.  There is a problem however - the LM324 cannot drive its output to the full supply voltage anyway, so you probably need something like a LMC6482 or LMC6484.

Paul I picked up the LMC6482 as you had suggested and this is how I wired it up.  I'm not sure it's right because reading your description you say "through another 47K resistor" at one point but I'm not sure where you are referencing?  I've been googling around and when I see op amps connected up a lot of them have additional resistors and capacitors around them and I'm not entirely sure I understand why.  Some look like because they are scaling the output differently from the input and others look like they are conditioning or cleaning up inputs.  Such as taking a noise sine wave input and making it a clean square wave output etc.  I just want to get a more informed opinion on this.  Here's how I have it wired up now.

Thanks for any input.

12  Using Arduino / Project Guidance / Re: Car window auto drop feature on: October 31, 2013, 05:39:40 pm
What about something along the lines of a small magnet glued to the glass inside the door (out of sight) and a magnetic reed switch to pick up glass location.  Something more accurate would be ideal.  Paint marks on the glass and some sort of optical sensor?  That way if window is down more than 1/8 or 1/4 inch the Arduino will know and take no action on door open or close.  It also solves things like the battery getting disconnected or reconnected when the doors are open/closed etc.  Basically avoid unknown situations.

It would also solve issues like you open the door and the arduino drops the window 1/8" and then the user hits the window switch and moves the window down 2" and then shuts the door.  On door shut the Arduino needs to take no action.
13  Using Arduino / Project Guidance / Re: Car window auto drop feature on: October 31, 2013, 05:10:14 pm
Uh, why exactly does the window do this...?  smiley-confuse

(Just in case OP has gone away..)  The seal he refers to is in the frame under the convertible top which then wraps over the windows thereby requiring them to drop a little when you open the door. I'm a bit surprised the 2004 Mustang hasn't got this and I was wondering under the shower last night that perhaps it does, but it isn't working.

Not just convertibles.  My buddy has a 2011 GT500 hard top and does that window down/up as you open and close the doors too.

You really need a window sensor to get this working correctly.  When you open and close the door it should only move the window up and down if the glass is up in that almost completely closed position.

As for the finger getting stuck.  It can't in this setup.  The window barely moves ahh 1/8th of an inch or so.  It's just enough to tuck under the rubber seal and get out of it.  You'd have to shut your fingers in the door to get that to happen.  In which case your fingers are hosed anyways.  We've opened the door and disconnected the battery and then shut the door and you can't get your fingers in.  At least not on his car.
14  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: October 30, 2013, 11:35:40 pm

BTW, respect for substantial thought and consideration as to what would happen in case of faults.  You know your project's environment, and that's good to hear.

Thanks.  I spend a lot of time working with car's electronics and tuning.  A big hobby of mine.

In addition, an op-amp allows you to condition the signal.  For example, if your TPS is also 0V to 2V you could amplify the voltage to (almost) the full range of the analog-to-digital converter (0V to 5V) greatly increasing the sensitivity.

That's very cool and I'll have to keep that in mind for future additions.  My TPS is a 0-5 volt so I'd just use the impedance buffer part of it initially.
15  Using Arduino / Project Guidance / Re: Protecting Arduino inputs from external inputs on: October 30, 2013, 06:21:05 pm

I agree.  The techniques should protect the hardware.  But, given the cost of a fault, it is worth a few moments of time to discuss.

Like say the TPS (throttle position sensor)
The techniques do not provide protection against an accidental "full throttle" indication.  The result of unexpectedly applying +5V to that sensor would be?  Other than validating the software, is there anything else that could be done?

Yes definitely worth a moment in time to discuss.  I never shy away from safety or learning something new.

As for the TPS sensor.  On my particular car it's a cable operated throttle body moved by the motion of the gas pedal.  The TPS is purely for telling the ECU where the throttle is at.  It does not actually control the throttle.  If it did receive 5 volts unexpectedly from an outside source it would command the ECU to go into open loop (instead of the current closed loop) which means instead of fueling the car according to feed back from the narrow band O2 sensors in the exhaust it would switch to a predefined fuel table in the tune and fuel the car from it.  It would also change spark source to 2 (borderline knock) which means it would look up spark advance from a different table because it thinks the car is under a WOT (wide open throttle) condition.
Both conditions on my car are relatively harmless.  Now if my car was a DBW (drive by wire) that would be a whole different story.  On those cars (referring to the GT500s I'm familiar with here) they have a potentiometer under the gas pedal.  As you depress the pedal they vary from 0 to 2 volts.  That voltage goes to the ECU and it uses that to determine how far it should move the electric motor that opens the throttle body.  In that case if someone erroneously gave it 2+ volts the car will go WOT unexpectedly.  I have personally tested this when diagnosing a faulty nitrous WOT controller box and it does indeed do that.  Even more scary when the external voltage was removed the car did not return from the WOT condition and we had to turn the key off to break the cycle.

Now if I was working on a DBW car I'd want hardware in place to make sure a software coding error could never cause the above scenario to occur.  In that case I'd use the op-amp impedance buffer as Paul has suggested.  In fact I will probably start using that anyways so I can learn more about it while experimenting.  It should prevent the monitoring input from ever going high even if the Arduino's pin goes high as the op-amp would not be bi directional.  Unless I'm missing something?
Pages: [1] 2 3 ... 6