2009/02/15
GUI tool(kit) to view data coming from your PIC
by
Sébastien Lelong
—
posted at
2009-02-15 12:04
last modified
2009-02-15 12:04
I now have quite a nice base for my SirBot project, highly configurable, and hopefully more stable now implementation is done using Twisted (no threads anymore). With this base, any data coming from the PIC (a request, a response, a message, see SirBot's doc for more), can be parsed and objects can be created from them. Then spread to whatever application needs them. Now the time has come to build a GUI...
For instance, I've experimented back-emf while trying to control DC motor. This was very fun and produced very nice data and graphs. But those were done after the experiment. I just logged raw data on a file, then process them with a awful python script to build gnuplot graphs. Where is the real-time ? Observing these graphs in real-time is now mandatory. I need to know what's going on this bot !

Yes, I now need to build a GUI, and it really pisses me off :) The simple idea I could write
really gets me sick. It's so much waste of time in my opinion. I just don't want to design a GUI, selecting the appropriate layout, putting some code for buttons here and there. Maybe I'd need a graphical GUI builder. But when it comes to deal with real-time graphs, I'll need to implement a sort-of canvas, and draw points on it, and... I just don't want to spend my time on this, I just want to see my data coming from my PIC. In real-time. And I'd like it flexible, with a lot of widgets, like gauges, sliders, knobs, etc...
I first tried and thought to have a solution with Flex. Interestingly enough, Flex can be used to build GUI with real-time data. It's quite fun to use, compiler is open-source, documentation is awesome. Lots of widgets are available, for free, like Fusion Charts. And it's cross-platform since it's all about Flash. I prototyped and even wrote a Flash gateway to spread message from the SirBot's core, over a Flash XMLSocket. Worked great, nice performance. Then I tried to add some colors and... you have to sub-class, add callbacks for whatever I don't know, etc... I may have missed something, but it looks too complicated for just what I want to do. And most importantly, I'll need to design a layout, add a menu, add a button here, write the code so when to button here is pressed, then it switch on this pane. I just don't have time !
So, how can I do this ? How can I build a rich GUI, with real-time widgets, easy and fast to implement ? Which tool(s) to use ? Is there a tool which can do this ?
Though I've never tried it, Labview seems to be a solution, but it's way, way too much expensive, and there's no free-of-charge edition for the "cheap guy"... Looks like I need a Labview alternative. During this "quest", I've found many interesting projects. What can be surprising is most of the time, this is about sounds, videos and artistic related projects.
I first found Eyesweb through BioMobius, which integrates it, adds blocks dedicated to the biomedical field (and also provides an awful GUI builder...). Eyesweb is free, works on Windows. It looks very powerful, and seems to be a real Labview-alternative. Its first purpose was about to deal with audio and video, in real-time, with motion-capture, for artistic projects. I can remember having read it was used on a opera, to produce nice visual effects according to what's going on the scene.
I tried to prototype things, and the cost to enter is quite high (but this is what I expect for these type of tools). I tried to connect it to my SirBot's core, via a NetReceiver, but it just crashes. This really is a nice tool, I'd need to spend more time on it, if others don't do the trick. And the motion capture can be interesting when I add a camera to my bot...

Pure Data is an old project. I've seen many incredible videos on youtube about it. Though it has a visual environment, it's more like classical "type" programming: you have to know objects' name, and what you can do with them. Runs under Linux.
I did not give a try with this one, but it looks very powerful and fast. It may be too much audio-oriented.

Max/MSP is derived from Pure Data. Lots of nice widgets. Runs under Mac and Windows. Not Linux.

Open Sound Control. Not a GUI toolkit nor a tool by itself, but a specification: "Open Sound Control (OSC) is a protocol for communication among computers, sound synthesizers, and other multimedia devices that is optimized for modern networking technology." Many, many tools I've found, included those listed here (and particularly Eyesweb), can use OSC as input. OSC is used in many areas other than sounds. I think I'll need to implement a OSC output in SirBot's core.
Other fun tools...
From their site: "Fluxus reads live audio, midi or OSC network messages which can be used as a source of animation data for realtime performances or installations. Keyboard or mouse input can also be read for games development, and a physics engine is included for realtime simulations of rigid body dynamics." Looks fun ! While not directly usable for what I want (and from what I understand), it may be interesting to keep this in mind. For instance, it could be used to "just" produce a visual... stuff which globally represents the bot's state. No "scientific" graphs, or the like. Just... visual stuff. Fluxus can be programmed in live (see this video for more). No GUI, no visual programming.

