Showing posts with label Wiseduino. Show all posts
Showing posts with label Wiseduino. Show all posts

Saturday, May 9, 2020

wsduino revision 2

Honestly, I think the hacking required to add buttons for hours and minutes to the Rothko clock is messy. But if  you want an easy, quick and intuitive way to set the time, there is no alternative for buttons; remote control (IR, XBee, BT) would require extra devices, GPS or NTP would need settings. Since the Nixie shield board is already overcrowded, the logical place for the buttons would be on wsduino. And this is the main reason I had to redesign it.
I opted for two right-angle tactile switches placed on the right side of the board, above and below the XBee module. These switches, connected to A0 and A1, are intended mostly for clock functionality, optional for other applications. They could also be replaced by wired external (panel-mounted, not on-board) buttons, when an enclosure is used.

This is how the new wsduino board looks.



Other improvements are:
  • moved the 3V3 regulator for better heat dissipation (it was on the opposite side of 7805);
  • moved the electrolytic capacitors around, to allow for easier removal of the processor from the socket;
  • moved the 1Hz output to a pin between the banks of analog and power pins;
  • removed the SDA and SCL from the top bank of digital pins (they were redundant anyway, plus makes more room for the screw and nut);

The switch that fits wsduino is number 24 in the chart below (used by sellers on ebay):

To recap, wsduino is the arduino-compatible board with DS3231 RTC and XBee support. To build a clock, just add a display shield like the 6-character LED display, the bicolor LED matrix shield ("Mondrian clock") or the 6-tube Nixie shield ("Rothko clock").


Sunday, July 5, 2015

Introducing wsduino

This project is actually a revisit of my old Wiseduino, with the same goal: an Arduino-compatible with on-board Real Time Clock, and some extras (in this case, an XBee-like device, e.g. BTBee, GPSBee, WiFly). I renamed it "wsduino", although the pronunciation should remain the same :)

I redesigned wsduino mainly for the Axiris IV3 clock, whose enclosure allows for only 2 boards (Arduino + IV3 shield), with openings for power socket, USB, and no accessible buttons. Essentially, wsduino saves you an extra shield, which would have hosted the RTC (+backup battery) and the XBee.

 US$27 - free shipping to North America

wsduino is now available as a kit, as shown in the photo below.


The wsduino kit includes:
  • PCB
  • ATmega328 processor with bootloader
  • 28-pin socket
  • 16MHz crystal
  • 2 x 22pF capacitor
  • power jack
  • 7805 voltage regulator
  • 1N4001 diode
  • USB miniB socket
  • DS3231 RTC (SMD)
  • A1117 3V3 regulator (SMD)
  • CR1220 battery + holder
  • 4 x 10k resistor
  • 4k7 resistor
  • 3 x 100nF capacitor
  • 47uF/25V capacitor
  • 47uF/16V capacitor
  • 470uF/10V capacitor
  • 2 x 10-pin 2mm female header for XBee
  • 40-pin 0.1" female header
  • 3-pin header + jumper (selection of power source)

An FTDI breakout is required to upload sketches.

Although the assembly is quite trivial, I enumerate below the steps, for the detail-oriented :)
  1. solder the DS3231 SMD chip on the bottom of the PCB, making sure the chip orientation is correct;
  2. solder the A1117 chip, also on the bottom of the PCB;
  3. solder the resistors R1-R4 (their values are shown in silkscreen);
  4. solder the IC socket, with the correct orientation of the notch; then insert the ATmega328 chip (after you bent the two sides of pins on a flat surface, one side at a time, to become parallel);
  5. solder the crystal (orientation does not matter)
  6. solder the USB miniB socket;
  7. solder the 7805 voltage regulator to match its shape in silkscreen;
  8. solder the ceramic capacitors (orientation does not matter);
  9. solder the 3 electrolytic capacitors, paying attention to their orientation;
  10. solder the diode, also paying attention to its orientation;
  11. solder the power jack;
  12. solder the 2 XBee headers;
  13. cut, then solder, the extension headers;
  14. solder the battery holder, then insert the battery.
Schematic and board layout are shown below.



Here are some photos of the assembled board.

A  minimal wsduino is shown below, with the ATmega328 running on the internal oscillator at 8MHz, powered directly through the USB miniB socket.


The RTC (DS3231) and 3V3 voltage regulator are soldered on the bottom.


