Monday, March 14, 2016

Driving the #Bolt at #ilightsmarinabay using I2C protocol

All my projects are posted to my facebook page at http://fb.com/SVTmaker

#Bolt #SVTMaker



#Bolt #SVTmaker


In this article, I would like to share my experience in planning, testing, making, building, and driving the #Bolt at #ilightsmarinabay that happened on 4th March 2016 at Marina Bay, Singapore iLights festival.

A local artists that built a massive LED star in Butterworth, Penang called Jun Hao engaged two local makers, WeMaker and SVTmaker to do another project in Singapore called the Bolt, simulating lightning bolt when a button was pressed. The below images was taken from his proposal to the festival.

Bolt idea and concept

After understanding the requirements from the artists, we started exploring various way to drive the LED strips, from simple relays with delays to wireless options. After a few weeks of searches, I finally found an ideal method to drive so many LEDs using Inter-Integrated Circuit (I2C) protocol with 1 I2C master driving 8 I2C slaves. The idea was to use the delay() to turn on and off the LED strips.

The idea was to have eight passive I2C slaves just receiving commands from the I2C master and all my coding would be centralized in the I2C master. This makes controlling the code version easily and any changes does not need to re-flash all the 8 I2C slaves. This was my first time writing my own protocols on top of I2C and I probably would exceed the maximum length of the I2C wiring distance.

MOSFET on breadboard
Driving 2 Arduino via I2C 


The next task was finding a way to drive the 1 meter 12V LED strips and we decided on using MOSFET for this purpose. This was my first time using MOSFET and lots of it, around 80 pieces of MOSFET to drive around 80 pieces of 1m LED strips.

Bolt PCB circuit

Once this test was done, the next step was making a custom PCB for this purpose as soldering 12 LED strips to 8 I2C slaves on a prefboard is not fun at all. With my very limited skills in EagleCAD, I started drawing up the schematic diagram and board drawing  using 12 MOSFET driven by 12 pins on the Arduino Nano.

I usually take weeks and many many revisions to correct many errors before I make them into an actual PCB but this time around, time was not on my side and after 3 revisions within 2 days, I send it to Uncle Chow, 9M2CF to get the PCB done. Just in case the I2C does not work, I added a circuit to use nRF wireless options into the circuit as a backup plan. Always have backup plans.

Film of PCB drawing 
Bolt PCB done in 2 days
 To improve the quality of the PCB traces, uncle Chow 9M2CF, made a film instead of printing the drawing on tracing paper with laser printer.




Meanwhile doing the PCB, the architecture students from Taylors quickly did a model of the structure using lollipop sticks and lots of hot glue. A lot of work was put into making the frosted tubes while cut and soldered long wires to the 1 meter LED strips.

Driving the Led with Eduboard


After fixing many circuit errors on the PCB, it was time to hook it up to the model structure to test the lightning patterns. Referring to the first picture of the actual structure, the model accurately show how it will actually going to look like at night with the LED turned on.

I find that we actually did this project twice, once on the model and again on the actual structure as we had mini 3 LED strips hook up to the 8 I2C slaves.

8 I2C slaves fully soldered

8 I2C slaves hook up to the model structure


Part 2 was posted on hackster.io with videos :-
https://www.hackster.io/stanleyseow/driving-a-lightning-bolt-art-installation-with-8-i2c-slaves-cc171f


Summary Links :-









Wednesday, October 7, 2015

Uploaded Arduino blink example to a STM32 board - M3S STM32F103ZET6

M3S STM32F103ZET6


In my quest for higher speed, more pins,  more flash and more RAM for my SVTrackR and yet keeping the cost low, I started exploring other ARM 32-bit boards.

Before this, I'm already using  DigiX from Digistump, an Arduino  DUE compatible board but they are in Mega form factor, kinda big and most important factor for me, high price. The DigiX are 32bit ARM Cortex-M3 microcontroller running at 84Mhz.

DigiX Comparison Table

While shopping at taobao, the development boards from STM32 really stand out as they are low cost, lots of pins and similar form factors as Arduino Nano. My most important criteria is that I should not have to port my codes to another platform or learn another new development environment. As a hobbyists, the development software must also be free.

STM32 dev board
A search for STM32 will results in so many STM32 development boards from any shapes, colours and sizes with price range from RMB25.70 to thousands of RMB. Compared to the above chart for DigiX, the lowest price are 59 in US Dollars.