SuperCollider seems very similar to Fluxus. Live coding, no GUI, just type and to see/listen to the results. See this video, scratching with a WiiMote :)
There are many other tools, libraries out there, (Quartz Composer, vvvv, CSound, ...) to deal with real-time data, lots of artistic projects I just discover (and started to discover with Arduino), and look very, very fun :)
I don't know yet, but EyesWeb probably fits my needs the best. Others are of interest too, but maybe not right now. I have to spend more time on EyesWeb, and build a real prototype for validation, probably based on a OSC server/gateway.
For instance, I've experimented back-emf while trying to control DC motor. This was very fun and produced very nice data and graphs. But those were done after the experiment. I just logged raw data on a file, then process them with a awful python script to build gnuplot graphs. Where is the real-time ? Observing these graphs in real-time is now mandatory. I need to know what's going on this bot !

Yes, I now need to build a GUI, and it really pisses me off :) The simple idea I could write
application.addMenuItem("File","New")
really gets me sick. It's so much waste of time in my opinion. I just don't want to design a GUI, selecting the appropriate layout, putting some code for buttons here and there. Maybe I'd need a graphical GUI builder. But when it comes to deal with real-time graphs, I'll need to implement a sort-of canvas, and draw points on it, and... I just don't want to spend my time on this, I just want to see my data coming from my PIC. In real-time. And I'd like it flexible, with a lot of widgets, like gauges, sliders, knobs, etc...
I first tried and thought to have a solution with Flex. Interestingly enough, Flex can be used to build GUI with real-time data. It's quite fun to use, compiler is open-source, documentation is awesome. Lots of widgets are available, for free, like Fusion Charts. And it's cross-platform since it's all about Flash. I prototyped and even wrote a Flash gateway to spread message from the SirBot's core, over a Flash XMLSocket. Worked great, nice performance. Then I tried to add some colors and... you have to sub-class, add callbacks for whatever I don't know, etc... I may have missed something, but it looks too complicated for just what I want to do. And most importantly, I'll need to design a layout, add a menu, add a button here, write the code so when to button here is pressed, then it switch on this pane. I just don't have time !
So, how can I do this ? How can I build a rich GUI, with real-time widgets, easy and fast to implement ? Which tool(s) to use ? Is there a tool which can do this ?
Though I've never tried it, Labview seems to be a solution, but it's way, way too much expensive, and there's no free-of-charge edition for the "cheap guy"... Looks like I need a Labview alternative. During this "quest", I've found many interesting projects. What can be surprising is most of the time, this is about sounds, videos and artistic related projects.
Eyesweb
I first found Eyesweb through BioMobius, which integrates it, adds blocks dedicated to the biomedical field (and also provides an awful GUI builder...). Eyesweb is free, works on Windows. It looks very powerful, and seems to be a real Labview-alternative. Its first purpose was about to deal with audio and video, in real-time, with motion-capture, for artistic projects. I can remember having read it was used on a opera, to produce nice visual effects according to what's going on the scene.
I tried to prototype things, and the cost to enter is quite high (but this is what I expect for these type of tools). I tried to connect it to my SirBot's core, via a NetReceiver, but it just crashes. This really is a nice tool, I'd need to spend more time on it, if others don't do the trick. And the motion capture can be interesting when I add a camera to my bot...

Pure Data
Pure Data is an old project. I've seen many incredible videos on youtube about it. Though it has a visual environment, it's more like classical "type" programming: you have to know objects' name, and what you can do with them. Runs under Linux.
I did not give a try with this one, but it looks very powerful and fast. It may be too much audio-oriented.

MAX/MSP
Max/MSP is derived from Pure Data. Lots of nice widgets. Runs under Mac and Windows. Not Linux.

OSC
Open Sound Control. Not a GUI toolkit nor a tool by itself, but a specification: "Open Sound Control (OSC) is a protocol for communication among computers, sound synthesizers, and other multimedia devices that is optimized for modern networking technology." Many, many tools I've found, included those listed here (and particularly Eyesweb), can use OSC as input. OSC is used in many areas other than sounds. I think I'll need to implement a OSC output in SirBot's core.
Other fun tools...
Fluxus
From their site: "Fluxus reads live audio, midi or OSC network messages which can be used as a source of animation data for realtime performances or installations. Keyboard or mouse input can also be read for games development, and a physics engine is included for realtime simulations of rigid body dynamics." Looks fun ! While not directly usable for what I want (and from what I understand), it may be interesting to keep this in mind. For instance, it could be used to "just" produce a visual... stuff which globally represents the bot's state. No "scientific" graphs, or the like. Just... visual stuff. Fluxus can be programmed in live (see this video for more). No GUI, no visual programming.

