MajorAlvega Posted November 21, 2014 Posted November 21, 2014 (edited) Hi all! I don't know if WeDO fits here at "Technic, Mindstorms & Model Team" but didn't find a better forum theme. The ev3dev people are preparing a WeDO driver for Linux. It will allow any Linux system [EV3 ev3dev included] to use WeDO. Not just ONE WeDO USB hub but as many as you want/have. I got excited and got two WeDO USB Hubs and a tilt sensor. And while waiting done my own tests. There is already a python library for WeDO: wedo. But I could not make it work so I used a variation: WeDoMore. It works fine with my Ubuntu laptop and with Mindstorms EV3 running ev3dev. I believe it will also work seamless with a Raspberry Pi, will try it later. Some more details at my blog. I've also found Philo photos of the WeDo internals and used it to reverse-engineering the tilt sensor. With just 4 resistors and a Power Functions connector we can build a 4-switch control and read it as a tilt sensor (one switch for each tilt state). More on this later. Edited November 21, 2014 by MajorAlvega Quote
MajorAlvega Posted November 23, 2014 Author Posted November 23, 2014 Here is the circuit of the tilt sensor. I made a basic 4-key gamepad with 4 RCX touch sensors, here my EV3 using 2 WeDo hubs reading the gamepad to control 2 L-motors More info here. Quote
MajorAlvega Posted November 23, 2014 Author Posted November 23, 2014 Update: since LEGO WeDo uses the C2 pin as an analog input AND it is possible to read the raw values at C2, we can use the WeDo USB hub as an ADC. So I connected a 10K NTC thermistor (a resistor that varies with temperature, when temperature increase it's value decrease) to my modded cable, between C2 and 9V, in parallel with a 10K normal resistor (so that the thermistor varies almost linearly with temperarure, see here). I had not enough time to calibrate yet so here are some in-a-hurry results: - ambient room, after settling: ~180 - touching ice: ~160 - 10cm over a tea candle: ~215 (with nothing connected, just the modded cable, the tilt raw input is 125) Later this week I'll show more details. I also intend to: - read a potentiometer and see if it is usefull for reading a motor position - read a light-dependent resistor to measure light levels Quote
ELItheICEman Posted November 23, 2014 Posted November 23, 2014 Wow, This is great stuff. I am probably a LONG way away from using one, the EV3's are way out of my price range (I've repaired several RCX's and a few scouts to control my projects). I recently saw a broken WeDo hub for sale on bricklink and considered buying it. Assuming I could repair the problem I wondered what I could use it for... Quote
MajorAlvega Posted November 25, 2014 Author Posted November 25, 2014 The ev3dev kernel was updated this night with native driver support for WeDo. So now anyone using EV3 can also use LEGO Power Functions motors and lights through USB with no need for cable modifications and keeping all EV3 motor ports available. Lets hope this driver goes upstream and reaches other distributions so we can use WeDo on-the-go with the Raspberry Pi or a linux laptop. Quote
MajorAlvega Posted November 26, 2014 Author Posted November 26, 2014 (edited) I found a easier and almost purist way of reading temperatures with the WeDo: You just need: - a WeDo Hub (of course) - a WeDo tilt sensor - a Mindstorms RCX Temperature Sensor (9889) - half Power Functions cable - half 9V cable The WeDo tilt sensor is plugged «piggyback» with the half PF cable from which we use C2 and 9V wires to connect to the half 9V cable. The temperature is read from the tilt sensor in raw mode (just assure the tilt sensor itself is always «flat» so it doesn't interfere with the readings. If you don't have or don't want to use a WeDo tilt sensor just solder a 3k9 resistor between C1 and 0V wires of the PF cable (to pretend it is a tilt sensor) and a 10K resistor between C2 and 0V (although you might skeep this aswell). If you don't have or don't want to use 9889 then solder a NTC 10K resistor (less tha €1) between C2 and 9V wires of the PF and use some proper insulation (hot glue, epoxy, duct tape, whatever) It works seamless with Mindstorms EV3 and a PC with Linux. I don't have LEGO WeDo software to test with Windows so I don't know if it is possible to read raw values from the tilt sensor - if it is, then you don't need Linux at all. Edited November 26, 2014 by MajorAlvega Quote
alf_gon Posted December 29, 2014 Posted December 29, 2014 (edited) The ev3dev kernel was updated this night with native driver support for WeDo. So now anyone using EV3 can also use LEGO Power Functions motors and lights through USB with no need for cable modifications and keeping all EV3 motor ports available. Lets hope this driver goes upstream and reaches other distributions so we can use WeDo on-the-go with the Raspberry Pi or a linux laptop. Hi majoralvega, I am also doing my firsts steps on this world by using my :) son lego Wedo playset (ref 9580) which includes a USB hub plus some sensors and a M motor. my goal would be to manage them by using a raspi that i use for playing purposes. Your post question open my eyes about how to face the challenge. I have checked that last 21th december the lego linux drivers you mention were finally published. I am trying to play with it but my previous experience using python libraries seems not very useful when trying to use linux drivers. Anyone has become succesfull using them? Thx Edited December 29, 2014 by alf_gon Quote
MajorAlvega Posted December 29, 2014 Author Posted December 29, 2014 Hi. I have not played yet with the linux drivers outside the EV3 / ev3dev, I'm not even sure if they are already mature enough. I did use with ev3dev and they worked fine (just the Power Functions LED was not recognized but there was a patch right after) so it's just a matter of days/weeks until you can use it with Raspbian or even Ubuntu. I've been playing with SBrick and last week got Raspberry Pi working with it, I have to return to the Pi to repeat it and clean up the process. So give me a few days and I'll try my Pi with WeDo again. Quote
federico28x Posted September 11, 2024 Posted September 11, 2024 (edited) I know it's been 10 years from this topic activity. I want to know if someone knows if the wedo 1.0 hub has the C2 input pin (when setting is sensor raw) configured as pulled up or pull down. Thanks !!! Edited September 11, 2024 by federico28x Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.