Show Posts
Pages: [1] 2 3
1  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.
2  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.
3  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
4  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)

5  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?
6  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.
7  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.
8  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.
9  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.
10  Using Arduino / Displays / Re: Seven Segments 2 digits with 2 digital pins + 595, etc..., how to wire-control?? on: July 28, 2013, 08:47:58 am
I need 2 795 to control 1 display??
There are 8 outputs per per 74HC595. A 2x (7 segments + DP) display requires 16 inputs, thus you either need 2x 74HC595 chips (see Nick's example) or you need to switch repeatedly between the digits as shown in reply #3 by CrossRoads.
11  Using Arduino / General Electronics / Re: RTC timer help on: June 16, 2013, 07:39:43 am
Btw, is ok to use time functions, based on both, millis() and RTC or is better to use only RTC for all time operations in that case (when RTC is already integrated)? ..or it doesn't really matter?
It depends on your requirements.  In my mind the main difference between an RTC and millis (actually one of the build-in timers of the microcontroller) is that the RTC keeps track of date & time even if it is not powered up (assuming of course that it is connected to a back-up battery).  The internal timers (hence millis) get initialized to 0 after a reset/powerup.  So I would use an RTC if I want to date/time stamp events in a log, write an alarm clock or something similar that should not loose the date/time setting even if external power is interrupted.  If on the other hand I want to blink an LED at a specific interval but don't care exactly what the time is when the blink starts I would go with millis or an interrupt based on a build-in timer in the Arduino.
12  Topics / Device Hacking / Re: LDR SENSING RELAY CIRCUIT on: May 19, 2013, 03:46:11 am
Hi , Klaus_ww  please tell me some information about hysteresis its new concept for me thanks. 
Hysteresis is where there is a dead band in your logic, for instance you could switch on at a reading of 590 and switch off at say 610 giving a dead band of +-10. Your original code could be rewritten as follows:
int reading;
int deadband = 10;
int setpoint = 600;
reading = analogRead(0);
if(reading < (setpoint - deadband)){
digitalWrite(12, LOW);
} else if(reading > (setpoint + deadband)){
digitalWrite(12, HIGH);
Note: untested code...
13  Using Arduino / Sensors / Re: ldr on: May 19, 2013, 03:18:06 am
I am more optimistic and would say yes. If you also want to measure each LDR resistance, wire each one as a voltage divider.
14  Using Arduino / Sensors / Re: 4 LDR Solar tracker - Uneven reading when exposed to even light on: May 10, 2013, 10:57:28 am
You are using a multiplication factor on what I assume is the direct ADC reading (0 - 1023).  This is proportional to the way you have configured your voltage divider. An alternative correction would be to assume the sensitivities of the different LDR's are the same, but there are constant factor offsets between the different LDR resistance values.  This method is a bit more involved since it requires you to convert the ADC reading into the corresponding LDR resistance.  If I assume you have configured your voltage divider as follows: Vcc - LDR - measuring point - fixed resistor - ground then your ADC reading would be related to the LDR resistance as follows:
ADC reading = R_fixed / (R_LDR + R_fixed) * 1023

It then follows that a fixed percentage offset of the LDR resistance would lead to a non-constant percentage change in the ADC reading.  To assign a constant calibration factor to the LDRs you have to convert the ADC reading back to a resistance, then apply a correction factor, e.g.:
R_LDR = (R_fixed*1023 /(ADC reading) - R_fixed) * correction_factor

Of course if you do this your control logic will have to reverse, since the R_LDR and ADC values are inversely proportional.  Or you have to convert your corrected R_LDR back to a corrected ADC reading, but this is unnecessary in my opinion.

Further, it seems as if your fixed resistors are of 5% tolerance, this may also contribute to different voltage divider ratios if the different resistors have noticeably different values.
15  Using Arduino / Sensors / Re: DHT11 Temperature and Humidity pull up resistor? on: May 10, 2013, 08:18:15 am
The DHT protocol provides a communication error check. It transmits two bytes for humidity, two bytes for temperature and one byte which is the sum of the previous four bytes.  If the values received adds up to the fifth byte then there isn't (statistically speaking) a communication error.  A less technical error check is if the received humidity and temperature values are vaguely believable there probably isn't a communication error. I've found that I get reliable communication with a DHT11 over about 5 meters of CAT5 network cable using only the internal pull-up of the atmega enabled on the data pin.

I suspect you are simply seeing the inherent inaccuracy of the sensor.  I've also compared the DHT11 temperature reading with an LM35 and a thermistor.  The DHT11 was not as accurate as the other temperature sensing elements.  I regard the DHT11 temperature reading as optional information, if you really want to measure temperature to better than +-2°C accuracy use another sensor.  Also remember the +-2 °C stated accuracy is approximate and the reading gets truncated or rounded to an integer value so the accuracy of individual sensors may vary by as much as +- 3°C.
Pages: [1] 2 3