Perfect Arduino-compatible to quickly build a clock. Just add a display shield :)



Friday, July 3, 2015

Wiseduino Next Generation

You have a "tube shield" like the Axiris IV3 shield or the Nixie shield and you want to make a clock. You will definitely need an Arduino. You can either program it to (roughly) count the seconds, minutes, hours, or you can add an extra RTC, specialized in (accurate) time keeping, and program your Arduino to just get the time from RTC. The latter is Wiseduino, the first board I ever designed (also discontinued a long time ago). I badly needed one to finish the Axiris IV3 clock, since neither the software solution (second-counting) nor the hardware solution (adding a second RTC shield) was suitable. And so I re-designed it, improved on existing features (power, RTC) and added new ones (support for XBee/BTBee/GPSBee). This new version, spelled "wsduino" (but still pronounced "wiseduino") is shown below, next to the Axiris IV3 shield.


The wsduino board has an Arduino-compatible footprint, so it fits perfectly in the Axiris-designed-and-made enclosure (which I got as a gift from Nick :).


As you notice from the photo, the crystal is optional. Lately, I prefer to run the ATmega328 processor with the internal oscillator at 8MHz. The fewer the parts, the fewer the points of failure (and also cheaper). The wsduino board can be powered from either the USB miniB connector, or from the barrel connector, through a 7805 voltage regulator, selectable with a jumper. The board also has a 500mA 3V3 regulator, soldered on the bottom.

The DS3231 RTC is also soldered on the bottom. An XBee-footprinted serial device is connected to Rx/Tx of ATmega328, with voltage-divider level-shifting for Tx (pin D1). For the Axiris clock, I used the BTBee as a way to set the time and date, since the enclosure was not designed with buttons in mind. The sketch can be found here.


The photo below shows a couple of wsduino bare boards, top and bottom.


wsduino kit can be purchased here.

Friday, November 4, 2011

CubeClock

This would make a nice replacement for the original glass-domed WiseClock.


















I named it CubeClock for the simple reason that it is encased in a baseball display case, found on ebay for about $5.
It includes Wiseduino (with on-board RTC), a LiPo battery shield (I used the one from seeedstudio, but others should work too), a prototype shield with the cheap "orientation sensor" introduced here, and the bi-color LED mini-display shield.

The bottom board is the Wiseduino, secured to the box with 2 screws. The other shields are just stacked on top of each other. The battery shield from seeedstudio, discussed here, uses a 1,000mAh LiPo battery (did not come with the shield), attached to the shield itself with plastic ties. The clock can be turned on or off (to save the battery) from the power switch on the Wiseduino.

CubeClock can also be powered through the USB cable plugged into the battery shield (which also charges the LiPo battery), as shown below.















A closer look is shown in the next photo. The 2 buttons on the mini display shield and the power switch are on the opposite side. They are accessible after the top of box is removed, as is the FTDI connector.















The current sketch running on CubeClock is almost identical to the one on SillyClock (and IllyClock, for that matter), since the mini display shield uses almost the same schematic as the dual bi-color LED matrix shield.
The next release of the software should involve the "2-axis tilt sensor" (already connected on pin A3) to change the display according to its orientation. It could also include the displaying of messages from the 32KB EEPROM on the Wiseduino board (as does the glass-domed WiseClock).

Other ideas:
  • add infrared receiver (on D2, with interrupt; code picked from WiseClock);
  • add buzzer (on D16/A2, the only pin left unused at this point) for alarm clock functionality (half-implemented in the software already).

Wednesday, August 3, 2011

IllyClock revisited - the minimalist look

Remember IllyClock, the Arduino-alarm-clock-in-a-coffee-can (featured on Instructables.com)?

We now have a new streamlined version, featuring rechargeable battery shield, tilt switches, infrared receiver, buzzer.
Although some of the "cool factor" is lost, this version is easier to build, a bit more practical (it is "portable") and smarter (with new, extended, software).
















It was just a matter of time until someone would prefix the name IllyClock with an S. I wanted to be the first one on the record to do that; so from now on, we'll name this new version SillyClock.

