Worklog #2: Handling joystick input on Arduino and LinkIt ONE.

After expanding the LinkIt ONE and Arduino analog inputs, I had to find a proper way to handle user input. The easier and most convenient way was using an analog joystick, so I ordered one off AliExpress.

As I figured it will take way too much time to get here, I decided I’d open up my Xbox 360 controller and use its joysticks in the meanwhile.

 

Butchered 360 controller. Red = VCC, Violet = GND, Yellow = A0, Orange = A1.

Butchered 360 controller. Red = VCC, Violet = GND, Yellow = A0, Orange = A1.

Joysticks are made by joining two analog pots together (one for vertical movement, and one for horizontal) and a tactile button.

Continue reading

Building a 3-channel, high power RGB LED driver

Hey guys,

I built another board, which is a 3-channel (RGB) LED driver based on an inexpensive chipset called PT4115 (you can find them on eBay or Aliexpress).

The circuit is very simple and looks like Sparkfun’s PicoBuck. However, I used beefier components and a different chip. You may say it’s pretty much the same thing, but I made it to learn some more about PCB design.

Datasheet here. LED current is set through a sense resistor. The output current I is equal to 0.1/Rs. I wanted ~300mA for each channel so I chose a 0.33 ohm resistor. If you want 350mA, choose a 0.27ohm resistor.

Each channel can be controlled via PWM (you can solder male/female headers on the board), for example with an Arduino.

You can input up to 30V and control 3W/10W/20W LEDs.

The bare boards.

The PCBs.

Continue reading

Worklog #1: Expanding LinkIt ONE/Arduino analog inputs.