SuperCollider
SuperCollider seems very similar to Fluxus. Live coding, no GUI, just type and to see/listen to the results. See this video, scratching with a WiiMote :)
There are many other tools, libraries out there, (Quartz Composer, vvvv, CSound, ...) to deal with real-time data, lots of artistic projects I just discover (and started to discover with Arduino), and look very, very fun :)
So, which to choose ?
I don't know yet, but EyesWeb probably fits my needs the best. Others are of interest too, but maybe not right now. I have to spend more time on EyesWeb, and build a real prototype for validation, probably based on a OSC server/gateway.
- Category(s)
- Geek
2009/01/18
Since last post...
by
Sébastien Lelong
—
posted at
2009-01-18 13:24
last modified
2009-01-18 13:24
- I've been working on jallib project, which aims to provide standard libraries to use with jalv2 compiler, with some other guys. Jallib is released under BSD and ZLIB licenses, and available on GoogleCode. A Google group is also available, this is where we discuss and debate about jalv2, jallib, etc...
- I've written some blog posts on jallib's blog
- I've migrated my SirBot's projects and javl2 libraries to jallib
- I've re-written an important of SirBot communication layer, now based on Twisted. This provides a extremely powerful base, without threads, easy to maintain
- I've played with Flex, Adobe's OpenSource RIA framework, and tried to prototype a Flash-based GUI for SirBot's monitoring widgets. Quite promising...
- Category(s)
- Geek
- SirBot Project
2008/08/01
PCB using toner transfer method: video and comparison
by
Sébastien Lelong
—
posted at
2008-08-01 19:41
last modified
2008-08-01 19:41
Having recently tested a lot this method, I've finally determine my "easy and cheap" way to build PCB using toner transfer method. I tried a lot of things, different papers. I've also tested the professional photoengraving method, this one can be considered for the most accurate (but certainly not the cheapest).
So, what's the recipe ? This is closed to the last one, but now way faster, since only ~ 10 minutes are needed. Main difference is you don't have to be careful while peel off the paper, toner really sticks firmly, there's no risk damaging the tracks.
This video shows the whole recipe:
Now, as a conclusion, here's a comparison of different PCB creation techniques:
So, what's the recipe ? This is closed to the last one, but now way faster, since only ~ 10 minutes are needed. Main difference is you don't have to be careful while peel off the paper, toner really sticks firmly, there's no risk damaging the tracks.
- I use glossy photo paper for laser printer (135g/m2)
- wash your PCB board with soap, then with window cleaner (or detergent with alcohol).
- sandpaper your board with ultra thin paper (600, one used for body car)
- wash again the board with soap, then with window cleaner. It must absolutely be dry.
- preheat the board,
- place the paper on the board. Be careful, it'll instantly stick to the board.
- iron the paper., first smoothly to help paper to sitck firmly, then with a lot of pressure (~1min)
- continue with the iron tip, and redraw all the circuit (black tracks will appear through the paper), for ~4/5min.
- Ironing time: ~4/5min
- then place the board on hot water, no soap. Wait for ~ 3/4 minutes, watching the paper beeing soaked.
- peel-off the paper. Most can easily be removed, only the last layer, where the toner sticks, will mostly remain on the board.
- peel-off again the paper with a toothbrush. Don't hesitate, it won't damage your PCB.
- once done, dry the board. Check if you've missed some paper.
- clean the board with window cleaner. While it won't remove toner, it'll help to remove paper residue and get an accurate board.
- you're done. You'll then need to etch the board. Once done, remove the toner using acetone (nail polish remover works well)
This video shows the whole recipe:
Now, as a conclusion, here's a comparison of different PCB creation techniques:
| Photoengraving | Toner transfer with transparency | Toner transfer with photo inkjet paper | Toner transfer with photo laser paper | |
| Ease | |
![]() |
![]() ![]() ![]() ![]() |
![]() ![]() ![]() |
| Repeatable | ![]() ![]() ![]() |
|
![]() ![]() |
![]() ![]() |
| Accuracy | ![]() ![]() ![]() |
|
![]() ![]() |
![]() ![]() |
| Fast |
|
![]() ![]() ![]() |
![]() ![]() |
![]() ![]() ![]() |
| Cheap | ![]() |
![]() ![]() ![]() |
![]() |
![]() ![]() ![]() ![]() |
| Total | ![]() |
![]() |
![]() ![]() |
![]() ![]() ![]() |
- Category(s)
- Geek
- SirBot Project
2008/06/16
New boards available from SirBot
by
Sébastien Lelong
—
posted at
2008-06-16 07:43
last modified
2008-06-16 07:43
Two new boards are available from SirBot Modules. Both are using a new bus cable connector, and were designed using Eagle.
- a new version of the mainboard: with an integrated i2c bus, better design
- a DC motor controller board: can be drive existing h-bridges, such as those found in RC toys. Extremely configurable and extensible, highly documented.
Many months (about six) have passed since the last Sirbot release, it's now time for a new one. Just need to finish the ChangeLog...
![]() |
![]() |
- Category(s)
- Geek
- SirBot Project
2008/04/29
I2C com. with two 16F88 (master/slave) using Jal v2
by
Sébastien Lelong
—
posted at
2008-04-29 21:31
last modified
2008-04-29 21:31
Weeks ago, while I was trying to interface my mainboard with a DC motor controller board, I had to dive into the i2c protocol. Serial com. couldn't make the deal, as I plan to connect several daughter boards, thus need to address them. Although RS485 was also possible, it implied a lot of changes, particularly on the PC side where I'd need an adaptor...
Anyway, just as blinking a LED, i2c is a must-have protocol. Several links helped me a lot, like this one explaining the whole theory, step-by-step, message-by-message. But the most helpful documentation still remains PIC 16F88 datasheet, and the Application Note AN734A which explains quite well how to implement an i2c slave as a state-machine. An interesting post is also explaining this very same App. note has a lot of bugs. I wouldn't say "a lot", still there's a little bug about clock stretching: CKP must be set to high when receiving a NACK. Anyway...
So, this time, this is about setting an i2c communication bus between two PIC 16F88, using Jal v2. The first thing to note is 16F88 implements SSP (Synchronous Serial Port), but not MSSP (Master Synchronous Serial Port). This means 16F88 can't be just configured to act as a i2c master, all of this must be done in software. Good news is jal v2 standard libraries come with an i2c module, which can handle all the i2c protocol subtleties, from a master point-of-view...
This jal v2 master implementation isn't based on interrupts: since it's the master which decides to take control of the bus, there's no need to react to external event... except when using Multi-Master i2c bus. To help this, 16F88 can be configured to generate interrupts on START/STOP bits (which defines when the bus is available or not). A Multi-Master i2c bus seems great but I didn't give a try, regarding all the debugging time it took me to set a "simple" 1-Master/1-Slave bus.
So, the master part is ok, now the slave part. This is where things are getting tough. Particularly without any oscilloscope or digital probe/analyzer. 16F88 can be configured as a hardware slave i2c. An IC address must be set, it must be the same as the one the master is using... This is what I've first thought, but it's not actually exactly true ! Actually, SSP must be configured so SSPADD contains a 8-bit address, that is, with the 8th bit setting read/write address type. Whereas in Jal, IC address is coded on 7-bits. This means, for instance:
Anyway, just as blinking a LED, i2c is a must-have protocol. Several links helped me a lot, like this one explaining the whole theory, step-by-step, message-by-message. But the most helpful documentation still remains PIC 16F88 datasheet, and the Application Note AN734A which explains quite well how to implement an i2c slave as a state-machine. An interesting post is also explaining this very same App. note has a lot of bugs. I wouldn't say "a lot", still there's a little bug about clock stretching: CKP must be set to high when receiving a NACK. Anyway...
So, this time, this is about setting an i2c communication bus between two PIC 16F88, using Jal v2. The first thing to note is 16F88 implements SSP (Synchronous Serial Port), but not MSSP (Master Synchronous Serial Port). This means 16F88 can't be just configured to act as a i2c master, all of this must be done in software. Good news is jal v2 standard libraries come with an i2c module, which can handle all the i2c protocol subtleties, from a master point-of-view...
This jal v2 master implementation isn't based on interrupts: since it's the master which decides to take control of the bus, there's no need to react to external event... except when using Multi-Master i2c bus. To help this, 16F88 can be configured to generate interrupts on START/STOP bits (which defines when the bus is available or not). A Multi-Master i2c bus seems great but I didn't give a try, regarding all the debugging time it took me to set a "simple" 1-Master/1-Slave bus.
So, the master part is ok, now the slave part. This is where things are getting tough. Particularly without any oscilloscope or digital probe/analyzer. 16F88 can be configured as a hardware slave i2c. An IC address must be set, it must be the same as the one the master is using... This is what I've first thought, but it's not actually exactly true ! Actually, SSP must be configured so SSPADD contains a 8-bit address, that is, with the 8th bit setting read/write address type. Whereas in Jal, IC address is coded on 7-bits. This means, for instance:
|
Jal slave i2c master
(declared slave address) |
Hardware i2c slave address |
| 0x2E = 0b00101110 | 0x5C = 0b1011100 |
That is, if the slave is declared to have 0x5C address, the master will have to talk to 0x2E as jalv2 is actually shifting 1-bit while building a write- or a read-address. As usual (and as everyone seems to report), i2c com. problems mainly come from address issues.
Setting a i2c bus is quite easy, from a hardware point of view. SDA and SCL pins must be connected on each side, on a bus using pull-up resistors to +5V. Different values can be used, they're determining the stability and the bus speed. I've successfully tried 2.2K and 3.3K, these are standard values.
Setting a i2c bus is quite easy, from a hardware point of view. SDA and SCL pins must be connected on each side, on a bus using pull-up resistors to +5V. Different values can be used, they're determining the stability and the bus speed. I've successfully tried 2.2K and 3.3K, these are standard values.

