Maker Pro

Mind & Infra Red Controlled Robot Car

I'm building a Arduino based Robot car which is controlled by both Brain Waves & Infra Red. It is 4 wheel drive with line following sensors & a ping sensor to (hopefully) enable it to be autonomous. I'm also hoping to fit an lcd touch screen.
Status
Not open for further replies.

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Yeh man! This is gonna be SO cool! I'll tell ya wot mate, I've ordered a Mega 2560 board for a friend of mine (got it cheap for about £2.50)! Cos he says he's gonna start getting into it, BUT I've got a feeling it's just chitter chatter. If he isn't that keen when it arrives, I'll donate it to your project. I'll post it over. Like I said, it was only £2.50 which is nothing over here. Not promising because he might shock me, but if im right, it's yours, my friend.
Spike, If he doesn't want it, keep it for yourself mate. I don't really need it here. I'm sure you could put it to far better use, even if you just keep it for a spare, in case your other one is damaged. I'll never need to use the larger chip. Thank you very much for the offer, though. Very kind indeed.

Spike said:
P.S. I've never heard of that virtual thingy you were on about, I'm DEFINITELY gonna check that out.
The simulator is made by Virtronics, an Aussie company I'm pleased to say.
Their website is here:-
http://virtronics.com.au/Simulator-for-Arduino.html

In your GBP, it would cost bugger-all. (About 8.24GBP at the moment.)
It's still being developed, so prices are very low, but will go up pretty soon. This is a good time to buy.
Here's a screenshot that I just took:-
Simulator Screenshot2.JPG

It allows you to connect inputs, both digital and analog, then monitor the outputs, among other things. In the screenshot, I have an analog input, (a pot, set at 127 in the pic), an analogue output, the "DimLED", and two other LEDs connected.
It runs in real-time, so during execution the LEDs are lit for the same period that they would be in a real Arduino.
Well worth the cost, for learning.

Glad you figured out the FIFO. (Stands for first-in first-out.)
It's a pity thay don't come in the larger PDIP through-hole package. It would make soldering much easier. If you search around, someone may already be selling them pre-soldered to a small carrier board. Here's the chip's datasheet, if you don't already have it:-
https://www.frc.ri.cmu.edu/projects/buzzard/mve/HWSpecs-1/Documentation/AL422B_Data_Sheets.pdf