All these cheap and powerful boards are no good to me unless they runs on Arduino IDE as my SVTrackR codes uses a lot of open source libraries from GPS, OLED and SoftSerial.

Some background and history on STM32 on the Arduino platform. It was started very early by leaflabs producing the Maple and Maple Mini back in 2008. You can read all the details are the links provided below. Good thing it was an open source projects so all the work done by them can be taken up some others to continue the development. If this were a closed sourced project, all these would be gone.
http://www.leaflabs.com/device-details/


Arduino Forum :-
http://forum.arduino.cc/index.php?topic=265904.0 with 2625 messages.

New STM32duino home :-
http://www.stm32duino.com/

Roger Clarke from Melbourne did a great job to continue the developement.
https://github.com/rogerclarkmelbourne/Arduino_STM32/wiki/Credits-and-history

If you are a newbie and just want to make some STM32 board purchases without reading all the histories, click on  Guide: "I'm new here - which board should I buy?"


More pictures of the M3S STM32 development board I purchased. I've also purchased the 3.2" touchscreen TFT that can attached to this board. It also comes in a nice looking plastic box.

M3S with box



M3S with 3.2" TFT



M3S STM32F103ZET6 with 3.2" TFT




From the image the seller posted, this board have a lot of items on board like 2 USB port (mine comes with Micro-USB ), DB9 on MAX3232, JTAG, SWD, DS18B20 slots, mini buzzer, nRF24L01 slots, SPI flash on SD, SDIO, 2 LEDs, 4 buttons, BOOT0/BOOT1 jumpers,  EEPROM 24C02, OV7670 camera module and other that I could not translate the chinese.


Summary Links










Friday, January 30, 2015

Product review of CT-UNO by Cytron


I received my CT-UNO, an UNO board made by Cytron and I'm doing a short review on this board.

CT-UNO

The first question is, why another UNO board ?  The answer would be answered in my short review below.

This CT-UNO was used as part of the starter kit during my Penang Mini Maker Faire Arduino workshop in November.

The main factor I really like about this is the Micro-USB port instead of the gigantic USB B plug used by regular Arduino UNO boards. With so many USB micro cables all around, having a USB micro is a good decision made by Cytron.

Secondly, I always like the FTDI USB Serial chip. I'm still using the FTDI Breakout board on a regular basis to program the Arduino Mini Pro ...

FTDI FT23x

On the subject of FTDI board, there is an Android app called FTDI UART Terminal that can accept a FTDI USB-Serial device so that you can plug in the CT-UNO directly to the Android Smatphone and view the Serial Monitor using this app with an USB OTG cable.


CT-UNO with FTDI connected to Android Smarthphone

As per most of the newer UNO board, this is a SMD version of the atmega328P, so you cannot remove the IC.

ATMEGA328 SMD

Another thing I really like about this board is that you can directly solder wires to the pins below the board for permanent connections. Here are some pictures of the CT-UNO on the sides and below the board.

Sides holes

Sie holes
CT-UNO back
Last but not least, this board is "Made in Malaysia", so please support Malaysian made products.
The only thing I didn't like about this board is the white colour of the PCB silkscreen but this is my personal opinion.

Overall, it is a very usable UNO board and very good to view Serial Monitor on Android Smartphone that support USB OTG cable.

It cost RM56 on Cytron online store and RM62 on retail stores.

A special thanks to Vincent Kok for sending me this CT-UNO for review.

Summary Links :-



Thursday, August 14, 2014

Arduino UNO nRF Adapter

nRF24L01 adapters


This blog entry is about my process in making an Arduino UNO nRF24L01 Adapter from start to the current version... ( If you would like to order a pair of the nRF Adapter, please click on nRF Adapter for Sale. )


Do you face the problems of messy jumpers cables like below when using nRF24L01+ with an Arduino UNO on a breadboard ??

nRF24L01 on breadboard
Or need to DIY your own adapter to sit in between the breadboard groove like the picture below ?

DIY nRF for breadboard

nRf24L01 on Arduino UNO

nRF24L01 with external antenna

With this problem, I started my journey to solve this problem with a nRF Adapter... below are pictures of the evolution of the adapter.

Perfboard first version

