Welcome! Log In Create A New Profile

Advanced

FFModule -- Adding Sounds & RGB Led to your Printer

Posted by VincentM 
FFModule -- Adding Sounds & RGB Led to your Printer
September 18, 2014 02:10PM
Hi!

I'm VincentM from Clone Wars google group (spanish reprap comunity).
I developed an add-on for ours printers: FF Module.

It's an Arduino (any) with a very simple shield containing a WTV020-SD-16P (for sound) and a ULN2003A (for RGB Led strip).

Allows you to play sounds during printing (mp3 sounds to ad4 format) and control an RGB Led strip, changing colours.
It uses the M150 gcode implemented in Marlin for BlinkM control.

The FF Module communicates with your standard control board (RAMPS, Sanguinololu, etc) via I2C (like BlinkM) with only 3 wires (SDA,SCL,GND). Acting as BlinkM, receive the 3 bytes for Red,Green and Blue RGB.

If the byte for Red colour is 255, the order is taked as 'Play sound'. The sound will be the byte sent in the Green colour byte (M150 uses U letter).
For example:
M150 R255 U1 B0 - Will play the sound '0001.ad4' in the SD of the WTV020.

In any other case, the order is treated as 'RGB Led order' and is sent to a RGB Led strip (common positive) via ULN2003a chip.

Currently, I'm putting all the information in the Wiki: [reprap.org]

A little video of the sound part working: [docs.google.com]
Video of RGB&sound: [docs.google.com]

I hope you like it!
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 16, 2014 04:18AM
Could you tell me, how to add the M Code to the Marlin firmware? And give me the code for the Arduino uno? hot smiley
I LOVE the R2D2 sound!!! hot smileyhot smileyhot smiley
This is AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 16, 2014 10:41AM
Quote
mw2matze
Could you tell me, how to add the M Code to the Marlin firmware? And give me the code for the Arduino uno? hot smiley
I LOVE the R2D2 sound!!! hot smileyhot smileyhot smiley
This is AWESOME!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

To enable the M Code, uncomment the following line in Configuration.h:

//define BlinkM/CyzRgb Support
//#define BLINKM

I attach the code for The Arduino UNO.

I will include all the info needed in the Wiki page.

Hope you enjoy it!
Attachments:
open | download - FF_Module_V1.ino (2.9 KB)
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 22, 2014 08:29PM
Thank you for adding this! It's a neat addition.

I have started implementing this and it works good with the RepRapDiscount LCD controller.
My other machine uses a ViKi LCD screen I cannot use it.
ViKi uses the I2C...

Would it even be possible to use this without using the I2C?
What would it take and is it even worth it??

thanks again!!
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 23, 2014 09:23AM
Quote
joeb1
Thank you for adding this! It's a neat addition.

I have started implementing this and it works good with the RepRapDiscount LCD controller.
My other machine uses a ViKi LCD screen I cannot use it.
ViKi uses the I2C...

Would it even be possible to use this without using the I2C?
What would it take and is it even worth it??

thanks again!!

HI!

Happy to see you like it!

Unfortunatly the M150 Gcode is implemented in Marlin via I2C. For this reason, the FF Module can't work in another way.

But in theory this is not a problem because you can connect up to 127 'slaves' devices to an Arduino 'master' in the I2C port. Every device is identified by a number. The FF Module, like BlinkM, is identified as 0x09. This can be changed in the code if you need.

So, if your Viki LCD acts as an I2C device (with a device id number different from 0x09), both (Viki LCD & FF Module) can be connected in parallel to the I2C port.

I am not an expert in this, but I will try to help if you have questions.

Regards
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 23, 2014 12:52PM
OK!

That is good news. I would think the wiring would be as simple as this setup.



I will test this out and update the wiki if you like.

thanks again,
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 23, 2014 01:01PM
Yes, it's Ok.
Be free to modify the Wiki.
Regards.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 18, 2015 12:13PM
Hi Vincent

I am going to get some of your really nice board made. Do you already have plenty or would you like me to send you a few to say thanks? Are you happy for me to put them on eBay in the UK to enable other local RepRappers to jazz up their machines?

I am working to develop some software to enable RAMPS to control over I2C another Arduino running code to drive Adafruit Neopixel style WS2812B addressable RGBs. This could become a commercial project. Is this something that interests you?

If it's already been done, could you point me there? If not, I will try to make it fairly closely compatible to your RGB implementation on the Marlin side, so that the same Gcodes have the same results, but some extra effects will be added.