I downloaded the 'Brain Grapher' software yesterday, but it won't work on my old machine.
(It's used to display the brainwave data in graphic form on the PC.)
It needs the 'Processing' language, so I've downloaded a couple of versions of it, but still can't get it to work here. As an alternative, I've started studying up on 'Processing', learning the language, so that I can write my own visualisation software. It's based on Java, and once a 'sketch' is written, it can be saved as a Windows *.exe, so it's very convenient.

I noticed something very interesting, too. The 'Processing' software is almost identical to the Arduino software. Even many identical menu items, and the term 'sketch' is used in it too. It's fairly clear that the Arduino software was actually written in 'Processing'.

I managed to write code for a simple bar graph last night, with 8 bars that could correspond to the 8 brainwave inputs from the Arduino Brain Library, so I'm getting there. (It's a simple graphic representation so far, not tied to any inputs or anything, but I'm getting there.)
I'm buggered today - spent the whole night wrestling with it. Now back to the Arduino language study........
A processing window screenshot, showing the bar graph. It could be much larger if I use it for brainwave input display, with each channel labelled "Concentration", Low Alpha", etc.:-

Processing Screenshot.JPG
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Here's a short video of the original 'Brain Grapher' while running:-
 
Last edited:

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
Hi Steve, how are you my mate? Firstly, are you sure about that board? I HONESTLY don't mind (& would actually like to) send it you. Like I said, they are pennies on eBay. Also, I think I MIGHT be able to get cheap postage because my works use Fed Ex a hell of a lot. SO, if you change your mind, the offer is there. I haven't had a chance to look at your posts properly yet, due to work & a TOTALLY bonkers Mrs who has some barnpot idea that doing DIY on the house is more important than building a mind controlled robot! Women! Can't live with 'em, Can't shoot 'em! Anyway, my new laptop has turned up this morning! WooHoo! SO, as soon as I get the ball & chain off my back, I'm gonna have some playtime! So I'll get back to you then mate. Spike
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Hi Steve, how are you my mate? Firstly, are you sure about that board? I HONESTLY don't mind (& would actually like to) send it you. Like I said, they are pennies on eBay. Also, I think I MIGHT be able to get cheap postage because my works use Fed Ex a hell of a lot. SO, if you change your mind, the offer is there. I haven't had a chance to look at your posts properly yet, due to work & a TOTALLY bonkers Mrs who has some barnpot idea that doing DIY on the house is more important than building a mind controlled robot! Women! Can't live with 'em, Can't shoot 'em! Anyway, my new laptop has turned up this morning! WooHoo! SO, as soon as I get the ball & chain off my back, I'm gonna have some playtime! So I'll get back to you then mate. Spike
Regarding that board, I would have bought a MEGA myself except that the chip only comes in an SMD version, not through-hole, so I can't easily buy the blank chips and fit them onto my own custom PCBs. That's why I went with the smaller UNO. I've already designed a small, simple board so I can easily burn the Arduino bootloader into blank ATMega328P chips.
There are a couple of pics and a schematic of my efforts here:-
https://www.electronicspoint.com/threads/arduino-vs-raw-pic-atmel-etc.275345/page-2#post-1663249

I'm just waiting for some 28-pin ZIF sockets to arrive, then I'll get stuck in and etch a board.
Once I've burned the bootloader into a new chip, I can program it up the usual way, in the Arduino board, (or I might make a second board for that), then use it on my own application-specific board.
Sure beats using a real Arduino for all projects. I can make bigger or smaller boards as necesary, with whatever hardware that I need on-board, to suit my circuits.

If I decide that I do want a MEGA to play with, I can get one here for about $20 with free postage. I must admit, the multiple hardware serial ports would be useful. To get the brain project working the way I want with the UNO, I'll need to use the hardware serial port for receiving and then use the Software Serial Library to simulate a second port to send the data out. Or split the pins of the hardware port - the RX for receiving the raw data from the headset via RF and the TX for sending the processed data out to a PIC for motor control (or whatever).

And yeah, women have their priorities mixed up. They're way too practical and sensible in that regard. (Just as well, since we're not. :D )
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
I'll tell you what, Steve. What you're talking about there, building your own boards & stuff is EXACTLY what I want to be able to do! Most of the lingo is still double Dutch or like 'Newspeak' if you've ever read 1984 by George Orwell! But as you're speaking it, I'm looking it up & learning. I'll tell you what's doing my head in now, having to try & find such TINY bloody screws for the circuit boards! I've been using a company called ESSENTRA a lot. They're brilliant for sending free samples of everything from nuts & bolts to LED lenses & castor wheels & stuff! And it's all next day delivery for free! Check them out mate
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Essentra don't look bad. They even have an Australian branch. I've bookmarked them.

Here's one for you, too, if you don't already buy from them:-
http://uk.rs-online.com/web/
A good range of transistors, ICs and other smiconductors, along with heaps of other stuff. And anything that's not in stock locally, they bring in from overseas branches at their own cost.
Branches in the UK, US, Australia and elsewhere.
Free delivery for online orders, too.

Back on your project, have you had a chance to get the Bluetooth connection from the headset to the Arduino going yet?
I've seen what the csv output from the Mindflex and Brain Library looks like, as I showed you the other day, but would be interested to find out what the data from the Neurosky headset looks like.

I'll probably copy and modify the Brain Library, to suit my purpose. Had my first go at writing a simple Arduino library yesterday. It's a relatively easy procedure. You might want to give it a go.
A link to a tutorial on library creation. It walks you through the process of writing a sketch then converting it to a class in a library stored in *.cpp and *.h files, with a "keywords.txt" file for syntax highlighting:-
https://www.arduino.cc/en/Hacking/LibraryTutorial
 
