Showing posts with label cricket. Show all posts
Showing posts with label cricket. Show all posts
Monday, November 29, 2010
Cricket Microcomputer Cell Phone
Created by my 9th graders! What I love about this is the experience of cramming all the electronics inside a box. They even routed the IR beamer from the computer to inside the box so it matches up with the transceiver inside. It really feels like an electronic object with the UI on the outside and the complicated stuff on the inside. This is a simple robot as you can't choose the numbers you dial but just hit the same switch and it dials pre-programmed numbers that are displayed on the LED. We aren't working on conditional statements yet. It is their first project after all.
Monday, November 22, 2010
Super Cricket IR Distance Sensor
Gleason Research released a new sensor to use with their Super Cricket microcontroller. It's an infrared distance sensor, which got me excited thinking we can start doing with the crickets what my younger students have been doing with NXT robots. When I tested them out I found that rather than outputting the actual distance reading, the sensor sends the microcontroller data similar to that of other cricket sensors--that is, a number from 0 to 255 that is inversely related to the intensity of environmental variable. So as the photocell sensor returns a higher number for lower light levels and a lower number for higher light levels, the distance sensor returns a higher number for close distances and lower for greater distances. You could work out some data points and calibrate the sensor that way for use in a conditional statement, but it would be nicer to have it return an actual distance. With the aid of this website, I was able to figure out a conversion formula that takes the raw data and outputs something close to actual centimeters. I used the formula given on the website but had to divide the result by 2. Its range is about 8 - 50 cm and it's more accurate from 8 - 15, becoming progressively wider than actual centimeters until up around 50 cm it's about 5 cm too wide. There is probably some fiddling I could do with the formula to lessen the slope a bit but for our purposes--making a functional educational robot--it should work well enough.
So here's a test program I put together:
global [distance]
to convert
setdistance ((2914 / (sensora + 5) - 1) / 2)
end
to main
loop
[convert
display distance
wait 2]
end
This will display the sensor data, converted to cm, on an LED display.
So here's a test program I put together:
global [distance]
to convert
setdistance ((2914 / (sensora + 5) - 1) / 2)
end
to main
loop
[convert
display distance
wait 2]
end
This will display the sensor data, converted to cm, on an LED display.
Thursday, November 11, 2010
Sunday, November 09, 2008
Open Source Electronics

Monday, October 20, 2008
Problems are important

This is the first year I've worked with the Cricket Logo microcomputer and I'm encountering some interesting problems. The crickets are actually increasing the problems quite a bit over the Mindstorms RCXs I used before so it's fortunate I'm teaching 9th grade instead of 7th. The crickets have some finicky hardware and to make things worse I've chosen to use Jackal, a finicky program, because it's the only one that provides syntax coloring for Logo. So today my class was getting the simple vehicles they had built to stay on a road course I made on white butcher paper. Four of the teams were successfully navigating the road little-by-little and three were stuck getting a single motor to turn on. So I trouble-shot with them. Here's what we did:
- send the beep command. Success? Yes
- send a, on. Success? No
- maybe the batteries are dying, not strong enough to power the motor, so change them. Success? No
- send it b, on for the second motor. Success? Yes, hah!
- maybe it's the actual motor, so switch it for another. Success? No
- maybe it's the wires connecting the motor to a, so switch the 9 volt adapters, try a, on Success? YES!
- try b, on. Success? No!
- So the wire or circuit board on the 9 volt adapter is bad
Monday, June 16, 2008
Cricket LED hex codes