While working on the controller for my RGB light system, I quickly noticed the analog inputs on the LinkIt ONE wouldn’t be enough. It only has three analog inputs while I needed at least 5 (2 for the controlling a joystick – which is basically two pots in one – and 3 for the color-choosing pots (R, G, B).

In order to increase the number of analog inputs, I decided to buy a 4052 4-channel (de)multiplexer. It costs roughly 50 cents and can handle both inputs and outputs: my local store had the ST version (HCF4052BE) so I bought that one, but TI also makes the same chip.

You can take a look at the datasheet here.

 

HCF4052B pinout.

HCF4052B pinout.

 

Operation is fairly simple: you connect your analog devices to pins 1, 2, 4, 5 (for channel Y) or 11, 12, 14, 15 (for channel X). The signal will then be output from pin 3 (for channel Y) or pin 13(for channel X), depending on the high/low states on pins 9 and 10 (B and A, respectively), which are connected to your Arduino/LinkIt.

Take a look at the following table to understand how the thing works:

 

HCF4052B truth table.

HCF4052B truth table.

This basically means that, provided that the INH pin (6) is connected to GND, if B and A are both low (connected to GND too), common pin 3 (or 13) will be connected to pin 1 – 0x (or pin 12 – 0y). If A is high (connected to VDD) and B is low, pin 3 (and 13) will then be connected to pin 5 (and 14), and so on.

Don’t forget to connect pin 16 to 5V and pin 6, 7 and 8 to GND.

Here is some example code to get this thing working for both Arduino and LinkIt, using only 3 of the 4 inputs. Try to modify the code to make it work for all pins!

In this particular case, I used this code to get the input from 3 potentiometers on the same analog pin.

 

And that’s it!

 

 

 

A new board came in today: SeeedStudio’s LinkIt ONE!

A few days ago, Seeed Studio posted a contest in which 10 pieces of their newest board, the LinkIt ONE, would have been given away to makers who had a good idea on how to use them for an hobby project.

You can find more info about the board here, it’s basically a 32-bit MCU development board which has lots of connectivity options built-in (GPS, cellular, Wi-Fi, Bluetooth, Audio, SD card) and is compatibile with the Arduino IDE. It is based on the MT2502A microcontroller.

I immediately applied for the contest and a few days later they replied saying they liked my idea and they were kind enough to send me a LinkIt ONE.

I received the board today (fast shipping with FedEx!) and it’s very neat.

This is how the whole package looks like. The board is definitely well-made and feels solid.

 

Center: LinkIt ONE board. Left: Wi-Fi/BT, GSM and GPS antennas. Right: 1000mAh battery (included) and 2 Grove modules I needed (not included)

Center: LinkIt ONE board. Left: Wi-Fi/BT, GSM and GPS antennas. Right: 1000mAh battery (included) and 2 Grove modules I needed (not included). SD and SIM slots on the back.

 

The info sheet is included in the package: By quickly looking at it, the only complaint I have is the limited number of PWM outputs (2, might be solved with software PWM libraries) and analog inputs (3, can be increased using a demultiplexer) compared to Arduino.

However, the price (79$) is unbeatable considering all its connection options: separate Arduino shields would definitely have a much higher cost. Moreover, the MCU is a lot beefier than your average Atmega. Keep in mind that this board runs at 3.3V.

More info and photos after the jump!

Continue reading

Building a better breakout board for ATX PSUs.

13/07/2015 UPDATE: PCBs of the new version have arrived. Blog post and store link!

30/06/2015 UPDATE: New version released, x20 PCBs printed and coming in the mail. New source files and details on GitHub (click me!) – available for sale in a couple of weeks

13/11/14 UPDATE: Eagle files have been uploaded, you can find the link at the bottom. Thank you for your interest!

Many people over the internet have already found out the usefulness of having an ATX PSU, often salvaged from old computers, on their bench. It can be quite easily converted into a lab bench power supply (owners of a real one, please don’t kill me).

There are lots of videos on how to add binding posts to your PSU and how not to, but I didn’t like any of these solutions. I tried the first one, but my power supply was so small and tightly packed that wires and binding posts wouldn’t fit right in it.

I then came across Sparkfun’s and Dangerous Prototypes’ ATX breakouts. While I didn’t like the Sparkfun one, the one from Dangerous Prototypes convinced me a bit more.

Yet, I felt like it lacked some features I needed. I wanted some USB ports to power my rPi and charge my Nexus 5, and an adjustable voltage output. Furthermore, my PSU had a 24-pin ATX connector.

While I still consider myself a beginner in the enormous world of electronics, I decided to look up some guides on how to design a PCB (this time I’ve gotta thank you, Sparkfun! Both yours and Adafruit’s libraries and tutorials rock!) and have a try at it.

Fast forward some days later, my very own ATX breakout board was born.

Continue reading

[RECENSIONE] Batteria Esterna / Power Bank Xiaomi – 10400mAh

Qualche tempo fa ho comprato una batteria esterna marchiata Xiaomi per ricaricare il mio Nexus 5 dato che spesso faticava ad arrivare a fine giornata.

 

Xiaomi Power Bank 10400mAh

 

Ho optato per il modello da 10400mAh che, seppur essendo più grande del fratellino da 5200, fornisce 4 cariche complete al mio cellulare.

Partiamo dal design: la batteria si presenta come un prodotto veramente curato in ogni minimo dettaglio, è molto Apple-like a partire dall’unboxing. Il materiale è alluminio anodizzato ed è veramente solido.

Oltre alla batteria in sè, la confezione presenta anche un cavo microUSB piatto da 24cm e un manuale di istruzioni.

 

Visione frontale della batteria.

 

La parte anteriore della batteria presenta un pulsante che serve per il reset e per verificare lo stato di carica della batteria stessa, evidenziato da 4 LED bianchi immediatamente a destra.

La porta microUSB serve per caricare la batteria attaccandola ad un computer o ancora meglio ad un caricatore da muro, e la porta USB è dove ovviamente attacchiamo i nostri device a caricare.

È compatibile con tutti gli smartphone e tablet e aggiusta automaticamente la corrente in output a seconda del dispositivo per un massimo di 2.1A: ciò significa che tutti i vostri device si caricheranno alla massima velocità possibile.

Possiede inoltre numerose protezioni da cortocircuiti, overvoltaggio o overcorrente (che possono capitare se utilizzate caricatori troppo economici).

Il tempo di ricarica della batteria è di circa 6 ore con un caricatore da 2A, e supporta il pass-through. Ciò significa che potrete ricaricare la batteria mentre ricaricate il vostro device attaccato alla batteria stessa.

Se non possedete un caricatore da 2A (come ad esempio quello di un iPad) e ne utilizzate uno da 1A, i tempi di ricarica si allungano fino a 10 ore.

Una cosa di cui bisogna stare attenti durante l’acquisto di batterie Xiaomi sono le batterie contraffatte: infatti, dato l’elevato successo sul mercato delle suddette batterie, molti produttori hanno cominciato a produrre prodotti Xiaomi falsi, meno performanti e meno sicuri.

Ecco qui un link per controllare se la vostra batteria è originale o meno: http://en.miui.com/thread-19104-1-1.html

 

Attenti a non acquistare cloni troppo economici!

I Power Bank originali usano celle marchiate LG o Samsung, che sono garanzia di qualità. I cloni invece, usano batterie no-brand che potrebbero danneggiarsi fino ad incendiarsi o esplodere. Fate attenzione!

Xiaomi produce anche un modello da 5200mAh: è più piccolo, più compatto e potrebbe bastare per molti utenti.

 

Modello da 5200mAh