The orange and white wires fly across the UNO for the 3.3V power needed by the nRF24L01 radio.
nRF adpater with bottom wiring

nRF adapter with top wiring

PCB Version with 3.3V LDO ( PCB designed by ZXLee )

nRF20L01 adapter DIY PCB 1

nRF24L01 adapter DIY PCB 1

nRF24L01 adapter DIY PCB 1


PCB Version 2 with 2 buttons ( PCB designed by Vintronics )


nRF24L01 adapter DIY PCB 2 bottom

nRF24L01 adapter DIY PCB 2 top

We took the above design, dropped the 2 buttons , fine tuned it and made the final version for factory PCB. This is a joint collaboration project between Arduino for Beginners blog and Vintronics ..

Final factory made PCB version ( designed by Vintronics & myself )

This version have a AMS1117-3.3 at the bottom of the PCB.
nRF24L01 adapter PCB front

nRF24L01 adapter PCB back

Final version with headers soldered on PCB

nRF24L01 adapter PCB front

nRF24L01 adapter PCB back


nRF24L01 Adapter with radio

nRF24L01 adapter with radio

nRF24L01 adapter PCB with radio

nRF Adapter on Arduino UNO

The nRF adapter uses pin 8 for CE, pin 9 for CSN and pin 10 for Vcc (5V to 3.3V with the AMS1117-3.3V VR )

nRF Adapter on Arduino UNO

nRF Adapter on Arduino UNO
All the nRF adapters together ..

All nRF24L01 adapters

If you would like to order a pair of the nRF Adapter, please click on nRF Adapter for Sale.

Summary Links :-

- My RF24 repo fork with support of the nRF Adapter :  https://github.com/stanleyseow/RF24
- Test your nRF24L01 transfer speed https://github.com/stanleyseow/RF24/tree/master/examples/Transfer
- More info on nRF24L01 http://arduino-info.wikispaces.com/Nrf24L01-2.4GHz-HowTo



Monday, May 12, 2014

TinySafeBoot on attiny84

The TinySafeBoot, this is a small bootloader that will take up 550 bytes so you are left with around 7450 bytes of sketch left. Let me explain a bit of details and instructions as the TinySafeBoot site were not catering to Arduino users in terms of step by steps instructions for beginners.

The reason to install this TinySafeBoot is pretty obvious, you can directly program the attiny84 similar like Arduino UNO using on Serial Tx/Rx pins instead of using the UsbTinyISP. I am connecting a FTDI USB Serial module for both programming and debugging functions using <TinyDebugSerial.h>.


Attiny84 with FTDI

The above image is my prototype attiny84 with FTDI module Serial Debug / Monitor to pin PB0(tx) and PB1(rx).

The steps are as follows :-

1. Download TinySafeBoot from http://jtxp.org/tech/tinysafeboot_en.htm

2. Generate the bootloader hex for attiny84 :-

tsb tn84 b1b0  ( b1 = pin PB1/rx b0 = pin PB0/tx )

3. Burn the above generated hex bootloader to the attiny84

avrdude -c usbtiny -p t84 -U flash:w:<tsb_tn84_b1b0_20140414.hex>

4. Set the fuse bits on attiny :

avrdude -c usbtiny -p t84 -U efuse:w:0xFE:m ( Turn on SELFPRGEN bits )

5. To get the status of the bootloader, RESET the attiny84, wait for 2-3 secs and execute the commands :-

tsb COM5 i  ( get current status from the bootloader )

or

6. To burn a hex to the attiny84, RESET the attiny84, wait for 2-3 secs and execute the commands :-

tsb COM5 fw blink84.hex

( You can compile the hex under Arduino UNO by choosing the board attiny84 @ 8Mhz and copy the hex files to the tsb folder. To see where the hex is compiled and located, Under Arduino IDE Preferences, Click on "Show verbose output during [x] compilation" )

Final product on Tiny nRF V1.0

Tiny nRF V1.0


Summary Links :-

- TinySafeBoot
- Attiny84 Fuse calculator http://eleccelerator.com/fusecalc/fusecalc.php?chip=attiny84
- Arduino Tiny codes https://code.google.com/p/arduino-tiny/
- Arduino Forum on attiny84/85 http://forum.arduino.cc/index.php?topic=115822.msg1698859#msg1698859


LinkWithin

Related Posts Plugin for WordPress, Blogger...