Show Posts
Pages: [1] 2 3 4
1  Using Arduino / Sensors / Re: Air pressure sensor - Tire pressure on: September 14, 2014, 10:05:52 am
The MPX5500 and the MPX5999 are diferential pressure sensor, to measure a tire pressure I think I need a gauge pressure sensor .
Gauge pressure is the difference between atmospheric pressure and the measured pressure, so you can use a differential pressure sensor and simply leave one connection (low pressure leg) open to atmosphere.
2  Using Arduino / General Electronics / Re: TRIAC AC switch , need some info on: July 21, 2014, 11:58:51 am
See figure 10 in the MOC3061M datasheet ( for a typical 220V AC circuit.
3  Using Arduino / Sensors / Re: frequency measurment on: July 20, 2014, 12:38:32 pm
If you want to measure speed but not direction of the encoder then you could use LM2907/LM2917 frequency to voltage converter IC and use an analog pin to read the output.
4  Using Arduino / Sensors / Re: Barometric Presure sensor BMP180 on: July 20, 2014, 12:19:40 pm
The absolute pressure reading seems OK to me (if this is actually the sensor pressure reading), normal atmospheric pressure at sea level is 1013.25 millibar or about 29.9 inch Hg.  The sea-level pressure seems high, which could explain the wrong calculated elevation.
5  Using Arduino / LEDs and Multiplexing / Re: MOSFETs driving me crazy! on: July 20, 2014, 12:05:59 pm
But I found a problem: the LED strip did not turn off completely, even being the MOSFET turned fully off!
So I googled and found that I had to use a MOSFET whose Vgs would be 5.0V (so that Arduino can fully turn it on and off, am I right?)
The thing is, how do I know this!?
For example, lets check the datasheet of a MOSFET that lots of people recommend, the IRF540N...
Does the MOSFET switch on/off properly when you connect the gate to 5V and 0V respectively?

If you look at figure 1 of the IRF540N datasheet you will see the performance of the FET at different Vgs.  The bottom curve shows the current vs. voltage drop Vds at Vgs = 4.5V.  From the linear part of the Vgs = 4.5V curve the effective resistance of this FET is 66 mOhm.  As you increase Vgs the effective resistance of the FET drop to the stated 44 mOhm.  You can also see from figure 1 that the maximum current you can get through the FET is lower at Vgs=4.5V (about 10A) than at say Vgs=5V (about 23A).  You ideally want to use logic level FETs with Arduino output voltages, see e.g.
6  Using Arduino / General Electronics / Re: Will this voltage doubler works with DC input? on: April 18, 2014, 03:10:40 am
These links (1, 2 ) show a very basic implementation of a switched mode voltage controller using the microcontroller it powers to also drive the circuit.  The 2nd link also implements voltage regulation using an ADC pin to control the PWM pin driving the circuit.
7  Using Arduino / Displays / Re: 16x2 LCD nearly works - but has a few strange characters. Why??? on: April 04, 2014, 02:44:28 pm
The ASCII data structure contains a start byte (0x02) followed by 10 bytes of data, followed by a 2 byte check sum, followed by carriage return and line feed characters, finally terminated by an end byte (0x03) (from datasheet: You will need to handle the extra information surrounding the data you are interested in.  This code ( will probably do what you want.
8  Using Arduino / Displays / Re: ILI9325 TFT LCD Touch 2.8" on: April 04, 2014, 02:11:04 pm
If you have a link or manual/schematic for your LCD board please share it. The information may be useful in identifying possible next steps.
9  Using Arduino / Displays / Re: ILI9325 TFT LCD Touch 2.8" on: April 03, 2014, 02:49:37 pm
My questions to you:
- Is there other way besides soldering to connect the wires to the LCD?
- Do you think the REST pin is the same as the RSET pin?
- Do you think the WR pin is the same as the RW pin?
- Which pin do I connect the backlight pin to?

Thanks for your help!

You can use an IDC connector which crimps onto a ribbon cable to connect wires/ribbon cable to the LCD (see for example). If you only need to connect to the LCD data and control pins you don't need that many connections and you could use SIL sockets ( but then you'll need to solder wires to the socket pins. You can also use SIL housing ( but this requires that you crimp wires on terminals, not all that easy without a proper crimping tool.  Perhaps the easiest would be to get hold of an old IDE hard drive ribbon connector (, I think it should fit.

I'm fairly sure you can assume that REST = RSET and WR = RW.
Backlight pin is probably LED_A.

I suggest you try and find a tutorial/code/description for your specific LCD board, because the LCD controller chip is only rated to work with input voltages up to 3.3V.  Some boards put in voltage shift IC's which makes them compatible with the Arduino 5V output.  There are also different data transfer settings (8 bit, 16 bit, SPI).  If you only push 8 bit data but the controller is configured for 16 bit data you will have an obvious problem.  If it is configured for 8 bit transfer, you need to know whether you must connect to DB0-DB7 or DB8-DB15.  I have an LCD board which is configured for 8 bit transfer, but have to use pins DB8-DB15.

Good luck1
10  Using Arduino / Motors, Mechanics, and Power / Re: Logic-Level Power FETs you'd like to see/use?? on: March 23, 2014, 07:18:45 am
Any other comments, nominations appreciated...
I've also recently started looking into this.  Here are some others one could consider:
IRLZ44N - the automotive versions seem to have even lower Rds (AUIRLZ44N)

11  Using Arduino / Programming Questions / Re: Problems with LCDs and SPI on: March 16, 2014, 02:31:06 am
The LiquidCrystal library in my Arduino 1.0.5 libraries folder doesn't have a member function called initSPI.  Are you using a newer version of Arduino, or is this a non-standard (as in it was not installed by Arduino installer) LiquidCrystal library?
12  Using Arduino / Programming Questions / Re: PS2 Mouse Library on: March 15, 2014, 03:33:17 pm
In answer to your question, reread the paragraph Movement Data Packet in the link you provided.  As I understand the description the the sign bits for the movement bytes are stuffed into the first byte (bits 4 & 5).

Further, the protocol is byte oriented, so the for loop should only read 8 bits.  Not sure why mvmnt is added to the for loop check.  If you are trying to read a movement data packet it seems as if you have to read in 3 bytes. Not sure if the 3 bytes are transmitted as 1 packet or 3 separate packets of data.

The delayMicroseconds statement don't make much sense since the actual clock transitions are checked by while loops anyway.  Perhaps a 1 microsecond or so delay is needed when the clock & data lines are pulled hi at the start to allow the line voltages to settle before reading.

Hope this helps a bit.
13  Using Arduino / Displays / Re: Touch LCD clone looks weird unless resetting on: February 11, 2014, 12:25:29 pm
Anyway, the screen has weird contrast and seems sort of dim until I hit the reset button. Then it looks great until it restarts and it goes back to looking weird.

Not sure, but perhaps adjusting the gamma settings for the display may improve the display quality.  The gamma control settings are set in the Adafruit_TFTLCD.cpp file in this section of code (I assume the LCD driver chips is an ILI932X ?):
  ILI932X_GAMMA_CTRL1      , 0x0000,
  ILI932X_GAMMA_CTRL2      , 0x0000,
  ILI932X_GAMMA_CTRL3      , 0x0000,
  ILI932X_GAMMA_CTRL4      , 0x0206,
  ILI932X_GAMMA_CTRL5      , 0x0808,
  ILI932X_GAMMA_CTRL6      , 0x0007,
  ILI932X_GAMMA_CTRL7      , 0x0201,
  ILI932X_GAMMA_CTRL8      , 0x0000,
  ILI932X_GAMMA_CTRL9      , 0x0000,
  ILI932X_GAMMA_CTRL10     , 0x0000,

I've seen alternative values in different drivers, but don't know how to interpret them.  At least you can change these values and see if it makes a difference, although I suspect randomly changing values may not give predictable results.
14  Using Arduino / Sensors / Re: Which optical mouse sensor is this? on: October 14, 2013, 11:09:49 am
It could also be an Avago ADNS-2610, which appears to be pin compatible with the PAN3101 (the pattern also looks similar, perhaps it is a clone).  The two chips may even be protocol compatible, so try Martijn's tutorial anyway.
15  Using Arduino / Sensors / Re: Resistivity meter for measurement of solid concentration (would this way work ?) on: October 12, 2013, 03:07:06 am
To get signals 180 degrees out of phase you simple invert them, so a H-bridge circuit will give you the AC you need.

An alternative is to use two PWM  pins 180 deg out of phase.  You could use Timer2 for this, if you don't have another library that use it.  The following code is for the 328P controller (used in e.g. the UNO), the code will probably have to be tweaked for other controller types.

// Generate simple 180 degree out of phase square waves on pins 3 & 11
void StartTimer2(void){
  pinMode(3, OUTPUT);
  pinMode(11, OUTPUT);
  TCCR2A =   _BV(COM2A1)                       // Clear A up, set down
           | _BV(COM2B1) | _BV(COM2B0)         // Set B up, clear down
           | _BV(WGM20);                       // Mode 2, phase correct PWM
  TCCR2B = _BV(CS22) | _BV(CS21) | _BV(CS20);  // prescaler 1024
  // Frequency = F_CPU / 1024 / 256 / 2
  // For a 16MHz board this will be 16000000/1024/256/2 = 30.52 Hz

  OCR2A = 127;       // 50% duty
  OCR2B = 127;       // 50% duty

void setup(){

void loop(){}

If you want to run at higher frequencies change this line:
  TCCR2B = _BV(CS22) | _BV(CS21) | _BV(CS20);
The prescaler options are listed in the manual‎ in table 17-9.
Pages: [1] 2 3 4