NOTE: One more reason to call it "silly". I wrongly assumed that the previous IllyClock sketch, referencing a rotary encoder, would work without modifications with the new dualRG LED matrix shield, which has the rotary encoder replaced by two buttons. My apologies to anyone whom I misled with my assumption. The modified code can be downloaded from here. This file contains the sketches for both IllyClock (with rotary encoder; identical with the old code) and SillyClock (with 2 push buttons).

SillyClock is built using:
  • Wiseduino+ (Arduino-compatible, with ATmega328, has on-board DS3231 real time clock and 256KB of EEPROM);
  • dual RG LED matrix shield (has on-board tilt switch, two push buttons and infrared receiver);
  • Li-Ion battery shield (third party, there are many out there to chose from);
  • a second tilt switch and a piezo buzzer, both placed in the proto-area of Wiseduino+;
  • two laser-cut plexiglass plates (plus standoffs, screws and nuts) as enclosure.















Here is a (TODO) list of  features I will add to the software in the next few days:
  • take advantage of the tilt switches to display scrolling time and quotes when the clock is placed horizontally, as in BookClock;
  • make use of the Infrared receiver for remote control;
  • hourglass;
  • kitchen timer.
On the hardware side, I would add, under the back transparent plate, a solar panel for recharging the battery (this feature is supported by the battery shield, I believe). Stay tuned.

Saturday, December 4, 2010

Wiseduino revision 1.7

Updated May 16, 2011
Courtesy of Scott, for those who want to take a quick peek (without downloading the Eagle files), here are the schematic in PDF and the board in PDF.


Updated Dec 14/2010
Revision 1.7 has a glitch: SCL and SDA pins of DS1307 are left un-connected. This should be an easy fix (shown in the photo below), yet an embarassing mistake on my side.




So here is the deal: until the whole lot is gone, every buyer of Wiseduino kit will get an extra one of these boards for free, or any other freebee by request.




Wiseduino is one of many Arduino clones, fully compatible with Arduino shields and Arduino software environment (IDE).
What makes Wiseduino unique is the on-board real time clock (with DS1307)(*) with backup battery, and the 32KB EEPROM (with 24LC256).

(*) Wiseduino+ has on-board DS3231, an extremely accurate real time clock.

The latest revision of Wiseduino is blue (as I mentioned in a previous post, black boards are not a choice these days anymore). In addition, these are the other differences:
  • changed layout: some of the parts are a bit re-organized;
  • oscillator can also take a crystal (not only a resonator as before);
  • manual trace routing: allowed for better connections (no traces between the header pins, for example).

All the other great features :) are still in place:
  • on-board DS1307 (real time clock) with backup battery, and 24LS256 (EEPROM);
  • support for XBee adapter from Adafruit (radio communication, remote uploading of sketches);
  • parallel row of headers, compatible with prototyping boards;
  • power micro switch;
  • detachable prototyping area, with pad for an 8-pin SOIC;
  • all ICs on sockets;
  • 6-pin FTDI connector for uploading sketches (requires FTDI cable of FTDI breakout).

The new board is shown in the photo below.













I personally used Wiseduino for the WiseClock and BookClock projects. Others have used it for data logging (recording data to the external 32KB EEPROM) and general Arduino projects (since it is shield and software compatible).

The (corrected) board layout looks as in the image below.















The Eagle files can be found here (download schematic, download board).


Related posts:

Monday, November 1, 2010

Wiseduino+ kit available for sale

Update July 5, 2015
A redesigned wsduino kit is now available.

Updated Apr 24, 2012
This kit is DISCONTINUED (not available for sale anymore).

If you are looking into building an Arduino-based clock or a system that requires time keeping, this board is for you. Wiseduino+ not only offers an on-board real time clock, but an extremely accurate one, based on the DS3231 chip from Maxim.

Wiseduino+ is fully compatible with Arduino Duemilanove, from both the hardware (shields) and software (Arduino IDE) perspectives.

Since many people dislike (or are not comfortable with) soldering SMDs, the kit comes with the RTC chip DS3231 already soldered. (Note that there is no DS3231 in DIP form available.) All other parts are through-hole. Sockets are provided for the two other ICs (ATmega328 microcontroller and 24LC256 EEPROM).