Finally, here's a two small Jal programs to test this i2c bus. The master 16F88, also connected via UART, gets a character from serial (from a PC), echoes it and send it to slave 16F88. This ones gets this char, process it (char = char + 1...). The master then gets the result and send it back to the PC. So, if you type "a", you'll get "a" as echo, then "b" as the slave's results.
| PIC 16F88 i2c Master | PIC 16F88 i2c Slave |
| simple_i2c_master.jal | simple_i2c_slave.jal |
- Category(s)
- Geek
- SirBot Project
2008/04/22
PCB using toner transfert method, another try
by
Sébastien Lelong
—
posted at
2008-04-22 07:54
last modified
2008-04-22 07:54
I've just build another board, using toner-transfert-system (TTS). Last try required lots of trials/errors, still leaving unanswered questions... This time, the first try was perfect. Here's my ultimate recipe:
- I use glossy photo paper for laser printer (135g/m2)
- wash your PCB board with soap, then with window cleaner (or detergent with alcohol).
- sandpaper your board with ultra thin paper (600, one used for body car)
- wash again the board with soap, then with window cleaner. It must absolutely be dry.
- preheat the board, with your iron (max temperature, mine doesn't heat a lot)
- place the paper on the board. Be careful, it'll instantly stick to the board.
- iron the paper. Apply a lot of pressure, all over the board, for ~15min (yes a long time, but it may depend on your iron)
- continue with the iron tip, and redraw all the circuit (black tracks will appear through the paper), for ~5min.
- Ironing time: ~20min
- then place the board on hot water, no soap. Soak it for 30min.
- peel-off the paper. Most can easily be removed, only the last layer, where the toner sticks, will mostly remain on the board.
- soak it again for 1h
- peel-off again the paper. You may need to remove very small portion of paper, between the tracks. Leave the paper on the tracks, it won't bother while etching since tracks remain accurate. This can be time-consuming, but be precise. Also don't be paranoid, the toner really stick well to the board and won't be removed easily
- once done, dry the board. Check if you've missed some paper.
- clean the board with window cleaner. While it won't remove toner, it'll help to remove paper residue and get an accurate board.
- you're done. You'll then need to etch the board. Once done, remove the toner using acetone (nail polish remover works well)
Here's some pictures:
![]() |
![]() |
| Once all paper has been peeled-off, here's the global result: tracks are still covered with paper, but the whole seems accurate. | Zooming shows tracks are perfectly accurate, even holes in pads. Text is too fuzzy won't be rendered well if left as is. Using window cleaner can help removing extra paper residue. |
![]() |
![]() |
| Paper on tracks is clearly visible here. Important is the way limit between tracks and copper is clean, accurate. | After etching, here the result. Everything looks nice. There are two pen traces which I've added. The big trace on top of the board isn't consistent at all. Using a PCB pen is definitively not reliable... |
![]() |
![]() |
| Once cleaned... Great... | Even text is readable :) |
- Category(s)
- Geek
- SirBot Project