Kind regards,
Alex Gibson
Re: FFModule -- Adding Sounds & RGB Led to your Printer
October 18, 2015 01:17PM
Quote
alexgibson3d
Hi Vincent

I am going to get some of your really nice board made. Do you already have plenty or would you like me to send you a few to say thanks? Are you happy for me to put them on eBay in the UK to enable other local RepRappers to jazz up their machines?

I am working to develop some software to enable RAMPS to control over I2C another Arduino running code to drive Adafruit Neopixel style WS2812B addressable RGBs. This could become a commercial project. Is this something that interests you?

If it's already been done, could you point me there? If not, I will try to make it fairly closely compatible to your RGB implementation on the Marlin side, so that the same Gcodes have the same results, but some extra effects will be added.

Kind regards,
Alex Gibson

Hi Alex!
Thanks for your interest.

Yes, I have a few boards here. Don't need more, thanks.
You can sell boards on Ebay or whatever you want. I'm not interested in any kind of profit. Same about any commercial project you can do based or not in my design. I'm a happy retired man!!

I don't implemented the M150 Gcode. This was done before for use the BlinkM Module.
I only use this Gcode to pass 3 parameters from executing Gcode to another Arduino via I2c. This way don't need any Marlin add or modification.

Good luck!!
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 02:53AM
Hi Vincent,

first of all, nice AddOn for 3D Printers.

I can't get it work. Maybe you can help? My SetUp is: Arduino Mega 2560 + Ramps 1.4 and Marlin 1.1.8.

Before i found your solution, i add LED Strips, i but it on Pin 5, 6 and 11 on the servo.

In configuration.h, i have to uncomment //#define RGB_LED for Printer event LEDs
//#define RGB_LED                
//#define RGBW_LED

#if ENABLED(RGB_LED) || ENABLED(RGBW_LED)
  #define RGB_LED_R_PIN 5
  #define RGB_LED_G_PIN 6
  #define RGB_LED_B_PIN 11
  //#define RGB_LED_W_PIN -1
#endif
There are some points confusing me...
I'm running Repetier Host, works fine.
When i send g codes, like M150 R255 U000 B000, it turns the light Red etc.
BUT, now i found your solution, which works not with the servo (Pin 4, 5, 6, 11), but with the I2C.

To get your solution to work, i comment //#define RGB_LED and uncomment // Support for BlinkM/CyzRgb
#define BLINKM.

And it's not clear on your wiki page, which one is the SDA and which is the SCL.
I have flashed your sketch on the Arduino Uno and pluged your shield on top.
I've format the SD Card in FAT16, pluged the Speakers in right polarity.

I also have bypassed the resistors (4.7KOhm).

I saw in configuration_adv.h (Important?)
/**
 * TWI/I2C BUS
 *
 * This feature is an EXPERIMENTAL feature so it shall not be used on production
 * machines. Enabling this will allow you to send and receive I2C data from slave
 * devices on the bus.
 *
 * ; Example #1
 * ; This macro send the string "Marlin" to the slave device with address 0x63 (99)
 * ; It uses multiple M260 commands with one B arg
 * M260 A99  ; Target slave address
 * M260 B77  ; M
 * M260 B97  ; a
 * M260 B114 ; r
 * M260 B108 ; l
 * M260 B105 ; i
 * M260 B110 ; n
 * M260 S1   ; Send the current buffer
 *
 * ; Example #2
 * ; Request 6 bytes from slave device with address 0x63 (99)
 * M261 A99 B5
 *
 * ; Example #3
 * ; Example serial output of a M261 request
 * echo:i2c-reply: from:99 bytes:5 data:hello
 */

// @section i2cbus

//#define EXPERIMENTAL_I2CBUS
#define I2C_SLAVE_ADDRESS  0 // Set a value from 8 to 127 to act as a slave

Do you have a clue?

regards,
tru
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 03:24AM
yes you need to enable #define EXPERIMENTAL_I2CBUS in Configuration_adv.h
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 04:26AM
Hi Dust,
thanks for your answer.

It still doesn't work...

Maybe my shield is not good soldered... never did it before...

Does anyone have a shield, i can pay with PayPal.

That would be nice.

Regards,
tru
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 04:56AM
go to [jlcpcb.com] <-- you don't have to use these people, but its who I recommend.

click on "quote now"

Click on add gerber file