Wiseduino+ kit contains the following parts:
  • PCB (green), with a (cuttable) prototyping area;
  • ATmega328 microcontroller chip, with 28-pin DIL socket;
  • DS3231 RTC chip, soldered on the board;
  • 24LC256 EEPROM chip, with 16-pin DIL socket;
  • 16MHz crystal;
  • 2 x 22pF capacitors;
  • 2N2222 npn transistor;
  • 4 x 100nF decoupling capacitors;
  • 6 x 10k resistors;
  • 40-pin female header;
  • CR1220 coin battery, with socket;
  • micro power switch;
  • 2-pin polarized power connector with wires attached;
  • clip for 9V-style battery (for use with a battery holder ONLY; NEVER connect to a 9V battery);
  • 6-pin right angle male header, used as FTDI connector.
To assemble the board, use the same (similar) instructions for building Wiseduino.
A partially assembled board is shown in the photo below.



From the software perspective, any sketch developed for Wiseduino should work without changes on Wiseduino+.


Related postings:

Saturday, October 30, 2010

Introducing Wiseduino+

Updated June 10/2011
Added images of the schematic and board and provided the Eagles files.

On this new Arduino-compatible board, similar in form and function to the older Wiseduino, DS1307 was replaced with the extremely accurate real time clock DS3231 from Maxim.

All the other feature were left intact:
  • ATmega328;
  • on-board real time clock with battery backup;
  • on-board EEPROM (32K);
  • connector for XBee adapter from Adafruit (with remote upload capabilities);
  • parallel row of prototyping board-compatible headers;
  • power switch;
  • prototyping area (which can be cut off, if desired, and used as breakout for an 8-pin SOIC SMD);
  • 6-pin FTDI connector;
  • sketches for Wiseduino work without modifications.
Enhancements include:
  • ability to use either resonator or crystal (and 2 capacitors);
  • ability to connect to the interrupt pins of DS3231;
  • better (manual) trace routing.

Here are the top and the bottom of the board:














Here are Wiseduino+ and Wiseduino (both partially assembled) side by side:














As a note, the PCB manufacturer cannot currently make black boards anymore (or it is prohibitively expensive).

Thursday, May 6, 2010

New version of Wiseduino

The new Wiseduino board offers several improvements (I would like to think) over the old one:
  • prototyping area, with pads for an 8-pin SOIC chip; this part can be sawed off along the fine holes, to match the dimensions of a small shield (and of the previous version); the intention was for this piece to be broken off by hand, but the PCB is too thick to make this possible;
  • two mounting holes for screws/standoffs;
  • power (5V) provided through the FTDI connector as well;
  • through-hole power switch.



The prototyping area can be used to add buttons, buzzer, LEDs, or even a voltage regulator.

Eagle files are available: schematic hereboard here.

Related posts:

Saturday, May 1, 2010

Prototype of an analog clock with LEDs

Inspired by Makerbot Watch, I designed my own version of an analog clock with LEDs.

The prototype uses a Wiseduino with DS1337 and a protoshield with 24 SMD LEDs.
Physically, on the board, the LEDs are placed in 2 "rings" of 12, the outside ring designated for minutes (red LEDs), the inside one for hours (green LEDs).



In the circuit, the LEDs are organized as a matrix of 5x5, as shown below.



The challenge is to display the time in an intuitive manner. For example, an analog clock moves its hour hand proportionally with the minutes. This is hard to achieve with relatively few stationary LEDs. Tricks need to be "invented" and even those may not be enough for an "accurate" display. Watch this video and let me know if what's shown is intelligible as a clock reading.




As seen in the video, the time is shown after the button is pressed. There are two reasons for that:
  • since LEDs are the biggest consumers on this board, try to light them up only when necessary;
  • for counting the flashing minutes there should be a start moment, and this is what the button provides.

Since this project will eventually evolve into a wrist-watch, a very important aspect is the power consumption.
Here are a few numbers so far (idle current/current with LEDs on):
  1. normal loop, with no sleep: 4.7mA/12.2mA
  2. "unoptimized" sleep mode most of the time: 0.13mA/12.2mA
  3. "optimized" sleep mode: (to be completed)

To be practical as a watch, it will need a way to set up the time, which may require a second button (plus software, of course, to navigate the hours and the minutes).

Optionally, the watch may also have an alarm. This feature would require a small buzzer (plus, again, software to set up the alarm time and to activate the sound). The board size will be bigger and current consumption will be greater.


Somewhat similar projects on the interwebs (both featuring Microchip microcontrollers):

Thursday, April 8, 2010

Countdown timer prototype

