Show Posts
Pages: [1] 2
1  Using Arduino / Displays / Re: SOLVED - eBay 1.8" ST7735 LCD Problem on: May 20, 2014, 11:03:30 am
I used the adaFruit libraries:
2  Using Arduino / Displays / Re: eBay 1.8" ST7735 LCD Problem on: March 26, 2014, 02:15:41 pm
I managed to fix the problem. Although the LCD may be supplied by 5V, the logic must still be at 3.3V level. For now, I just placed 1K resistors in-line with the four data lines. Just in case someone else struggles with the odd naming convention on the board:

eBay LCD BoardAdafruit Pin NameArduino Pin No (Hardware SPI)Notes
SCKSCLK131K resistor in line
SDAMOSI111K resistor in line
CSTFT_CSdefined by "cs" in sketch1K resistor in line
A0DCdefined by "dc" in sketch1K resistor in line
RSTRSTdefined by "rst" in sketch, or connected to Arduion RESET
LED+Connect to Arduino 3.3V. Module has a 10R resistor inline already. LED is rated for 3.5V 30mA
LED-Connect to GND

Next, I'll try using the SD Card.

keywords: ST7735S, ST7735R, kmr-1.8 spi v1, streaks, white display
3  Using Arduino / Displays / SOLVED - eBay 1.8" ST7735 LCD Problem on: March 26, 2014, 03:35:47 am
Hey Guys

I bought this LCD from eBay and it arrived yesterday: The board that arrived did not say "HY 1.8" as I expected but "KMR 1.8". See photo:

