Rustic Engineering

My Mind working on…

Posts Tagged ‘electronic

OLED Display (SH1101A) and DS18B20 (with C18 example code for download)

with 12 comments

For who need SH1101A OLED driver, I’m posting here my code (written in Microchip C18, but easly to port to other platform) to help more people on get use this great OLED display. It’s not finished, yet, but it’s very useful.

Demo code running


The code has geometric draw functions to draw single pixel, lines, rectangles and circles with fill option. There’s  characters output functions too, with 8×6 pixel font.

The icons for Battery (animated), Bluetooth, WiFi, Sound (animated), etc are on the code too.

Some example of available functions are:

  • SetPixel(), GetPixel();
  • Line();
  • Bar();
  • Character output functions, PutROMString(), PutString();
  • PutImage();

In the code you’ll find a DS18B20 Dallas OneWire Digital Temperature sensor driver too. That’s a limited version (only work for one sensor in OneWire bus) but works great. You get a float reading plus a string with temperature value (in Celsius Degrees). More improvements coming soon.

Well, let’s go to download link:

DS18B20 with 12bit resolution!

If you have any trouble with that code, email-me or let me a comment.


Written by forrequi

November 26, 2010 at 01:03

Lithium Polymer Battery USB Charger

with one comment

Finally I’ve finished this project. It’s a USB Charger for Lithium Polymer Battery, that’s very compact and high powerful batteries that I use in most of my projects.

A tiny and elegant charger...

All sides...

In my recent GUI Bot project I’ve used the famous MAX1555, a greatest IC in a tiny SOT23 package. One thing about MAX1555 that I don’t like is the current limitation it has (about 100mA). I know it’s for USB low speed compatibility, but who knows someone that don’t have a high speed USB host surround? Because that I use the greatest MAX1811. It’s a great IC too, but can deliver up to 500mA! See one of my first post to check more details.

That’s the finished work:


If anyone like this circuit, email to

Written by forrequi

March 10, 2010 at 23:40

USB Small Peripheral Board (aka PIC18F14K50 Board)

with 10 comments

Recently I’ve working with the little but smart PIC18F14K50 (or your low voltage version, PIC18LF14K50). These chips are cheap (about $2,5 at Mouser) and have low pin count, but very impressive specs:

  • USB V2.0 (low and high speed);
  • NanoWatt feature (sleep with 24nA!);
  • 10-bit A/D converters with auto-acquisition;
  • PWM;
  • Several Internal Clock modes;
  • 16KB Program Flash Memory;
  • 768B SRAM;

They help me with USB development. The low pin count don’t became a problem because most of times, my projects don’t use all them (in case os PIC18F4550 or PIC18F2550).

I think that it’s a good choice to design some little USB devices, like:

  • A USB accelerometer;
  • A USB thermometer;
  • A USB logger;
  • A USB GPS;

The possibilities are awesome!

Microchip develops a kit, called “Low Pin Count USB Development Kit” to present this chip. But the Microchip kit have dimensions, don’t very suitable to work like a real USB peripheral.

So I design a little board, with minimum parts to make it work. The board is a first prototype, a experiment. If works, I’ll improve it with more polish design and features, and design one with PIC18LF14K50 for 3.3v native support  and etc.

You can see the circuit and board below:

Written by forrequi

December 23, 2009 at 03:16

Posted in electronic, pcb, projects, USB

Tagged with

MP4 Powerpack – LiPoly Charger Hack – Part 2 (and final)!

leave a comment »

In this post, i show that in many cases, the solution is just a simple change, without any new circuit. I was surprised with the solution… and maybe you be too. The circuit of the power and charger stay above, end the first thing that pay attention is that the diode arrange in the first stage has a function of isolate the USB power and the wall adapter power.

MP4 Power Circuit

Then, I put a jumper between the pins of D202 diode and test it…..Shazam! Worked!

MP4 green wire hack

Now, see the MP4 sign charge:

Final test with USB - Shazam!

The one issue is that’s not possible to connect both USB and DC wall adapter, because now, we have a direct connection between it’s. Maybe in the version 2.0 of the hack, i really change the MP4 circuit to fix it 🙂

For now, the solution it’s OK!

Written by forrequi

November 20, 2007 at 12:29

Posted in electronic, hack's

Tagged with , , ,

MP4 Powerpack – LiPoly Charger Hack – Part 1!

leave a comment »

In my last travel to São Paulo, i bought a MP4. It’s a “MP4 with 1GB internal flash, SD expansion slot, Aux. Input and… FM radio“.

It’s a great gadget, and now it’s my iPod best friend. The only issue is that the USB mini B port in the back is for data access only. Don’t charge the battery !!! Bad design, bad…

I don’t understand why the hell they make a device like it without this primary feature, but i understand that it’s a great opportunity to hack it!

Let’s dissect it:

Inside MP4

And now, a amputation:

Secundary board

First items to highligh:

  • 1700mAh Polymer Lithium Ion Battery (LiPoly);
  • TPS61032 Boost Converter;
  • TPA2008D2 Stereo Audio Amplifier;

The next step (Party 2) is obtain the schematic from the board.


Written by forrequi

November 13, 2007 at 13:03

Posted in electronic, hack's

Tagged with ,