While waiting for an 8MHz resonator to finish a previous project and post the result, I put together a prototype of a countdown timer that shows the time passing by changing the display color from green, through orange, to red.

This is just a different way to display information, color versus digits, similar to analog vs digital speedometer, if you will.



The timer is built with an Arduino Diecimila (with ATmega168) and the LED matrix shield.

Sunday, March 21, 2010

Wiseduino with DS1337

DS1337 is another real time clock (RTC) from Maxim, closely resembling DS1307 that comes with the Wiseduino kit.

The main difference between these two chips is the ability of DS1337 to handle (set, trigger) an alarm. Otherwise, both have similar pin configurations, both "talk" I2C, and both use a 3V coin battery (DS1307 only as backup, DS1337 as the only power source).

Many others have included DS1337 on their boards and wrote libraries for this chip. I thought I should give it a try myself, especially because of the alarm capability. The easiest way was to modify an Wiseduino board, by cutting 3 traces and adding 2 wires, as shown in this image:



The cuts are shown with yellow lines, the wires are light blue. The rightmost cut is on the back of the board.

Updated Apr 17/2010
After I started the actual work, I realized that, since DS1337 is powered by the 3V coin battery, voltage level adapters (on SCL and SDA lines) need to be used between the clock and a 5V-powered Wiseduino. So I decided to power Wiseduino with 3V as well (2xAA batteries). This means the frequency cannot be 16MHz (according to ATmega168/328 datasheet); so I installed an 8MHz resonator instead. So far so good. I am able to upload the DS1337 sketch and read back the time. Current consumption is a under 5mA.

Here are a few other things I did to make this work:
  • on Wiseduino, I am using an ATmega168 with the bootloader, instead of the 328;
  • I changed boards.txt to accommodate the 8MHz working frequency:
diecimila.upload.speed=9600
#diecimila.upload.speed=19200
...
diecimila.build.f_cpu=8000000L
#diecimila.build.f_cpu=16000000L
  • tried unsuccessfully JLuciani's DS1337 library; it seems to require/use a different set of "wire" files than those coming with Arduino IDE 18; confusion ensues; files and functions need to be renamed etc etc; I just gave up;
  • tried, with limited success, xSmurf's DS1337 library; there seem to be multiple versions of the DS1337 class (and header), no sample sketch that uses the class; I had to eliminate some alarm-related stuff, define some macros etc. In the end, I have a simplified version working;
  • to upload the sketch to the board, I used the 3V3 version of the FTDI breakout from sparkfun (the 5V has the signal voltages too high).
Next steps:
  • put the microcontroller to sleep when time is not read (this will reduce the consumption to micro amps, hopefully);
  • implement the alarm functionality, with interrupts.

Conclusion DS1307 vs DS1337:
  • DS1337 should be used in a 3V3 environment; it is not meant to be mixed with 5V signals;
  • DS1337 libraries I looked at so far are pretty finicky compared to DS1307 libraries;
  • an equivalent of (that is, as easy to use as) DS1307 for 3V3 is DS1340 (used by JeeLabs in their JeeNode boards).

Saturday, March 13, 2010

BookClock - new member of the Wise Clock family



Don't throw away that carboard box your Monochron was packaged in. You can use it as enclosure for the cheapest (yet) member of the Wise Clock family, currently named "BookClock" (for the reason that it can be placed on a book shelf, among books).

Note: The featured cardboard box is sold by ULine. It has the code ULine S-974 and can be found here.

The BookClock contains only two elements: Wiseduino, of course, and the 8x32 LED display from Sure Electronics. One nifty addition is a tilt sensor that changes what is displayed depending on the clock orientation (standing on the smallest side as a book, or laying flat on the largest side).



To build it, let's start with the enclosure, the cardboard box. With an xacto knife, cut an opening for the display.


The opening, waiting for the display, should look like this:


Stick some scotch tape along the cut lines to strengthen (and also smooth) them.
After inserting the display, attach it to the box with some sticky tape (I used electrical tape).
This is how it looks when standing, as a book on the shelf.


The "guts" of the BookClock is a "hacked" Wiseduino board, which looks like this:


This board does not have the extension (female) headers, since there will be no shield mounted anyway. So I soldered (the required wires of) the 16-wire ribbon cable directly where the headers would have been.

