Get Up and Running with Maple Mini on Windows XP

This is a quick “how to” for those wanting to set up a maple mini on Windows XP

  1. Download the  Windows install package from leaflabs.com 139MB and extract them somewhere handy

    Download The Maple IDE
    Download the Maple IDE and supporting files from Leaflabs
  2. Plug your maple mini into the USB port
  3. when windows prompts for drivers,
    Install Drivers When Prompted
    Install Drivers When Prompted
    •    Select –> Install from a list or specific location
    • –> Next
    • Tick checkbox Include this location in search then browse to  the  /drivers/mapleDrv/dfu folder, inside the maple-ide folder
    • –> Next
  4. Open maple IDE and select board “Maple Mini R2 to flash”

    Select Board Type
    Select Board Leaf Labs Maple Mini to Flash
  5. From inside IDE File –> Examples –> Digital –> Blink
  6. Verify then Upload. The light should now start blinking and Windows will prompt for another driver.
  7. Install Driver as for number 4 but browse to /drivers/mapleDrv/serial
  8. If all has gone according to plan, you should have a new serial port to select from inside the maple IDE.

 

A 2.4″ TFT Touchscreen Shield For Arduino

Introduction

2.4" TFT Touch Screen Shield With Micro SD Socket
2.4″ TFT Touch Screen Shield With Micro SD Socket

If you are looking for an inexpensive graphical interface for your Arduino, this could be it. Our 2.4″ Colour TFT display, has a four wire resistive touch screen, a micro SD card socket, and a convenient arduino shield footprint. To help you get going we have provided some example code, which can be downloaded here.

Specifications

  • Screen Size  :  2.4 inch
  • Resolution  :  240 x 320
  • LCD Color   :  65k
  • LCD Driver  : ST7781
  • Interface      : 8080 8 data bit with 4 control bits
  • Touchscreen  : 4 Wire Resistive Touchscreen

Arduino Pin Connections

Arduino Pin LCD Shield Pin Use
3.3V 3.3V Power
5V 5V Power
GND GND Power
A0 LCD_RD LCD Control
A1 LCD_WR   TOUCH_YP LCD Control / Touch Data
A2 LCD_RS     TOUCH_XM LCD Control / Touch Data
A3 LCD_CS LCD Control
A4 LCD_RST LCD Reset
D2 LCD_D2 LCD Data
D3 LCD_D3 LCD Data
D4 LCD_D4 LCD Data
D5 LCD_D5 LCD Data
D6 LCD_D6 / TOUCH XP LCD Data/ Touch Data
D7 LCD_D7 / TOUCH YM LCD Data / Touch Data
D8 LCD_D0 LCD Data
D9 LCD_D1 LCD Data
D10 SD_CS SD Select
D11 SD_DI SD Data
D12 SD_DO SD Data
D13 SD_SCK SD Clock

 How To Use.

WARNING.  The USB B-type port on the Arduino Uno R3 is taller then the headers on the board.  As a result, many shields, including this one can contact the metal shielding of the USB port, causing damage. The simplest way to avoid this is to place a piece of electrical tape, or Kapton tape, on top of the USB port to insulate it.

As with all Arduino Shields, connecting to the arduino is simply a matter of plugging the shield in. Take care to align the pins correctly, and ensure the bottom of the shield does not make contact with the Arduino USB port.

Software

We have modified the open source  Adafruit-TFTLCD library to work with the pin arrangement, and ST7781 Controller used bu this shield. Examining the examples should give a fair idea of how use these, however we are always happy to answer relevant questions. The original library was written to work with a range of different controllers and shields. While this is convenient for using boards interchangeably, we decided to strip it back to just what was needed for this shield and the ST7781 controller, rather than extend it to include one more shield. This should make the memory footprint smaller, and the code a little faster. We will continue to improve this as time permits. To use the demonstration code, download  the library from here, and extract. Copy the folder “SWTFT-Shield” from the extracted archive to your arduino Libraries folder. You will also need to install the :

 

Programming your Arduino Compatible Pro Mini, using a CP2102 USB to Serial Module

We get a lot of inquiries on how to connect to, and load a program to, our Arduino Compatible Pro Mini.

In this post I will do a brief walk-through, using our CP2102 USB to Serial Bridge Module

The first thing to do is to download the drivers. The latest version will be available from the Silicon Labs Download Page. You will need to unzip the archive before installing the driver.

Once the driver installation has completed, you can plug the CP2102 module into your USB port to confirm that your computer recognizes your new hardware.

Be sure to remove your CP2102 module from your USB port before connecting it to your Pro Mini.

For this example, I am using the cable provided with the module to connect with the Pro

Arduino Pro Mini Connected to CP2102 Module
Arduino Pro Mini Connected to CP2102 Module

Mini. If you have installed female headers to your Pro Mini, you can plug the CP2102 module directly into those. The important thing is to get the correct pins connected.

Once the CP2102 module and the Pro Mini are connected, its time to plug them back into the USB and fire up the Arduino IDE.

I tend to do a quick test of my setup, using the demonstration program Blink.