point it to where you have saved the FF_Module.zip from [reprap.org]

You can chose the pcb color here, this doesn't change the price. Don't touch the other option unless you know what your doing... most increase the price.

Its $2 + shipping... for 5pcb's and since it is probably your first order, they take $8 off your shipping.

You can use PayPal, Credit Card or Bank Transfer

Edited 4 time(s). Last edit at 07/12/2019 05:10AM by Dust.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 05:12AM
Hi Dust,
i allready have PCB and soldered, but i think i've made it wrong... so i would like to have a finished working FF Module,
where i just put the SD Card in and thats all...

Alex Gibson3D wrote to VincentM, that he would like to sell them on eBay UK.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 05:17AM
That was 4 years ago....
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 01:17PM
Yes, i know... but maybe someone have some shields...?
Or is fit in soldering.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 03:00PM
Now i can control the LEDs with M150 g code.

But the sound is not playing... has anyone an idea?

I format the 1GB sd card fat16 (windows 7 cmd -> E: /FS:FAT /Q)
copied the *.ad4 files on the sd card.
G code M150 R255 U001 B000

No sound...

Hope you ca help.

Regards,
tru
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 09:37PM
[www.ebay.co.uk] or just get something like this [www.ebay.co.uk]

Edited 1 time(s). Last edit at 07/12/2019 09:38PM by MechaBits.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 12, 2019 10:37PM
Your audio files are called 0000.ad4 0001.ad4 etc after conversion?

I would try a different sd card also.. such devices are often very picky about what cards they will and wont read.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 13, 2019 04:22AM
Hi Dust,
yes, i toke that audio files from VincentM (exemples).

Maybe the sd card don't have good contact to the cardreader,,,

can you give an advice, which sd card did you bought.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 13, 2019 05:07AM
SanDisk 1 and 2 GB seem to work.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 13, 2019 05:28AM
Hi Dust,
is it normal, that the diode next to the soundmodule (sd card) is allways on?
My diode on the FF Module is allway on.

Regards,
tru

Edited 2 time(s). Last edit at 07/13/2019 05:29AM by tru_visual.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 13, 2019 06:03AM
You mean the LED?

Yes it is always on.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 13, 2019 06:04AM
Ah, ok...
Thank you.
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 13, 2019 02:03PM
Hi Dust,

now i'm going to use a breadboard, to be sure, that the connections are right.

On the wiki page: https://reprap.org/wiki/FF_Module
is a list of needed resistors. I'm really confused, because on the circuit diagram are other resistors than in the item list.

So, my question is, are these resistors right?
R1, R2 4.7kΩ?
R3, R4, R5 1.8kΩ?
R6, R7 and R8 3.3kΩ?
R9 470Ω
Or which resistors did you used?

Quote

Resistors (1/4W)

1 470Ω 1/4W (Busy Led)

2 4.7KΩ 1/4W (SDA,SCL lines)

3 1.5KΩ 1/4W (Voltage divider) (*) R1

3 2.2KΩ 1/4W (Voltage divider) (*) R2

3 1KΩ 1/4W (Voltage divider) (*) R2

(*) This resistors are used as a voltage divider to down the 5v output of Arduino I/O pins to 3.4v in my case (1.5k to pin, 3.2k (2.2k+1k in series) to Ground).

You can use 1.8K to pin and 3.3K to ground to simplify, and you will obtain 3.24v . You will need 3 of each.

Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 15, 2019 04:57PM
Can anybody please tell me, which resistors are needed for R5, R6 and R7?

In the text discription are other resistors than in the circuit diagram.
on my FF Module shield , the LED Part already works, but the sound part doesn't.

the *.ad4 file are from VincentM (on his wikipage), my sd card is 1GB FAT16.
I only know the resistors from the circuit diagram and take for R5 a 1.8KΩ and for R6 and R7 3.3KΩ resistors.

So, if someone has build that FF Module and it's working, please let me know.
Thank you.

reagards,
tru
Re: FFModule -- Adding Sounds & RGB Led to your Printer
July 25, 2019 12:19PM
Hi,
can someone tell me does it matter to use a wtv020m01 soundmodule and not a wtv020sd16p?
are they equal?

The LEDs are working by sending g code M150 R000 U255 B000 etc.
But no sound. My sd card is ok, sound files too.

The speaker have to be 0,5 - 4W and 8 Ohm right?

Regards,
tru
Sorry, only registered users may post in this forum.

Click here to login