Last edited:

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
Firstly, nice one for the heads up on that company. As for linking my neuroSky to Arduino yet, I haven't got a Bluetooth dongle yet. I've had it connected to my iPhone & the laptop I've just got is a Apple MacBook(only cost me £150!). So I'm gonna connect it to that in a minute. I'm waiting for LOADS of stuff to arrive off eBay, sensors, modules, etc. With having the Mrs pecking my head, I've not really sat down with it like I should, but I bought her some flowers & a bottle of plonk & Sex & The City 2 DVD earlier! So that should keep her off my case tonight! Lol! ! I had a panic attack earlier! I've got all my circuit boards/sensors etc in one toolbox, all of my Archery stuff in another, and all of my lockpicking stuff in another, all stacked on top of each other. I've opened my archery box & found loads of corroded acid in it! A battery must have leaked from somewhere! But panicked in case it had leaked below into my circuit boards! But luckily not!
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Firstly, nice one for the heads up on that company. As for linking my neuroSky to Arduino yet, I haven't got a Bluetooth dongle yet. I've had it connected to my iPhone & the laptop I've just got is a Apple MacBook(only cost me £150!). So I'm gonna connect it to that in a minute. I'm waiting for LOADS of stuff to arrive off eBay, sensors, modules, etc. With having the Mrs pecking my head, I've not really sat down with it like I should, but I bought her some flowers & a bottle of plonk & Sex & The City 2 DVD earlier! So that should keep her off my case tonight! Lol! ! I had a panic attack earlier! I've got all my circuit boards/sensors etc in one toolbox, all of my Archery stuff in another, and all of my lockpicking stuff in another, all stacked on top of each other. I've opened my archery box & found loads of corroded acid in it! A battery must have leaked from somewhere! But panicked in case it had leaked below into my circuit boards! But luckily not!
So I've gotta ask - are you a locksmith, or a burglar? :D
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
Neither, I just do lockpicking as a hobby. As a kid, there was 5 things I dreamt of doing, being an astronaut (like every kid), being a fighter jet pilot (again, like every kid), being able to pick locks, being able to shoot a kick ass bow & builds kick ass robot. 3 out of 5 ain't bad! lol! Or on the other hand, seeing as I didn't start ANY of those things til I was in my 40's, it's probably a mid-life crisis! Lol.
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
I'm pretty excited today! The THIRD platform for my robot has just arrived! So now, I can proper crack on with it & get some PROPER work done instead of messing about. The reason I'm adding a 3rd platform is, if you look at the pic, with having the Uno board & Motor shield on the second platform along with battery case, there's no room for the Mega 2560 board & sensor shield. I've seen bits about stacking them, but I'm not sure how high you could go & I don't think I'd be too big of a fan of that if just for aesthetic reasons. I not only want it to be ballsy, I want it to look good as well. I'll post a pic when I've put it together. I think you'll agree I did the right thing.
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Sounding good. It's coming together. Looking forward to seeing a pic when you get it together.
Since I don't have my headset or Arduino yet, I'm approaching my project from the other end. Software and planning. I've done a heap of research today. Learned for one thing that I don't need to program the Arduino in it's 'native' language at all. The Arduino IDE is based on C/C++, and it can compile C and C++ code. Much faster, and it uses heaps less program space. And probably even more importantly, I'm already very familiar with C++, so there's almost no learning curve to get started. Every bit of C and C++ that I've tried has been supported, and compiled OK.

Also got stacks more stuff on the Neurosky chip/board, including the full communications protocol. I don't need to use the Brain Library at all now. I can write my own custom code to do it, based on the communications protocol literature.

I'm not sure if you were planning to use the Arduino Brain Library, or some other method/library, but if you're writing your own code to do it, this will help enormously:-
http://developer.neurosky.com/docs/doku.php?id=thinkgear_communications_protocol
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
Actually, it's funny you should mention that, because the other night, I was trawling T'Interweb (as usual when I'm bored & frustrated cos I can't do any immediate work on it) and I came across a book called 'Programming C for Arduino'! So now you've said that, because I'm only JUST beginning to grasp the Arduino language, I don't think it'll be TOO far of a leap to swap over to learning C instead! I'm glad you've said that! Thanks mate cos I trust your wisdom on this! I'm going work in a minute, then when I get back, I'm gonna build it completely, wire it, & start learning C. I'll post a pic. I'm going Archery tonight as well, so it MIGHT be late on.
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
:D:D:D:D:DThis is where I'm up to now Steve. I only just realised that the bloody PAPER came off the plastic boards (Told you I was a novice!). So I stripped it all down & took the paper off. Added one 3rd level to carry the missile style :)D) on/off switch (complete with LED in the switch). On that level, I'm adding a RGB LED as a battery level indicator & possibly the TFT LCD screen. On one of those rear levels I'm gonna add a jack plug socket for re-charging the batteries. The LCD screen is going to be the means to swap between mind control & infra red.
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
image.jpg image.jpg
This is gonna be the OTHER 3rd level where the Arduino Mega 2560 board & the sensor shield is going to go, along with the ping sensor on a servo.
 

Spike124