Wow, it's done. Once again, here it is. Check out the source. The entire page is written by Javascript in the head!
Thursday, June 12, 2008
Hex codes mapped to cricket LED bus
This project has worked out insanely well. I'll be teaching 9th grade robotics next year using the Super Cricket I mentioned earlier. One peripheral we'll be using is the LED bus, a four-slot red display that can be programmed to display number very easily and letters with much greater effort. In fact, letters can only be programmed by figuring out the corresponding hexadecimal values for each. Fortunately, one Ryan Tucker has done that for us. But I want to go one further and have the kids program abstract patterns for some animated art. So I needed a list of all the hex codes matched to their decimal equivalents and the LED pattern it creates when programmed on the cricket. Wikipedia provided the Javascript that converts decimals into hex values (down the page quite a bit). So I looped it 255 times to give me the list and made an image of each LED pattern in Photoshop by hiding and showing different layers, each with one of the lines. I'm still tweaking the layout to try to get it all on one screen. Here it is.
Wednesday, May 14, 2008
Fun With the Super Cricket
Learned a lot of stuff today testing components of the Super Cricket:
- The difference between the photocell sensor and the infrared sensor is the former detects levels of ambient light while the latter is affected by light values reflected back to it. The photocell sensor would therefore be good for triggering processes in reaction to the room lights being turned on or off, while the ir sensor would be a good line follower or for triggering a sorting system. It's cool to see them at work using a little program to output their values to an LED bus and watch them change as you move them around:
to get-light
display sensora
wait 10
get-light
end
- I also figured out how to store values and upload them to a text file. Here's the program:
to rec-data
resetdp
repeat 10
[display sensora
record sensora
wait 10]
end
- Once the data's recorded, uploading it is easy in Cricket Logo. Just click Cricket>Upload data, and in a few clicks you can upload it and save it as a text file that's easy to import into Excel.
- It's really fun to play with the LED bus. After downloading a procedure that prepares it to receive the LED assignments, you can download any letters you want. Here's the prepping procedure:
to display-bits :d1 :d2 :d3 :d4
bsend $110
bsend 64
bsend low-byte :d1
bsend low-byte :d2
bsend low-byte :d3
bsend low-byte :d4
end
- The values for :d1 :d2 :d3 :d4 have to be in hexadecimal format and they give a couple examples, such as that 'A' is $77. I had no idea how I was going to figure out what value each letter of the alphabet was, but my colleague wouldn't rest until he figured it out and he found this list someone at UMass had compiled. I'd like to know how they figured it out, brute force or programming. So my name is display-bits $7b $50 $30 $76.
- After a little email correspondence with the fine folks (maybe just folk) at Gleason Research, I also learned that I can make our RCX temperature sensors work with the Cricket with a little hacking. They sell a 9V motor adapter, which connects the RCX lead to a motor plug on the cricket. So I thought maybe I could put sensor plugs on the 9V motor adapter instead (the only difference is the motor plug has two holes and the sensor plug has three.) and connect it to the temperature sensor lead. Apparently it will work but the values it returned have to be converted to real temperature values. To achieve this you have to find the values returned for some known temperatures, and in the words of Fred, "do a curve fit in Excel." I'll be talking to a math teacher to figure out how to translate that into a conversion formula. But it's great that we'll be able to use all these temperature sensors we have rather than buy new ones made for the cricket.
Saturday, April 05, 2008
I love the Super Cricket
I just got two Super Crickets. They were tricky to get working as far as the drivers and program configs, but they are so fun. To get everything you need for a PC running XP here is the list of stuff to get:
- Buy the Super Crickets from Gleason Research. It's nice to have the USB-ir interface rather then using the default serial interface.
- Download the Logo-based software to program them, either Cricket Logo or Logo Blocks. The former is a text interface and the latter is interlocking blocks with code on them that force you into creating proper syntax. Another option, actually the one I prefer, is Jackal, which uses the same version of Logo as Cricket Logo but it color-codes your program syntax, plus it has some nice skins. The only drawback to Jackal is it doesn't allow you to upload data from the cricket like Cricket Logo does. I don't know if Logo Blocks can do that.
- If you use Cricket Logo, go down to the bottom of the first link at Gleason Research and download the Super Cricket libraries, or special files that allow the software to recognize the Super Cricket. It tells you where to put them. The software was originally designed for the smaller Handy Cricket and the (relatively) new library files haven't been integrated yet.
- For all three programs, if you get the USB-ir interface you will need a special driver from FTDI that creates a virtual COM port. You save it to a location of your choosing and tell Windows where it is when you plug in the ir transmitter. The software only knows how to interface through serial connections, so this tricks it into thinking it's using a serial connection when it's connecting through USB.
- If you are using Jackal, you will want to set the default COM port for the program by going to the default settings txt file in the Jackal program folder and changing it to COM4. At least that's the virtual port that appeared on my computer.
- For programming help with Cricket Logo (and Jackal), go to the Handy Cricket Programming Reference page. It's really clear. I'm sure there are also good websites for help with Logo Blocks programming. I haven't looked hard, though.
Subscribe to:
Posts
(
Atom
)