Selecting Board Arduino Duemilanove in the Arduino IDE when programming an Arduino Pro Mini
Select Board in Arduino IDE

You will need to select the virtual com port from the drop down list. If there are a few, it may be necessary to try them until you find which one is your CP2102. Check that the processor option is set as 328p, and your board is set as Arduino Duemilanove.

Press upload, and after a few seconds, you should be rewarded with a flashing LED on the Pro Mini.

 

 

 

 

 

Dual Channel, 5V Relay Module

Optically Isolated Relay Modules

We stock a range of optically isolated relay modules.  Although they come in different styles and footprints, they are all functionally identical.

Dual Channel, 5V Relay Module
Dual Channel Relay Module.

These modules require 5V to drive the relay, and are suitable for switching up to 10 A 240V AC. The optical isolation will help to protect your control circuit from damage if something goes wrong at the business end of your project.

These modules are an active low configuration. Setting the input pin to sink current causes an infrared LED inside the EL817 Optocoupler to activate. This causes an internal phototransistor to turn on which in turn activates a transistor to switch on the relay.

This is the schematic for each channel. Click on the image to view it full size.

Optically Isolated Relay Module Schematic
One Channel of our Optically Isolated Relay Modules

If you want complete optical isolation

  • Remove the jumper connecting VCC1 / VCC2 . On some models VCC2 is labeled VCCR.
  • Connect VCC1 to arduino (or other controller) 5V supply
  • Do NOT connect arduino ground to relay module
  • Connect a separate 5V power supply to VCC2 / GND2 to drive the relays

If you don’t require complete optical isolation

 

  • Jumper VCC1 / VCC2 together
  • Use one power supply to power the micro controller and the relay board

To Use With Arduino.

  • Connect arduino digital output to IN pin.
  • This is an “Active Low” configuration. The relay will be on when your output is low.
  • To ensure the relay starts switched off at power up, set your pin high before setting it as an output.

eg

That will prevent it from starting in random states.

Interfacing A 5V Relay Module With Your Microcontroller

Most microcontroller outputs can only drive tiny loads. They are good to drive a few LEDs but for anything more, they need a little help. For servos and small motors, we can switch a transistor, which can handle the larger current. When we want to controll something more substantial than a that with our Microcontroller or Arduino, a Relay can be a cost effective solution.

Single Channel Relay Module For Arduino Pic Arm Picaxe

These relay boards can handle 10A of up to 30V DC or 250V AC

They only require 5V VCC

Logic signals are 5V compatible.

 

 

Single Channel, 5V Relay Module Schematic
Single Channel, 5V Relay Module Schematic
ATtiny2313-basic-board

A Breadboardable ATtiny2313 Development Board

The ATtiny2313 is an ideal mocrocontroller for many projects. With only 20 pins, it is relatively easy to build a PCB for, it is low cost, yet it is relatively powerful.

Some of features are

  • Up to 20 MIPS Throughput at 20 MHz or 10 MIPS at 10 MHz for the ATtiny2313V
  • 2K of Flash
  • 128 Bytes Eprom
  • 128 Bytes Ram
  • One 8 bit and One 16 bit Timer/Counter with prescaler and compare modules
  • Four PWM outputs
  • Analog Comparator
  • USI Universal Serial Interface
  • USART – Full Duplex
  • SPI port for in system programming

Even with only 20 pins, breadboarding a microcontroller can be a bit of a pain, by the time you have your micro, a crystal and its caps, a reset button plus an ISP header, there isn’t a lot of room left for the rest your circuit.

This simple project makes life easier, by getting the micro and it’s support components off the breadboard and onto a nice little PCB.

To keep things simple, I have used a single sided PCB, and through hole components. I could have squashed averything together into a tiny package, but I don’t think there is any advantage in that for prototyping and experimenting. Also for simplicity I have brought all the pins to one side rather than the usual DIP format.

 

Schematic for the breadboardable ATtiny2313 project
This is a pretty standard minimalist circuit for a microcontroller.

The circuit is pretty simple, but is all that is required for most modern microcontrollers. R1 keeps the reset pin at 5V unless it is pulled low by the reset button or the programmer, C3 helps filter the power supply. I am using an ATtiny2313V-10 with an 8 MHz crystal. This same configuration will work with an ATtiny2313 and a crystal up to 20MHz.

I have used Eagle PCB design software from Cadsoft. Their free version, available here is limited in some features, but is more than capable of handling anything most hobyiests will throw at it.

PCB Layout in Eagle
PCB Layout. The red lines are jumper wires.

The layoput is pretty simple. I have left plenty of space for routing, and only have to add 2 jumper wires for unrouted tracks. The autorouting feature in eagle is pretty good.

I am using the Toner Transfer Method to etch the board, so for the bottom copper layer the image does not need to be reversed before printing.

For complete instructions on using the Toner Transfer Method see my post here.

After etching the board, I have used the same Method to label the top of the board. In this case the image needed to be printed reversed.

Modified Header Pins
Push the header pins through the plastic support to make them longer.

Since the board is single sided, the header pins needed to be pushed through from the top and soldered on the underside. To gain the extra length I have pushed the pins through their plastic support until they are flush at one end.

That’s pretty much all there is to it. After soldering the components in place, I have a useful prototyping / development board to quickly get projects up an running.

Finished Prototyping Board installed into a Breadboard
Finished Prototyping Board installed into a Breadboard for a quick test.
Finished PCB undergoing the obligatory "Blink" test

Easy PCB Creation, Using Toner Transfer Paper.

The “Toner Transfer” method is probably the simplest and most cost effective method to make high quality PCBs at home. With a little practice, any one with access to a laser printer, or photocopier, can make a quality board in around an hour. For the purpose of this tutorial, I am assuming you already have the means to design, and print your PCB.

Materials Needed

  • Toner Transfer Paper
  • Copper Clad Blank PCB
  • Blue Painters Masking Tape
  • Isopropyl Alcohol (contact cleaner)
  • Lint Free Wipes ( coffee filters are cheap and work well)
  • Fine Sandpaper (1200 or similar)
  • Clothes Iron
  • Ammonium Persulphate Or similar
  • Acetone

Instructions

I can’t stress enough that cleanliness is the key to success. Fingerprints, dust, oxidation, even fibres or a hair can cause problems.

PCB image printed on plain paper
Print PCB Image on plain paper.

Mark a piece of paper in your printers tray, so you can identify the direction easily then print your PCB design.

Cut a piece of Toner Transfer Paper a little larger than your artwork, and tape it to the sheet of paper you printed covering your design. You need to have the shiny side facing up. Tape it top and bottom, making sure that the corners are taped down and the tape is cleanly fixed to the paper. Folded back corners may cause the paper to jam or tear in the printer, or allow adhesive from the tape to stick to the print rollers.

Toner transfer paper taped over printed PCB image.
Tape a piece of toner transfer paper over your PCB artwork.

 

At this stage I usually wipe the surface of the Toner Transfer Paper lightly with  a lint free cloth that has been slightly dampened with Isopropyl Alcohol on. This is not always necessary, but will remove any fingermarks, and helps with some printers that struggle to print cleanly on the glossy surface.

Place the paper in the print tray and reprint your design. If you have put the paper in the printer the right way around, You will now have your pattern in the middle of your Toner Transfer Film, ready to be transfered to your board.

PCB Artwork printed on toner transfer film.
Pepare a piece of blank copper clad board.

Your blank PCB should be cut to the correct size, and any rough edges and corners should be smoothed with sandpaper. It is essential that the top edges are not rough. Clean the copper surface under running water, first with detergent, then with fine sandpaper. I find 1200 grade wet and dry paper works well. Sand until the surface is shiny all over, but don’t sand away too much of the copper. Dry the board with a lint free cloth, and then clean the copper with acetone or isopropyl alcohol and another lint free cloth.

The iron will need to be heated quite high, and should NOT be set to steam. I use the “cotton” setting on mine .Place the blank on a heat resistant surface and position the toner transfer paper with the toner against the copper. Hold it in place and press down on one side with the iron. Around 20 seconds will stick the transfer paper in position. Now press the iron down over the entire board. Hold firm downwards pressure for 30 – 40 seconds before removing. Don’t slide the iron around or you will smudge your image, and firm pressure is all that is needed.

Toner Image transfered to the blank PCB
After carefully removing the Toner Transfer Paper. Note almost no toner remaining on the paper.

Cool the board and paper under running water then slowly peel the toner transfer film away from the board. Start with one corner and peel towards the other corner. Almost no toner should be left on the paper. If the image is coming away with the paper, stop and re iron.

At this stage you need to examine the PCB carefully for missing tracks or pads. If you have been meticulous, there shouldn’t be any, but it can difficult to keep everything spotless, especially if you are working in a dusty old shed. No worries though. Permanent markers also resist etchant, so you can touch up any gaps with a fine marker.

PCB being etched.
Etching the PCB

Once you are sattisfied, etch yor board following the instructions provided by the etchant manufacturer. I use Ammonium Persulphate. The instructions say to mix 400 grams of etchant crystals with 1.5 litres of water. For he board in this demonstration, I used One and a Half Tablespoons of crystals to 60 ml of near boiling water. I agitated it by shaking back and forth. Etching took around 4 minutes. With Ammonium Persulphate, the water needs to be hot. Agitation is PCB after etching and drillingalso necessary to etch the board evenly. Etching causes bubbles of gas to form on the board, and these need to be disloged from between close together tracks or the copper will not be removed from those areas. If shaking does not clear the bubbles, I find a gentle wipe with a small paintbrush works. Etch untill all uncovered copper is gone. Then rinse with clean water.

Drill holes with appropriately sized drills.

Finished PCB undergoing the obligatory "Blink" test
Finished PCB undergoing the obligatory “Blink” test

After etching and drilling, use acetone and a rag to clean away the toner and expose the copper tracks. If you are not going to use the board immediately, you can leave the toner on to help protect the copper from oxidation. The labeling on the board pictured was also done using the toner transfer paper, and ironed on after etching.