Aug 11, 2015
61
Joined
Aug 11, 2015
Messages
61
P.S. PLEASE keep all the advice & links to libraries & about programming coming! I know that building & wiring is the easy part! I'm chomping at the bit to get programming! Anyone can build it, making it do what you want is the hard bit! Again...... A bit like women! Ha! Ha! Ha! :p:D:confused:
 

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
You've done well, mate. That car looks great. Don't forget to put a copy of those pics in the actual "Project Log", to show it off. :cool:

I guess the paper you referred to that had to come off the plastic boards was the protective sheet on the perspex. Looks much better with it off. ;)

Now, a technical point. I'm surprised that you didn't go for RF rather than IR control for the manual remote control when not under "brain" operation, and for steering etc.
For remote control, on my woodturning workshop alarm system and even a wireless doorbell system, I've used PT2262 & PT2272 remote control encoder and decoder pairs, connected to cheap 433MHz RF transmitter and receiver pairs, with great success. You can have up to 6 channels.

In the case of the alarm system, I bought little 4-button key fob style transmitters with receivers, that already incorporate the PT2262 / PT2272 chips.
It eliminated the need for entry and exit delays - I walk out, shut the door, wait 5 seconds for the PIR detectors to settle down and then enable the system. When going in, I disable the system just before I get to the door.

4-Chan 433MHz Remote Control Kit.JPG

You can set a code/address on both the transmitter and receiver, to avoid interference from other 433Mhz RF signals, and for security. In these key fob sets, there are 8 pins for setting the codes. They're tri-state and can be soldered high, low, or left open. There are 6561 possible codes, (38). This shot shows the code-setting pins on the receiver unit. There are similar corresponding chips left unsoldered by the manufacturer on the transmitter board, to match up the codes on a pair:-

Code-setting Pins.JPG

Edit: I learned the hard way that many eBay sellers imply that they're sending you both units, but only actually supply the transmitter key fob unit. This seller definitely sends both units, and they work well:-
http://www.ebay.com.au/itm/191238811516 (AU$4.79 with free delivery)
Useful for a range of projects, as you can imagine.

More to come.........
 
Last edited:

Old Steve

Jul 23, 2015
734
Joined
Jul 23, 2015
Messages
734
Those PT2262 (encoder) and PT2272 (decoder) chips are great when combined with the cheap little 433MHz or 315MHz transmitter and receiver modules that are easily available on eBay.
The big advantages over IR is that they don't require line-of-sight to work, and they'll work far better than IR outdoors. Outdoors, IR systems can easily be 'flooded' by sunlight and stop responding properly. The range of the RF TX and RX modules is typically up to 50 metres, and even further with direct line-of-sight. They're not as advanced (or expensive) as the APC220 modules I mentioned the other day, but perfect for this application.
Here's an example of a set on eBay. Similar, but not identical to, my modules:-
http://www.ebay.com.au/itm/New-RF-W...-ARM-MCU-WL-/171335288871?hash=item27e4610827

I'm not sure how you were going to implement the IR control, but this could well be an easier way to do it, too, since all the work is done by the PT2262/PT2272 chips.
Incidentally, the PT2262/PT2272 chips are intended for either RF or IR systems.

The PT2262 can be set up to send from 0 data bits to 6 data bits. There are 12 address / data pins in total. When 0 data bits are sent, all 12 pins can be address pins, allowing 312 possible address settings, (531,441), more than enough for reasonably good security and protection from false triggering.

The PT2272 come in 0 data, 2 data, 3 data, 4 data and 6 data versions, with either momentary or latching versions. As an example, a 4 data momentary PT2272 is labelled PT2272-M4. It would allow 8 address pins, with 4 data pins. As in the case of the key fob units, that equates to 6561, (38), possible codes. (I've attached the data sheets.)
This pic shows some PT2262 chips and a 433MHz transmitter module:-

Encoder and 433MHz RF TX.JPG


This one shows some PT2272-M4 chips and a receiver module to match the transmitter above:-

Decoder and 433MHz RF RX.JPG

The 433MHz TX and RX modules can be found easily on eBay, and the PT2262 / PT2272 chips can be found here:-
http://www.utsource.net/ic-datasheet/PT2262-809208.html
http://www.utsource.net/ic-datasheet/PT2272-M4-1187085.html
 

Attachments

  • PT2272_1.pdf
    665 KB · Views: 126
  • PT2262_1.pdf
    371.1 KB · Views: 132
Last edited:
Status
Not open for further replies.
Top