I hooked up the LCD (Sorry, I left the board at home, so I can't give the exact connections between the board and arduino, but I think it must be right, because there are some images and lines being printed. Read further).

I downloaded the latest Adafruit 7735 and GFX library files from Github and tried running the example. I could see faint images being printed but the display was mostly just a bright white. Looking at the LCD from a very low angle (70 degrees or so, I could cleary see the text and lines being shown looked OK, but it was as if the contrast was extremely low. Everything is just bright white.

When I press the Arduino's reset button, the display shows the image with proper black bakground and contrast for a few seconds, but as soon as the Arduino boot and runs the code again, the display again turns the strange low constrast white.

I tried initializing with initR and BLACKTAB, REDTAB, GREENTAB and also initB. initB displayed nothing. initR displayed text and lines, all of them still very faint.

Something obviously happens while the arduino resets that makes the LCD show properly. I narrowed it down to pin13 on the arduino. With the adafruit example running, I uploaded another sketch which simply sets pin13 to an output and digitalWrites it to LOW. Doing this, the LCD obviously freezes with the last image it displayed, but it displays it correctly with black background.

I tried another arduino uno - still same problem. I tried the following sketch found here:

#define cs_lcd   10
#define cs_sd    7
#define dc       9
#define rst      8

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

Adafruit_ST7735 tft = Adafruit_ST7735(cs_lcd, dc, rst);

void setup()

void loop()
  tft.setTextColor(ST7735_WHITE, ST7735_BLACK);
  for ( int i = 0; i < 100; i++ )
    tft.setCursor(40, 50);
    tft.print( i );
    delay( 100 );

Here is a video of the problem: Everytime the screen displays properly is after I press the arduino's reset button.

Can anyone tell me what might be wrong?

I read another forum post today that said that even though the LCD borad can be powered by 5V (JP1 on board left open circuit), the SPI must be at 3.3V logic level? Could this be a problem?
4  Using Arduino / General Electronics / 3.3V LDO Regulator to use with 3.7V Li-Po Battery on: November 21, 2013, 05:17:58 am
Hey Guys

I need to power some 3.3v logic from a 3.7v Li-Po battery. I used SparkFun's LiPower ( before, but it is limited to 200mA current delivery at 3.3V. I need about 300 - 350mA. I contacted the guy the who designed the LiPower and he said that an LDO will be sufficient for my needs. I have very limited knowledge of using regulators except for the 7805's etc.

Can someone please help me pick a regulator that:

  • Is easy enough to prototype on a breadboard with (this isn't THAT important, but it would help)
  • Has a very low drop voltage
  • Is capable of providing 3.3v about 300mA peak for about 30 seconds every few minutes, and idling at about  100mA the rest of the time without any significant thermal considerations

If you have the time, please help me understand:
With the 7805 regulators: They become quite hot, depending on the input voltage e.g. if the supply is 12V, and you draw 500mA, the regulator becomes extremely hot. I guess this means that the "excess" power is converted to heat?

How will a LDO regulator differ in this instance? As I am working from a battery, every bit of wasted current is important. Is there a more efficient way than using a LDO regulator to get 3.3V?
What does the LiPower unit do different?
5  Using Arduino / General Electronics / Wall light switch and relay minimum load on: June 14, 2012, 03:56:28 pm
First off: Apologies - I'm sorry this project will eventually have an Arduino in it, but I'm struggling with some basic questions first.

I looking for wall light switches for my house and ordered one of these to test:

What I don't understand is how this thing operates. According to the diagram, you only hook up the Live to the switch and then the neutrals coming from each light. Now can someone tell me, how this thing shows a blue LED when the light is off (i.e. When the circuit is broken)? Or am I missing something.

Also, I'm not sure why, but they specifically state that the switch cannot drive a load of less then 15W, balast driven fluorescents, or LEDs. The 15W minimum load requirement is making me think that there is a relay inside. What else can cause them to require a minimum load?

In any case, my intent is to hook up a 220V-to-12VDC transformer, an Arduino, NRF24L01 RF unit, and RGB LED strip lighting. The idea is that when you switch on the light switch and the circuit is completed, the PSU will turn on, the Arduino will power up and switch the LED strip lighting to white and stay this way until you switch it off again. When I finally figure out how to use the NRF24L01, I would like to use it to send the RGB values that the Arduino should use to PWM the different colors of the LED strip. This way, if something goes wrong, at least you can still switch the LED strip lighting on and off like a normal light.
But now... what happens when I turn off the LED lighting with the Arduino (i.e. switch all the PWM's to 0) and by doing so the load drops to practically 0W?

Thanks guys!
6  Using Arduino / Project Guidance / Re: Capacitance over long wires on: March 27, 2012, 12:42:15 am
Thanks for the information. The meter has a red LED and I'm struggling to find photo-transistors that aren't specifically for infrared. Will an infrared one work? Also how does the two-pin phototransistors differ from the 3 pin ones?

put a transistor out there with the LDR for more 'contrast'.

Or better yet, use a photo-transistor.

This is the circuit I used to count the pulses from my power meter.
7  Using Arduino / Project Guidance / Re: Capacitance over long wires on: March 27, 2012, 12:39:58 am
What are you using as a scope probe?

Its a PicoScope 2203 with a normal entry-level oscilloscope probe
8  Using Arduino / Project Guidance / Re: Capacitance over long wires on: March 26, 2012, 04:43:28 pm
The pulses are around 0.4Hz at its fastest. From the scope measurements, the signal barely reaches LOW before another pulse is triggered. I'll try and take some measurements with the scope again tomorrow and post them here.
9  Using Arduino / Project Guidance / Capacitance over long wires on: March 26, 2012, 03:58:46 pm
I'm measuring LED pulses from a electricity meter using an LDR connected to the Arduino. I've attached the circuit, but in essence

5V - LDR - Split to Arduino_PIN2 and 150K to ground. The itself is connected to about 15m of very thin twin-core flex cable.

The LED I'm trying to measure is quite dim, so I had use 150K resistor between the LDR and ground to offset the voltage going to the arduino enough to get a shift between high and low. I measured using a oscilloscope (forgot the waveforms at work):
LED off: 1.8V at lowest
LED on: 3.9V at highest

BUT you can clearly see the capacitance of the wire becoming an issue. The pulse is extremely rounded. When the LED switched off, the voltage slowly tapers (linearly) back from 3.9V to 1.8V over about 2 seconds.

I'm guessing this is because of the large resistances involved and the length of the cable. The LED i'm measuring is in a sealed tamper-proof enclosure, so there's no chance of replacing it with a higher brightness. I'm strugging to find an LDR with better sensitivity or lower resistance. What else can I try to get more square-like waves?

A few notes:
  I'm using rising-edge interrupt, so analog inputs aren't feasible.
  The reason for the long cable is because of the distance between the computer and the LED.
  The cable I'm using is rather cheap, it's about 2mm wide at its thickest, and is normally used in alarm systems for those magnetic contact switches.
10  Using Arduino / Project Guidance / Re: Uno: COM-Port trouble after 24 hours "A device attached to the system is not..." on: March 26, 2012, 03:30:14 pm
Thanks for your help guys. I managed to deduce the problem: Its software/hardware related but not the arduino's fault.

I have an LDR that measures a pulse from an LED on an electricity meter and sends a basic message to the PC over USB. The message is sent on a rising edge interrupt.
It turns out that every morning at about 07:00, sunrise over here, sunlight penetrates the assembly and hovers the voltage around enough to trigger thousands of interrupts flooding and eventually breaking the USB. Putting a box over the meter and LDR solved it.

I'm also planning on using a 74HC14 Schmitt Trigger to solve the problem.. Do you think it will work?
11  Using Arduino / Project Guidance / Re: Uno: COM-Port trouble after 24 hours "A device attached to the system is not..." on: March 22, 2012, 03:39:49 am
The pulse measured is from a pre-paid electricity meter. The highest frequency possible is about 4Hz, and the message size is 6 bytes on every pulse. The only thing connected to the Arduino is a 100K LDR and and a 100K resistor to offset the LDR voltage. The integrated LED on  pin 13 is flashed with every pulse. Other than that, nothing is connected.

The exact same components are attached to the Duemilanove though.

Does anyone do something like data acquisition with an Uno that can confirm an uptime of months?
12  Using Arduino / Project Guidance / Uno: COM-Port trouble after 24 hours "A device attached to the system is not..." on: March 22, 2012, 03:06:12 am

My arduino code sends a message over the USB/COM port every time it sees a pulse from a LED (using a LDR). The code is running on a Arduino Uno (1st Rev with DIP AtMega). The Arduino is connected to a server (Windows Server 2008 R2 x64) with a custom C# application that writes the frequency of the pulses to a database.  Everything works consistently, except that after about 24 hours (+- 3 hours), communication between the computer and the Arduino ceases completely. If you try to restart the C# application, it receives an exception "A device attached to the system is not functioning" when trying to open the COM port. The same error is given when trying to open the port using PUTTY.

To resolve the problem, I simply delete the COM port in the Device Manager, and then "Scan for hardware changes...". After the port is re-detected, the software runs for about another 24 hours before the problem repeats.

I have the exact same code running on a old Arduino Duemilanove (with the FTDI chip) at home connected to a Windows XP computer running the same C# code, and it has been running without a problem for 80 days now.

Can someone please shed a bit of light on the problem or help me resolve it with some troubleshooting.

EDIT: The Hardware ID of the Arduino UNO is USB\VID_2341&PID_0001&REV_0001 so am I correct in saying the Atmega8U2 is running the latest firmware?
13  Using Arduino / Installation & Troubleshooting / UNO: Use UART for XBEE on: August 08, 2011, 05:48:08 am
I'd like to connect a XBee to my Arduino UNO's RX and TX pins (i.e. the same pins that go the the USB) since my device will be used as standalone later (i.e. not connected via USB).

Can anyone advise me how to do this.

1. Can I just connect the XBEE RX and TX to the headers on the Arduino (obviously after level shifting 5v<>3.3V) or should the RX and TX pins be disconnected from the USB transceiver somehow? Won't the connection between the AVR's UART and 8U2 interfere with the UART and Xbee connection?

2. Should the Xbee be removed while connecting the Arduino with USB for programming and then be connected again when the USB cable is removed, or can I just leave it connected?

14  Using Arduino / Motors, Mechanics, and Power / Re: Pressing Gate button on intercom on: July 11, 2011, 03:15:49 pm
Measurements were taken using a multimeter and scope between the intercom gate and ground wires.
Voltage open circuit: 13.4V DC (The scope shows a average 13.4V with a fluctation of 200mV over 10 seconds)
Current to short gate wire to ground wire: 34mA (measured using multimeter inline with pushbutton)

If my calculations are correct: P = IV: P= 0.034A * 13.4V = 456mW
Maximum power dissipation of 4N35 according to datasheet: 150mW

Please see the attached breadboard diagram of how the measurements were taken and how to Arduino is connected via the 4N35. The resistor value is incorrect in the diagram, it is really a 380 ohm resistor to give the 4N35 1.2V 10mA.

Is my only option here a relay? Is there any other way I keep the solution as solid state as possible without physically connecting the intercom system to the Arduino circuit?

15  Using Arduino / Motors, Mechanics, and Power / Re: Pressing Gate button on intercom on: July 11, 2011, 11:57:54 am
I will take some measurements tonight and report back tomorrow
Pages: [1] 2