May 142020

Here is the first semi-functional build of a bot type thing I’ve been working on. I’m calling it ESP Creep, because it’s ESP based and it kind of creeps.

ESP Creep demonstrating how poorly wheeled vehicles perform without friction.

It was made to have a minimum part count and be simple to assemble and control. I’d like these to be available for anyone who wants an extremely inexpensive robotic camera platform. I always envisioned some kind of desktop multi-bot ‘soccer’ platform to help learn and play with vision control systems and such, but there weren’t any cheap-o bots that really fit the bill. This isn’t ready for much except more development, but it does most of what I intend it to do, albeit very poorly, so I figured I’d share.

Here are a couple of obligatory glamour shots of the bot. Just look at those unnecessarily long, flowing servo leads… majestic.

These are the parts involved, sans 3d printed parts and a half-dozen 8mm m2 screws.

~SG90 Hobby Servo (Angle)
~SG90 Hobby Servo (Continuous Rotation)
~16340 Battery Module and battery
~1000uf (6.3v) Electrolytic Capacitor
~Breakout PCB and Connectors.

The PCB breakout is the only custom part, and it’s not strictly necessary, just very convenient.

I chose not to do the traditional differential drive. I’m not entirely clear on why I didn’t want to, but I’ve rationalized it with a few apparent advantages. One it’s just easier to handle control wise. There’s no need for ‘mixing’ turn and throttle variables into the motor values. This just makes it +/- for drive, and +/- for turn. Also you don’t have to calibrate motor speeds to make the thing go straight. Mounting the motors for differential drive seemed to make the bot footprint larger, or wider at least. Also I like that it makes steering pan the camera. And I can’t always find continuous rotation motors and I hate modifying angle servos.

Obviously the next step in the 3d design is to get some friction happening on the wheels, and tighten up the wiring situation.

The big problem is the ESP32CAM software. It serves up the camera and parses UDP packets to command the servos. You can see in the video at the end the connection drops. It does that about 30 seconds after you connect. Sometimes I can reconnect right after, but sometimes I need to reboot the ESP. I know the ESP32CAM can be fairly stable because I have several running esphome on But I cannot get these things to stay connected with Arduino based code. Some of it might be the motor power demands, the ESP’s are a little finicky with power, but it’s not consistent with motor power, it drops when it’s just sitting there. I added a big honking cap that I think resolves any brownouts but I don’t think the ESP is rebooting because I can still ping it right after it drops the camera connection. I can’t get any error output when it’s connected to serial that gives me any clue what’s happening. But I’ll keep working on it, I’d love some help if anyone ESP savvy has any ideas.

Here are the files. These are not really well organized. It’s everything you’d need to recreate this bot, but it’d take a pretty handy person to get it all working. I would love it if another DIY nerd wanted to jump into this, especially the ESP32CAM arduino sketch. Fair warning this is terrible code and I express my frustration in comments and variable names. Also I can’t find the stencil files for the PCB right now, but I got it made by OSHPark so they’re still up there. Eventually I’ll get more and maybe sell them in kits or something, but if anyone wants them just let me know, I think I can get the files from OSH. Also it’s just breaking out power and data for the servos so anyone could reproduce it.

~Blender 3d File
~Arduino Sketch
~Python File (keyboard control)

Aug 132019

I’m getting back around to some of my electronics stuff and I was discouraged that the Lolin32 I was using had been discontinued. In retrospect I probably should have used ESP8266 as the basis for WiFi LED control, but meh.

So anyway, I recently found a new board to get excited about, plus a few battery modules that haven’t actually come in yet. The ESP32-CAM has most of what I’d want in a board for simple bots; camera, wifi, and enough GPIO to control a few servos and an onboard flash LEDs. I got my first one in last weekend and spent it trying to get the basic functions for a FPV bot down.

Took me a while to cobble together the functions I needed from available docs and example code, but I’ve got a sketch that does the following:
~Connect to WiFi (SSID\PW hardcoded for now)
~Start camera stream
~Start UDP listener, parse and process incomming packets
~Servo motor control (2) currently
~LED control, onboard RED (ON\OFF) and WHITE (PWM)