Wires number 15 and 16 of the ribbon are GND and Vcc (5V) respectively. For mechanical reasons I soldered them into D0 and D1, whose lines were previously cut. (I then re-connected D0 and D1 to Vcc and GND respectively, see the red and blue wires.)

The board also has a tilt sensor soldered between analog 0 (A0) and ground. A 10K resistor pulls A0 up (connects it to Vcc).

This is how it looks on the inside (not yet connected to power).

Thursday, February 11, 2010

Wiseduino and XBee

This is a long-overdue piece of documentation, which I started many months ago and never had a chance to finish. It may not be totally complete even now, but at least it gives some direction towards the integration of the XBee radio and Wiseduino.

One of the features of Wiseduino is the ability to plug in an XBee adapter from adafruit, in the designated 10-pin female header (provided in the Wiseduino kit). The intention is for this header to be soldered on the back of the board, as shown in this photo:



The XBee adapter should be plugged in as shown in the following photo:



Beside the wireless communication, the XBee adapter provides a few more services:
  • remote sketch upload;
  • 3V3 for the main board, usable by other shields (about 50 mA worth);

In order to use it with Wiseduino as in the setup shown above, the XBee adapter requires a few little modifications.

1. The first is a trace cut, as pictured below:



Basically, the two extreme holes for the header are connected together, and to 3V3. We are going to use one of these redundant connections for our purposes, and that is to access XBee's pin D3 from the Wiseduino board (as explained in adafruit's XBee tutorial).

2. Secondly, the straight header (provided in adafruit's kit) must be soldered perpendicular to the board.

3. Thirdly, a wire needs to be soldered between D3 and the extreme left pin of the header (the one that was isolated at step 1 by cutting the trace).



Before inserting the XBee radio module, the adapter should look like in the photo below.



After the hacks are done, for the remote sketch upload, just follow adafruit's great tutorial.
Notice that the small circuit with the transistor in the mentioned tutorial is already implemented on the Wiseduino board.

Related posts:

Friday, February 5, 2010

Introducing IllyClock - alarm clock in a coffee can

Updated Aug 3/2011
Check out the "minimalist" version here.




Borrowing from Ladyada's idea of encasing the MintyBoost in an Altoids tin box, I thought that a coffee can, Illy in particular, would make a good enclosure for an alarm clock.

The electronics is based on Wiseduino (Arduino clone with DS1307 real time clock on board), with a LED matrix shield sitting on top. The shield is built with 74HC595 shift registers that drive two bi-color (red, green, and orange by subtraction) 8x8 LED matrices.

The clock uses a rotary encoder with button as the only user input.
The functionality is simple and intuitive:
  • time is shown as hour and minutes;
  • clicking the button will show, using the symbol of a bell, the state of the alarm (enabled or disabled);
  • double clicking the button will show the alarm time and allow the user to set the alarm hour and alarm minutes (toggle between the two by clicking the button); increment the numbers by rotating the knob;
  • holding down the button will allow the user to set the time;
And here is an original feature: three hours before the alarm will sound, the time is shown in orange; one hour before the alarm will sound, the time is shown in red. So just by squinting at the clock, one can realize how much longer one can sleep.

Here it is in action:


A few details on the dual matrix shield can be found below.
(I will dedicate another post to this shield though.)





The shield was originally designed (as it is shown in the schematic above) to be equipped with an infrared receiver and a push button. "Hacking" it to take a rotary encoder instead is trivial.

The diagram below shows how the user can change the clock's state by either rotating the encoder or pushing the button.





Related:

Tuesday, September 15, 2009

Finally! PCBs galore!

After a long and anxious wait, I finally got the PCBs for Wiseduino and the LED matrix shield.
All outstanding orders will be shipped today.
Thank you all for 3+ weeks of unbelievable patience.














All future orders will be mailed the same day.

Sunday, August 30, 2009

Testing Wiseduino - EEPROM

This is the second post related to the testing of Wiseduino. The first one talked about RTC and it started by showing how to correctly plug in the FTDI cable or the FTDI breakout.

Now lets move on, to the external EEPROM, a 24LC256 memory chip, with a capacity of 32KB. It is connected on I2C (analog 4 and 5) and uses the Wire library to talk with the microcontroller.

We will test the EEPROM by loading some text from a file. This is how this works: a program on the PC reads the text file and sends the characters to Wiseduino, which, in turn, is running a sketch that reads the incoming characters and saves them to EEPROM.

Download the sketch here.

Some VBscript code is included at the bottom of the pde file. Cut and paste that VBscript code into its own file, and name it writeFileToCom.vbs, for example (the extension vbs is mandatory). (This is tested and working on Windows. On Linux or Mac OSX, this script needs to be re-written.)

How this works was explained earlier, in this post.

With the eeprom_quotes.pde sketch uploaded, Wiseduino waits for characters to be received from the PC. Now execute the writeFileToCom.vbs VBscript by double clicking on the file (Windows associates the file with its script engine, wscript.exe).
The VBscript opens the file C:\docs\quotes.txt, reads 10 characters at a time, then sends them over the serial port, until the end of file is reached.
Two things are required in preparation for the text transfer:

  1. create the C:\docs\quotes.txt text file (or download this file to c:/docs);
  2. in the VBscript, change the COM port number from COM7 to the one you are using;

The process of transferring the content of the file takes about 10 minutes for a 32KB of text at a baud rate of 9600.

We check that the text was saved correctly in the EEPROM by reading its content. We will use the same eeprom_quotes.pde to read data from EEPROM. To do this, open the serial monitor, then type "\l" (backslash, lower l) in its input box and hit "Send" button. The bottom window should start displaying the lines of text stored in the EEPROM.


Related posts:

Testing Wiseduino - Real Time Clock

Updated Oct 4, 2010
The most recent version of Wiseduino has pin 4 of the FTDI connector wired to Vcc (5V). Therefore, when the FTDI connector is plugged in, the board is powered.

With the Wiseduino board assembled, we can start testing it by uploading some sketches.

To upload the sketches, you would need the FTDI cable or the FTDI breakout.
Make sure that the FTDI cable or the FTDI breakout are plugged in correctly, as shown in the photos below.





















Also, make sure the board is connected to power (preferably 4 AA rechargeables) and the power switch is in the upper position, as in the above photos. This is because pin 4 of the FTDI header, with 5V coming from FTDI, is not connected to the board. There were two reasons behind this decision: 1) a switch between the external power and FTDI should have been used, and 2) FTDI cables and breakouts come in 2 flavours, 5V and 3V3.

