Jump to content
THIS IS THE TEST SITE OF EUROBRICKS! ×
THIS IS THE TEST SITE OF EUROBRICKS!

joblog

Eurobricks Vassals
  • Posts

    11
  • Joined

  • Last visited

About joblog

Recent Profile Visitors

312 profile views

joblog's Achievements

Rookie

Rookie (2/14)

  • First Post
  • Collaborator
  • Week One Done
  • One Month Later
  • One Year In

Recent Badges

  1. I managed to install Firmata on the ATtiny841 chip used on codefox's board. Which means It should be possible to let Scratch communicate with his board over bluetooth and control motors (or anything else) attached to it I don't have codefox's board but I have managed to make Scratch do this for a combination of individual ATtiny841, HC05 and dual motor driver. The details are described here. All that is required is that you (i) add to the boards.h in Arduino as described in the link (ii) take the pared down Firmata2.2 described in the link and upload it to the codefox board using a programmer or Arduino as ISP. (I assume codefox's HC05 has a 57600 baudrate) I found the easiest way to connect to Scratch over bluetooth was using Thomas Preeces A4S(You just need Step 3) It would be amazing to see codefox's tiny lego brick doing all this.
  2. Hi codefox, good to hear from you. I just got the ATtiny841 with the intention of programming it with Arduino. I'm looking at this https://github.com/SpenceKonde/arduino-tiny-841 this http://elecrab.com/archives/826 and this http://forum.arduino.cc/index.php?topic=304606 I'm very interested in why you gave up on using the Arduino IDE. Are there pitfalls I should be looking out for?
  3. DIY Mindstorms for 20 € / 20 $ Here is an Arduino Nano 328(clone), a TB6612FNG Dual Motor Driver and a HC05 bluetooth module all crushed in to a Lego Technic 9x5x3 enclosure. The whole lot, including motors and batteries, cost less than twenty euros/ dollars. It runs the Scratch sketch from the last post among other things and does it over Bluetooth. codefox is going to put all of this in to a pretty 4x3x2 lego brick and I, for one, can't wait.
  4. I don't want to steal anyone's thunder but the update to Attiny that codefox was waiting on has been available for a few weeks now and I wish him luck. This would allow the ATtiny84 in his original set up to be replaced by the ATtiny841 which has a hardware serial and the signal corruption problems that made the ATtiny84 unusable can be avoided. It also allows the ATtiny pins to be mapped to Arduino pins. The reason I'm posting is that I have been looking at something that makes my request for a programmable processor in the brick more or less redundant. A4S allows an Arduino to be controlled using Scratch. If you want to test it there's a very easy 3 button implementation called, appropriately enough, SuperEasy-A4S, available here. http://thomaspreece.com/resources/ You don't even need the Arduino IDE. Once the correct drivers are installed on the PC and SuperEasy-A4S has uploaded the appropriate firmata to an Arduino (or in the present case Arduino-like) board all the programming of the board - pinMode, digitalRead, analogWrite etc. - can be done using a sketch in Scratch. Serial communication with the board through a Bluetooth module is taken care of under the hood - pair the Bluetooth module with your computer and if the sketch says to digitalWrite pin 10 HIGH when the spacebar is pressed then that's what happens. But, being Scratch, you can also turn on the Lego motors when a cartoon figure walks in to a tree on the PC or, sometime in the future, have the PC play a tune when a sensor attached to the brick sees something. Getting this working with a sealed 4x3x2 brick would look pretty close to magic. I have it working on a Dueminalove 328 over a HC-05 at 9600 Baud. Here's some of a program for running two motors written by a six year old.
  5. I haven't read all your code but I think I ran in to something vaguely similar. I was using SoftwareSerial for the Bluetooth connection and getting a lot of corruption of the commands being sent. It is a very clunky solution but what about an absolute delay before sending the next command? Is it possible to estimate how long it will take the receiver to send its one-byte response and go quiet? Using a straight forward delay you obviously don't get locked up by missing the receivers response. Or you could combine both - wait for the receivers response and if it doesn't arrive after a given time then free up Serial for another command. This is as obvious as it is ugly and you've probably tried it already but, assuming we had similar problems, it's what worked for me.
  6. Given what you've already managed to do I didn't think you would be using someone elses board. I was just looking for an estimate of how big a board containing some of these things would be. What kind of options are there for connecting motors and/or sensors? I know there are a number of things to consider; size, aesthetics, keeping a lego 'look' (or not)... Ok you asked for it. There are two main issues. One. You need to reset the baud rate on the HC05 to the rate at which the Arduino can be programmed. Two. When you make a new USB connection to an Arduino board the board resets and the bootloader looks to see if there is a new program to be installed. When you make a new Bluetooth connection this doesn't happen. On the other hand pin 32 on the HC05 becomes active. If you connect pin 32 to the reset pin on the Arduino the bootloader will go looking for a new program to load like happened with the USB. Happy days. There are a few tweaks but that's the general idea. At the moment the most popular description of how to set things up seems to be this one http://makezine.com/projects/diy-arduino-bluetooth-programming-shield/ That tells how. As for why, the same author describes the thinking behind some of those steps in the first answer here. http://arduino.stackexchange.com/questions/1618/programming-arduino-via-bluetooth-module-issue/1757#1757 Also useful, the person who seems to have originated the method describes it here http://letsmakerobots.com/node/30915 Yeah. Even just programming over USB, if you can put a lego brick like that in the hands of kids everywhere for cheap, that really is something.
  7. Maybe we are talking at cross purposes. I am thinking of a sealed block containing the ATmega and the HC05 to which you could attach motors (and sensors). Programming would be done by USB or better still by bluetooth. Having the option to program by bluetooth would require a slight change in the wiring between the ATmega and the HC05 and a change in the configuration of the HC05 but this would be a once off thing and done before the block was sealed.
  8. You obviously know a lot more about this than I do. A couple of points: As ATmega32U4 boards go the Pro Micro is one of the smallest. It is 1.3x0.7" or approximately a 4x2 lego brick. If the board also has to contain a motor driver and two holes for pegs how big a brick do you think would be required? It seems you'd need something bigger than 4x3. If there is room to clip on four connectors it seems a real shame not to break out enough pins on top for at least two sensors as well as the two motors. Programming over Bluetooth. By far the best reason to enable this is just that you can, that it's possible. You have the HC05 and the ATmega in the same brick so why not. As I'm sure you know it's mainly just a question of whether you want to connect pin 32 on the HC05 to the reset pin on the ATmega. (There are other changes, that connection needs a capacitor too, you need some resistors for stability, the HC05 needs to be reprogrammed, principally to change its baud rate to one suitable for programming but also a few other minor tweaks) Why NOT do it? Regardless of how it is to be programmed, whether over USB or Bluetooth, you are creating a huge opportunity by being able to communicate with a programmable ATmega over Bluetooth. Anything Lego should be child friendly. Child friendly programming means something like Scratch or Ardublock and these need a permanent connection between the laptop and the Atmega. Your Bluetooth connection means free roving RC cars and Robots. A car with a USB cable hanging out of it would be just lame. Looking forward to seeing whatever you come up with.
  9. I see what you mean. It would require a 4x4 brick rather than your 4x3. Interesting. I hadn't heard about that before. Did you run in to this in practice or did it occur to you at the planning stage? You may not need to use C. There are a few people working on modifying arduino-tiny to support the ATtiny841 and make it Arduino programmable. http://forum.arduino.cc/index.php?topic=198916.30 https://code.google.com/p/arduino-tiny/issues/detail?id=92 It seems hard to believe you could plug a servo and an ultrasonic sensor on to a tiny lego brick and wirelessly upload an object avoiding sketch. Great stuff.
  10. Ok I think I've got it. The battery pack supplies 9v to your brick. Your brick contains an ATtiny84 microcontroller It has a regulator to drop the voltage and I am assuming you are running the ATtiny at 3.3v. The HC05 Bluetooth module is a 3.3v device The microcontroller also contains a DRV8833 motor bridge. Each motor connects to an xOUT1 and xOUT2 pin of the bridge using Lego connectors that attach to the top of your brick. It is amazing you got all of that inside a Lego brick. It's especially impressive that there is an ATtiny84 in there. So, questions; 1 Seeing as the brick contains an ATtiny84 it seems a shame not to have access to its other pins. Could these be broken out on top of the brick also? Sensors could be attached using Lego connectors. 2 Could bluetooth be used to upload sketches to the ATtiny84? (This is a bit speculative. You can certainly upload sketches to most arduino boards over bluetooth, there are even apps that do it. Whether the same applies to an ATtiny84, I don't know.) Well done again.
  11. Fascinating stuff, congratulations to you all. I only have experience getting a HC-05 Bluetooth module to work with an Arduino board. While the module works happily with a 5v power input it is widely believed that the TX signal needs to be dropped to 3.3v. The module may work with a 5v Tx signal at first but not for long. For an Arduino board the problem is usually solved with two resistors. So I'm asking (i) does the battery supply 5 volts to the signal wire (ii) does your redesigned bluetooth module incorporate a level shift and work with a 5v Tx signal input (in which case it would be of interest to arduino people even without your nicely designed lego block) Well done again
×
×
  • Create New...