Here’s the code I’ve got so far- be warned; like all my code- it’s a nightmare, but it works for me. I left some notes and links to other code I scavenged, but there’s a lot more to do and I honestly don’t even get how the camera stream is working in this sketch, but it does, so good enough for now.

The biggest downside of this board for me is it doesn’t have a built in USB interface so I have to use TX\RX pins to load code, but that’s not too big a deal. Though since only have the one ESP32-Cam at the moment and I’m leaving that one the breadboard for testing. I’ve ordered a few more since they’re so cheap- next one I get will go on this little robot platform I found online and printed. I actually found this design online some time ago and saved the files, but now I can’t figure out where I found it, so if anyone knows this design and has a link to it please let me know.

Hopefully I’ll post more because hopefully I’ll do more, but this is something and I figure if anyone else out there is messing with an ESP32-CAM out there they may find this marginally useful. If by some chance you are working with this board feel free to contact me, it’s got some great potential.

Aug 282017


So I’ve been using Arduino Nano’s for a long time and my communications were pretty limited to
bluetooth and IR. I always wanted to use WiFi connection, but the expense and effort to integrate WiFi with Arduino was never really worth is. Enter the ESP8266- I actually made a few attempts to use it as a drop in replacement for the bluetooth modules I’m using, but I never got anything working the way I wanted.

So then I start seeing these ESP32’s and they look pretty sweet, but I wasn’t sure I wanted to take the leap when I was so comfortable in my little Nano world.

Then I see the Lolin32 ESP-32 board, with one major thing that set it apart- the battery connection and charging circuit. Game changer for me. I’ve been using USB battery packs forever because they’re pretty self-contained and nothing I could hack together would be as good as just plugging in the USB, but now I’ve got options.

So I got a couple of these Lolin32’s and I’ve had about a week to poke at them. I finally got a few of the puzzle pieces turned over so I think I’m ready to start redoing the old bluetooth LED FX stuff for the ESP-32.

So this post is mostly just to make notes and such so I don’t forget and maybe they’ll help someone else trying to get started with these chips.

Here’s some pics of my ‘first light’, got a little strip of LED’s controlled via a simple web server on the Lolin32.

~FastLED library isn’t there yet. They just updated it with ESP32 support but I still couldn’t get it working so I ended up using Adafruits Neopixel library. There are still some weird flickering and color issues, but for the most part the library works okay.
~Pin 0 is weird. Not sure what’s up with that but when you have anything connect to it the Lolin32 boots into a different mode so idk if you can use this pin as a normal GPIO

~Going to figure out more about the deep sleep mode on these things
~Not sure if there’s a way to monitor the attached battery voltage, but that would be great
~Still haven’t tried servos.
~Something about capacitive touch buttons built in.

Dec 232016

So I figured I’d start posting a little bit about what I’m up to arduino\blender-wise, mostly to try to get back in the habit.

Been working on a loose idea about some kind of robotish platformish kind of thing. I keep calling it robot rugby but I’m not really sure what that means at this point. I envision some kind of arena with about 4 simple bots trying to move around a puck or ball mostly by pushing it. The controls will be a closed-loop feedback from an overhead camera that can monitor each bots position and do some basic path planning.

The bots are super-simple, not even bots really, just remote control things because they really don’t have any sensors of their own. I want to utilize cheap, common parts and this is what I have so far for the ‘v1’ bot. The basic capabilities of these bots are:

-motors for mobility
-led’s to visually ID each bot via color patterns
-control receiver
-battery powered and able to ‘self charge’ when low

The parts list so far is pretty simple
(1) 9g Servo – continuous rotation
(1) 2.5g Servo – standard 180deg
(1) Arduino Nano
(1) USB Battery Pack
(3) RGB LED’s
(1) IR Reciever

To get started I went with a differential drive but I’ve changed my mind on that. Here’s the differential drive version:
botv2-img_20161120_215020_lrThis is basically another iteration of ugbot and tweedle, but actually way simpler. I’ll probably end up calling them Tweedles though, or 790’s, and if you get those references we should hang out. And here’s the breadboard testing rig I made early on to just get all the wiring and code set up before I soldered anything.botv2-img_20161222_211927_lr

I decided to go with a ‘car drive’ for several reasons. It takes the weight off the servo drive, and I think it’s more efficient to have one drive motor instead of two, plus it means I only need one 360deg servo and those are slightly more expensive or I’d have to mod a regular servo and that’s a pain. I’m still honing the design but I’ve got a basic transmission and steering system made from little 3d printed parts. Here’s the first test print of the transmission. It’s super-simple, gear ratio is 1:1 and it’s strapped on with zip-ties. I was going to glue it but the zip ties magically worked so I think I’m going to plan on using those in the next iteration of the print.

botv2-img_20161218_191906_lr botv2-img_20161218_191924_lr










I decided to use IR control because it’s by far the cheapest as far as parts go, talking about less than a dollar compared to BT, RF or WiFi which can get to several dollars and adds a lot of unnecessary complexity. Though I probably will play with those ESP8266 WiFi modules at some point, I’ve already ordered a couple to mess with since they’re only a couple of bucks.

I don’t really need manual control for the ultimate goal of this, since this is really all an excuse for me to play with computer vision and visual servoing concepts and code, but it makes sense to create a manual controller just for testing.

I wasted a lot of time screwing around with a ‘funduino’ board, but it ate up too many pins and one of the buttons never worked so I got frustrated with it. At some point I realized I had a wii nunchuck and a wiichuck adapter already, so I put them to use. The wiichuck is I2C so it only uses 2 data and 2 power pins, way better than the 8 or so pins the funduino required. I wish I’d thought of that before I wasted like $20 on the funduino and an arduino uno to use with it. Here’s the wiichuck IR control rig:



I had no idea what I was getting into. I’d played with RF and BT modules before, I thought IR control would be simple, and it kind of is, but it’s also kind of a nightmare.

A little backstory on the IR thing- I’ve also been kind of wanting to control flying things via computer vision for a long time- specifically these little cheap IR controlled helicopters. Quads are fun too, but the tiny ones are really hard to control, have terrible battery life, and are more expensive than I’d like. The little IR helicopters are surprisingly easy to fly, cheap, and have decent battery life for a flying thing. Going with IR for the bots was a dual purpose decision, it was cheap for the bots, but it also could lead into controlling the helicopters too.

I started to look into LiRC, but honestly I just got confused, I don’t think that was meant for what I’m trying to do. I slapped and IR LED onto a Raspi and messed around with it awhile, got it to send a few codes, but I just didn’t like it, so I went back to the arduino to actually fire the IR LED. I figured I’d set it up so the PC sends serial commands to the arduino and it fires those off in IR language. I didn’t realize IR language was such a pain in the neck to learn and speak.

I won’t go through the whole process, a lot of it involves me being an idiot, making stupid assumptions and spending long hours learning how stupid those assumptions were and why they were stupid. This is one of the tools I made to help me stop being stupid. It’s just an IR receiver and an OLED screen I thought I could use to analyze IR codes. It really hasn’t helped that much, but I do like these little OLED screens a lot now. Here’s that thing:botv2-img_20161222_211941_lr

Controlling the bots turned out to be fairly straight-forward. I just used the NEC protocol to send 6 byte chuncks that encode the bots motor states and ‘ID’ (because I expect to be controlling multiple bots with one IR LED), and another byte in case I need it, maybe for RGB LED states or something. It actually wasn’t as straight-forward as all that because the NEC has these repeat code that are just weird and I didn’t know they were happening at first and thought the receiver was junk or something.

I thought controlling the helicopters would be a matter of pointing the remote at my receiver and reading the codes and figuring out the protocol. That didn’t work. The arduino IR library I was using (IRLib2) had no idea what those codes were. Long story short I finally broke out my little oscilloscope, made a cheap-o IR probe from an IR LED and a broken headset jack. I’m still figuring out the exact protocol these things use but at least now I can see the actual pulses and decode them myself. So far I can get the helicopter to turn its light on and off but even that doesn’t always work. Here’s my trusty gabotronics xprotolab portable with the probe and the helicopter controller- pretty much the best kickstarter thing I’ve backed. This thing is great, and it was like $80 through the campaign.

Because at the moment it’s not worth posting and I am surprisingly lazy. I’ll post print files and code when there’s anything really worth posting, but if by some bizarre chance you’re working on something similar and give no flips about the state of the code I’d be happy to share.

I have yet to actually control a robot via computer vision, but that’s part of the long term goal of this. I have played with a little of the code required just to see what I’m getting into. I downloaded VISP Visual Servoing Platform and went through a few tutorials. I realized pretty quick it wasn’t what I needed, or it was a lot more than I needed. It also meant I’d be coding in C++ and I was okay with that but it wasn’t my preference. I realized most of the functions I needed where actually OpenCV so I just went to that, and I can use python, which makes my life much easier.

Since I know I’ve got a lot of work to do on the bots I thought I’d make an even simpler platform to test object tracking. So I put together this little rig that has 2 servos with a laser diode slapped on it so I can just point it and a camera at a wall and start tracking the movements of the laser and control it with visual feedback. Here’s that little rig:botv2-img_20161222_215613_lr

This is really nothing so far, I’ve just been randomly poking at this idea for a few months and decided I should post something to try to get back in the habit of posting stuff I work on. I would be nowhere with my arduino stuff if it weren’t for other people’s little blogs and sites so I figure I’m obligated to offer the same to some other random shmuck trying to fudge their way through an idea that’s really way over their head but they dive in anyway. Here’s to you, shmuck.

Yeah- I know. I’m not really sure either.

I’ll post more on this project as it evolves, but it is just kind of an cloudy vision of an idea so don’t hold your breath for anything spectacular. I think the old progranimals and lightning stuff was actually cooler and I should probably be developing that stuff more, but this is what I feel like doing now so I am.

Nov 102013

[EDIT] Here is a link to an update of these effects made by Stefan Mayer designed to work with the OctoWS2811 LED Library. Thanks a lot Stefan, great work!

[EDIT] I’m planning to clean up the Android control app source and put it on github, but in the meantime here’s the code.

[EDIT] If you end up using this code for a project please send me a link/pics/video! I love seeing what people do with this! If you like I’ll post a link to your project on the FastSPI FX – User Coolness post. Also make sure to thank Daniel Garcia (the genius dev of the FastSPI library) on the G+ FastSPI Community.

Here is an update to the Arduino FastSPI2 FX demo code (v0.51). I’m also introducing an Android Bluetooth Control App and a Chrome Extension.

I’ll continue to work on improving these programs but I think I have them to a point where it might be useful to some people- so here they are!

Here is the Arduino Sketch (v0.51)

Here is the Android App on the Google Play Store (v0.1a)

Here is the Chrome LED Controller Extension (v0.1)

— — — SETUP / NOTES — — —

– This version uses the Software Serial library and FastSPI2 library. Also the default serial speed is now 57600.
– The following is a breadboard layout and schematic for setting up a JY-MCU Bluetooth chip with an Arduino (Duemilenove or Nano) to drive a strip of addressable LEDs. This should work with any LED strip that is supported by FastSPI2 RC4 and later.

– To control LED strips via the Android app you’ll have to pair the JY-MCU module with your smartphone/tablet in the Bluetooth/Wireless settings. The PIN for these modules is usually 1234.

– To load the extension, unrar the file to a directory. Then in Chrome go to Settings>Extensions>Load Unpacked Extension. Then select the directory. Then you can launch it from there.
– This extension has been tested on Ubuntu 12.04 and WindowsXP. For Windows you’ll have to install the USB Serial drivers, but the automatic driver search seems to work fine for this.

— — —

If you find this really useful, please consider donating a little to the cause. Thanks!
[paypal-donation reference=”FastSPI2 LED FX – Android/Chrome”]

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq


Oct 152013

I had a little trouble finding references to how to setup multiple strips with FastSPI2, so I thought I’d post this.

You just use an offset value like in this example:

LEDS.addLeds<WS2801, 7, 9,   RGB>(leds, 43);       //<---Strip1 - WS2801 - 43 LEDs
LEDS.addLeds<WS2801, 11, 13, RGB>(leds, 43, 12);   //<---Strip2 - WS2801 - 12 LEDs
LEDS.addLeds<WS2811, 5,      GRB>(leds, 55, 16);   //<---Strip3 - WS2811 - 16 LEDs

In the additional strips the first integer passed becomes the offset value and the second is the number of LEDs in the strip.


Sep 212013

[EDIT] Please check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control Extension.

[EDIT] Revised once again, and made a python GUI. See this new post.

This is a revision of the original FastSPI LED Effects Examples I wrote awhile back.


I’ve gotten some very positive responses for these examples so I figured I should update them to be a little less clunky (the operative term here being ‘less’, they’re still quite clunky) This revision will work with RC3 of the FastSPI2 Library.

These are little LED displays I made, one is a circular back-light and the other a wave shape with a little diffusion in front. Both are Arduino powered of course. I just ran the ‘demo mode’ on both and tried to start at the same time so they’re not in sync or anything. Just thought I’d show them on a couple of different configurations for the heck of it.

If you have any issues getting this to work please check through the comments on the original post page first. A lot of people have posted very helpful comments about their experience using the code that might help you on your way. And of course feel free to post your issue if you can’t find a solution- I’ll do what I can to help.

Most significantly I’ve removed the need for the SerialCommand library and the really hacky HSV->RGB conversion function in favor of the native FastSPI2 conversion which is much faster and cleaner and supports ‘rainbow’ and ‘spectrum’ modes (though for these examples I just stuck to ‘rainbow’.)

I also added one example of a ‘native’ FastSPI effect; the fill_rainbow function (new_rainbow_loop – mode 88). This is similar to the ‘rainbow_loop’ function except that is fades the colors into one another much better. I’ll add more ‘native’ effects functions like fades to the code later because they are much faster and have nicer aesthetic qualities than mine.

Change modes the same way as in the previous code, enter ‘m’ and then an integer for the mode number (listed in code). Also make sure you send a NEWLINE character. Mode 888 is ‘demo mode’ which cycles through all the modes, but this tends to block the next serial command.

Also you can change the maximum brightness with ‘b’ and then an integer from 0-255. By default it’s set to 64, about 1/4 brightness.

Here is the code.

[EDIT] I recently fixed a few issues where I messed up the HSV conversion and I utilized a few more of the FastSPI2 functions. Also finally started giving the code a version number. This one’s v0.3, I’ll do better with that in the future.

Most notably I added the ability to adjust parameters of many of the effects via serial commands. The following commands are now accepted:

(d)elay 0-INF | d50 | Adjusts the delay value, effects run faster or slower.

(s)tep 0-INF | s5 | Adjusts the steps between colors, mostly for rainbow effects.

(h)hue 0-255 | h180 | Adjusts the hue of effect, mostly for one and two color effects.

sa(t)uration 0-255 | s50 | Adjusts the saturation of effect, mostly for one and two color effects.

Here is the code. (v0.3)

If you have any requests feel free to ask, I’ll see what I can do! I’m more-or-less open for business if you have anything in particular you need tackled. And if you find these very useful, please consider donating a little via. paypal, I’d really appreciate it 🙂

[paypal-donation reference=”FastSPI2 LED FX Code”]

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq

Apr 102013

I would like to introduce:

Stanley Tweedle – Captain of the Lexx.
Formerly Security Guard Class 4 for His Divine Shadow, and Assistant Deputy Backup Courier for the Austral B Heretics.


I have a new project that will have to borrow time from my robot stuff for a bit, so I wanted to go ahead and post what
I’ve done so far, mostly for my own reference when I go to pick this up again.

(1) Arduino Nano
(2) 9g Continuous Rotation Hobby Servo
(1) Ultrasonic Rangefinder
(1) 6DOF Acc/Gyro
(1) USB 5V Battery
(3) WS2811 LEDs
(1) Bluetooth chip

Tweedle is complete hardware wise, but I have a little more coding to do before I’m satisfied with his brains. I ran out
of space in the Nano for anything other than input/output so all the control is done from a remote PC via python over
bluetooth/serial. I also made a wiimote script to control him manually. His brains is just basic obstacle avoidance right
now, still trying to see how much nav/odom info I can derive from a 6DOF sensor. Dead reckoning would result in massive
error accumulation, so for right now it just tells him orientation.
Anyway I’m pretty happy with how he’s turned out so far and he’s been a lot of fun. I’m usually not concerned with
aesthetics of these kind of things but I think he’s kinda cute.

This probably won’t help anyone because if you’re deep enough in your a project to understand my code- you’re deep enough
to write it yourself probably faster than it would take to adapt mine to your project… but here is is anyway.

Tweedle Arduino Sketch
Python Ncurses Control Program
Python WiiMote Teleop Program (NOT WORKING)

And here’s some more pics of the wiring…

z2013-09-14_11-34-50_778 z2013-09-14_11-35-19_156 z2013-09-14_11-35-28_663 z2013-09-14_11-36-24_726 z2013-09-14_11-36-40_360


Dec 172012

So here’s my review of the Hexbright – Open Source Flashlight

• It’s insanely bright. You really have no idea. Seriously impressive.
• Good and solid, yeah. Perfect fistful of flashlight but still goes in the pocket. It’s not a mace like a big maglight but you would not want to be cranked upside the head with this. You could drop it on a bare foot without fracturing anything, but you’d remember not to do it again.
• Battery life seems good. Haven’t stress tested but no complaints yet.
• Simple, rugged construction. Twist off end pulls all the guts out of the aluminum and you’ve got access to the board, battery and LED, no problem.
• Nice beam! The single LED and lens give a really unexpectedly beautiful spread. A little hot in the center but it is a flashlight…
• Color temperature – 5380K – just shy of daylight. Meter also showed a tiny green spike in high mode but not noticeable with the eye. Easily color corrected with a little gel.
• Programming – easy to get started (but to be fair I’m pretty experienced with Arduino). Just had to load the board file and I was off and running. Loaded a couple of examples and pretty soon I was adding code the factory firmware. This is where having a ‘programmable’ flashlight is really cool. So for instance I didn’t like the fact that I had do cycle from LOW-MED-HIGH to turn the light off. So I added some code to where a long press after LOW or MED will turn the light off. Lots more possibilities here.
• Overalll: It’s an amazing flashlight and it’s open-source! Get one!
Canon EOS 400D
1/4 s | f/4.0 | 28mm | ISO 400 | Daylight (5200K)

Here’s my hack at the firmware. Adds an ‘ULTRA-LOW’ mode, and a ‘DAZZLE’ mode. Also long-press will turn the light off from any mode.

modified hexbright firmware

Oct 262012

[EDIT] Please check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control Extension.

This code has been revised and I made a new post about it – please see updated post HERE

[EDIT] If you end up using this code for a project please send me a link/pics/video! I love seeing what people do with this! If you like I’ll post a link to your project on the FastSPI FX – User Coolness post. Also make sure to thank Daniel Garcia (the genius dev of the FastSPI library) on the G+ FastSPI Community.

[EDIT] If you have any requests for certain types of effects I’d be happy to look into it. Just let me know what you’re looking to do and I’ll take a swing.

If you find this code very useful please consider donating a little via paypal. I’m having some ‘financial instabilities’ right now and any little bit would help. And if you need a certain effect coded, a donation would certainly obligate me to get that working for you! Sorry for this, it sort of feels like panhandling and the real credit should go to the library creator, but we do what we have to… Thanks for understanding.

[paypal-donation reference=”FastSPI LED FX Code”]

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq


Some LED effects I’ve written for Arduino and FastSPI library.

Mostly written for a circle of LEDs but plenty useful for any configuration.
Code available here… the code

***Here is an update to the FastSPI_2_RC1 – the code

Used WS2811 strip, but have also tested with WS2801.

I’ve only tested this on the duemilanove and nano boards. It’s looking like this does not work on the UNO and I’m not sure about the Leonardo or the new Due.

Several people have indicated problems finding the SerialCommand library – so here’s the version I’m using SerialCommand

Here’s where I found it. Thanks to this guy for the library- Steven Cogswell commands/