Never power Wiseduino with more than 5V.
Do not connect the supplied battery snap to a 9V battery because it will damage your Wiseduino. The snap is for battery holders, normally holding 4 AA rechargeables (as in the above photo).


After launching the Arduino IDE, make sure the right board and serial port are selected, as shown in the images below.













Lets start by testing the RTC. First, download this sketch and install it (unzip it) in the arduino/hardware/libraries folder. A new folder, named rtc, will be created, and it will contain the RTC class (courtesy of Arduino playgroung) and the rtc.pde sketch in the examples subfolder.

Load the sketch into Arduino IDE (13 or later). Change the time in setup() function, then compile it and upload it to the board.

The sketch sets the current time into the RTC:


void setup()
{
  Serial.begin(9600);
  RTC.stop();
  RTC.set(DS1307_SEC, 20);
  RTC.set(DS1307_MIN, 49);
  RTC.set(DS1307_HR,  19);
  RTC.set(DS1307_DOW,  4);
  RTC.set(DS1307_DATE,22);
  RTC.set(DS1307_MTH,  1);
  RTC.set(DS1307_YR,   9);
  RTC.start();
}

then, almost every second, it retrieves the time from the RTC and it displays to the serial monitor:

void loop()
{
  updateTimeBuffer();
  delay(1000);
}


void updateTimeBuffer()
{
  int rtc[7];
  RTC.get(rtc, true);


  int second = rtc[0];
  int minute = rtc[1];
  int hour   = rtc[2];
  int day    = rtc[4];
  int month  = rtc[5];
  int year   = rtc[6];


  Serial.print(hour);
  Serial.print(":");
  Serial.print(minute);
  Serial.print(":");
  Serial.print(second);
  Serial.println("");
}

After uploading the above sketch once, the RTC has the current time and it will keep the time even when the Wiseduino board is not powered (due to the onboard backup battery). Now, modify the rtc.pde sketch by commenting out all lines in setup(), except Serial.begin. This will ensure that the microcontroller does not set the RTC every time the board is reset or powered.

Next, let's play with the EEPROM.

Related posts: