First off, something fun (if you’re boring like me)
I decided to record data in my car overnight and through the daytime. From 12:00am to 7:00pm thereabouts. I recorded the data every 4 seconds with the following sensors
Low Sensitivity CDS (Resistor that changes when light hits it)
High Sensitivity CDS
Accelerometer X,Y,Z axis
Why did I do this? just cause. here is the resulting chart
Here is the legend: B = Temperature , C = Low Sens. Light, D = High Sens. Light, E = X axis accel, F = Y axis accel, G = Z axis accel.
All of these values are as the MCU read them, ranging from 0-1023. They are also logarithmic so as they approach 1024, the value is ‘squished’ so large changes appear small. anyways, I thought it was neat to see the following things occur.
Temperature of the device goes down as the night wears on. There are some lights detected, probably people passing by in the alley behind my car. some drift is noticeable from the accelerometers (due to temperature change?). Also something to notice is that X and Y are pretty much the same
The light appears to go haywire, this is me driving in the dark and going under streetlights. Also, the temperature increases, the accelerometers shake and show the duration of my drive to work.
As my car is parked you can see that I have parked crooked by the X and Y axis. Also, the sun starts to come up. As far as I could tell, it was pitch dark outside, the sensitive light meter says differently.
During the day, the overcast sky keeps the sky about the same light level, whereas with the less sensitive instrument, since it’s further from saturation, shows variations in the ambient light level through the day. Temperature also fluctuates.
The Drive home, very similar to the drive to work.
The car is level again and the light level drops as well as the temperature.
Anyways, I know it’s boring but it’s neat to see real world events (ones you didn’t know about) show up on the chart.
Update on the Digital Gage
Things are proceeding apace with this as well. The rail and the encoder are attached together and they also slide together with the aluminum part I machined for that purpose. Now as for the board, this was a nightmare. Nothing but problems. I started out with a PIC18F46K80, the faster/cheaper versions of the high end 18f4680 and initially it was all OK. Until I tried to use the UART. For the life of me, I could not get the UART to stop spitting out junk. Once I started getting it to stop spitting out junk, it then output nothing at all. 🙁
Now, I’ve switch over to a standard 18f4680 but the LS7166 is giving me problems. aaargh! Anyways, things should improve with a bit of hard work and a fresh mind on the idea.
First, an update about the annoyo, it worked perfectly and maximized irritation while making itself difficult to find. Anyways, I just received my BeagleBone and I promptly thought to myself, what am I going to do with this? Then I thought, hmmm, I have a bunch of other boards too.
These boards aren’t including the mps430 board, the pic boards, the mikroelectronika board or the Friendly ARM. Too many boards, not enough time. I’m sure I’ll use them for something I guess. Tomorrow begins the fun of interfacing the LS7166, it shouldn’t be too difficult.
So, even though I’ve built a wide variety of crap over the last few years, all of them with varying utility, I’ve decided to build a quick robot. With oodles of free time and the feeling of having to go back to work on the horizon after what feels like an eternity of holiday (1 week) I quickly grabbed a bunch of stuff I had sitting around and put this guy together with all the grace of a kindergarten macaroni art sculpture.
Based off of an Arduino Nano, this guy works just fine. I don’t like using Arduinos for the following reasons.
Perceived lack of control of what’s going on inside
Feels like cheating since it’s so easy
Arduino UI is kind of shitty, especially for larger source files.
When dealing with AI routines, making it difficult to use multiple files is a minus
Anyways, i plugged ahead and quickly pounded this out with the following IO
Input – The only one, the Echo pin on the ultrasonic sensor
Output – Trigger on ultrasonic sensor
4 Digital output – for controlling direction on SN754410 Quad half h-bridge driver. These go to two gear motors which are attached directly to wheels
1 PWM out for duty on motors
1 attached servo out of the servo to turn the sensor
Most everything worked out swimmingly until I fucked around with some wiring and produced a short. I hooked the robot on to the USB supply on my computer, I noticed after a few second that the power to the unit wasn’t running… hmmm POOF! Well, as it turned out, there was a problem with the wiring to the ultrasonic dealy and it blew what I beleive was a zener diode
I wasn’t able to figure out exactly what it was, I suspect that it is a zener diode that selects between main power and USB since it is on the output of the VReg. I could be wrong. Since I didn’t have any more Arduino Nano’s I simply tried to fix it and soldered a wire across the offending gap. The device seems to work fine…? Anyways, if anyone know what that part was on the Arduino Nano v3.0, I’d like to know ’cause I couldn’t find the 3.0 Schematics and the design has moved those parts around.
Anyways, The robot moves around based on a very simple algorithm.
Scan from 40Deg Right to 40 Deg Left in 10 deg increments
return appropriate movement from a function that analyses it
execute proper movement (Forward, Backward, Right, Left, Hard Right and Hard Left)
It seemed to work reasonably well. I’d like to build a more sturdy version for shits and giggles so that I can play with the algorithms. I’m probably gonna build one with a PIC18F2685 instead of an Arduino. Also, instead of a single sensor, I will use IR proximity sensors to detect low lying objects. Moving the sensor with the Servo make the robot seem more intelligent than it actually is like it’s ‘looking around’. I quite like that. 🙂
Anyways, it’s my first post of the year, considering it’s January 1st and 3:52 am as I write this. maybe I should go to bed. Here’s a video of it getting around.
Ok, well, the year is coming to an end and I’ve seen a number of neat devices out there but here are some that I own. The next year coming up is a going to be an interesting year methinks especially since there’s gonna be some big changes in my life, not to mention the fact that I’ve quit smoking for some time now.
Anyways, here they are:
This nifty little device is the Arduino NANO. Now, me being me I believe that the arduino’s are something akin to cheating since you don’t need a programmer, it runs right off USB and communicated directly with the computer. The small size of this device and the ease of use make it truly a neat device. Call me lewis ’cause I am starting to like the arduinos. They sell for as little as $14 on EBay (they are probably knockoff but work fine) and are strangely useful for bashing out simple stuff.
Mini PIR Unit
This little guy can detect motion (heat difference) up to 5M away. it only draws .15mA and costs only about $4 on Ebay. The interface is simple with two trim pots, one to set the sensitivity and one to set how long the signal stays high when triggered. I bought a whole bunch of these for a project I never finished (A distributed monitoring system) and I might make something cool out of them.
This little guy seems to work really well. Based off the nRF24L01 chip, this transceiver will draw about 15mA at continuous load. If you’re using it intermittently, it’ll run at about 2mA. Alos, it was really hard to get an image of the pinout for this device since the seller kept saying they’d give it to me and never did. Here’s an image of the pinout.
You can get these devices for about $4-5 each. A real steal.
CP2102 USB to Serial out
These guys are useful because you can plug a test device directly on to the usb port and not need a max232 or equivalent. It features a 3.3 and 5v port and works like a damn. Concievably you could use this with an intermediary to provide the SPI interface to the 2.4GHz Transceiver and use it to provide communication to other transceivers to the computer.
This is the ultrasonic transducer. I was playing with it last night and it works really well. It measures anywhere from about 1 inch to 16 feet or so. Simply provide a short 10 to 100 us pulse to ‘trig’ and measure how long the ‘echo’ pin remains high. the ‘echo’ pin will go high after a delay once the trigger pin has been pulsed. I was able to get pretty good accuracy once I calibrated it and with some averaging routines I was abble to get resolutions of about .01″. Surely it wasn’t THAT accurate but it was close. These again were only like $6 each. It should be said, that with full measuring duty this device draws about 15mA.
Anyways, that’s what I’ve been playing with. Hopefully other people may purchase these little trinkets and have fun. EBay sure is an awesome place for the hobbyist like myself for weird knick-knacks!